Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. I plan to write a mysensor controller core API

I plan to write a mysensor controller core API

Scheduled Pinned Locked Moved Controllers
9 Posts 5 Posters 5.9k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Prateek GuptaP Offline
    Prateek GuptaP Offline
    Prateek Gupta
    wrote on last edited by
    #1

    I checked out many controllers, also the Home-assistant written in python, but due to my requirements I wish to write my own controller in PHP. I wish to write a core api that'll parse nodes, sensors and readings for MySensors. Anybody in future can use it develop their own controllers with a suitable frontend.
    I am having trouble in understanding the serial API of mysensors library, its not documented quite well.

    2;0;1;0;1;37.0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    0;0;3;0;9;read: 2-2-0 s=0,c=1,t=1,pt=7,l=5:38.0
    2;0;1;0;1;38.0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    0;0;3;0;9;read: 2-2-0 s=0,c=1,t=1,pt=7,l=5:37.0
    2;0;1;0;1;37.0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    0;0;3;0;9;read: 2-2-0 s=0,c=1,t=1,pt=7,l=5:38.0
    2;0;1;0;1;38.0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    0;0;3;0;9;read: 2-2-0 s=0,c=1,t=1,pt=7,l=5:37.0
    2;0;1;0;1;37.0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    0;0;3;0;9;read: 2-2-0 s=0,c=1,t=1,pt=7,l=5:38.0
    2;0;1;0;1;38.0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    0;0;3;0;9;read: 1-1-0 s=1,c=1,t=13,pt=2,l=2:6
    1;1;1;0;13;6
    0;0;3;0;9;read: 2-2-0 s=0,c=1,t=1,pt=7,l=5:37.0
    2;0;1;0;1;37.0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    0;0;3;0;9;read: 2-2-0 s=2,c=1,t=16,pt=0,l=1:0
    2;2;1;0;16;0
    

    I still need to understand the serial API. Also, can anybody explain what does

    0;0;3;0;9;read: 2-2-0 s=0,c=1,t=1,pt=7,l=5:38.0
    

    Also, what exactly is the way to design a controller.
    Eg Presentation->Assign IDs-> etc
    Thanks.

    1 Reply Last reply
    0
    • barduinoB Offline
      barduinoB Offline
      barduino
      wrote on last edited by barduino
      #2

      Welcome to the club, there is a buch of folks building controllers (me included).

      I had and still have similar questions, so here are some pointers:

      Checkout this controller implementation in nodeJS it has the basics of a controller.

      Go through the MySensors code, important clues can be found there.

      And of course go through the existing documentation Library API and Serial API

      Cheers

      Prateek GuptaP 1 Reply Last reply
      0
      • barduinoB barduino

        Welcome to the club, there is a buch of folks building controllers (me included).

        I had and still have similar questions, so here are some pointers:

        Checkout this controller implementation in nodeJS it has the basics of a controller.

        Go through the MySensors code, important clues can be found there.

        And of course go through the existing documentation Library API and Serial API

        Cheers

        Prateek GuptaP Offline
        Prateek GuptaP Offline
        Prateek Gupta
        wrote on last edited by
        #3

        @barduino Hey thanks for the links.
        I already checked out the serial API which led me to ask this ques.
        Btw what are the basic functions of a controller?

        • To assign IDs to new nodes
        • Get data and set actuators based on user
        • Get status of nodes

        Anything that I might be missing here?

        Thanks again

        1 Reply Last reply
        0
        • barduinoB Offline
          barduinoB Offline
          barduino
          wrote on last edited by
          #4

          Hi Prateek,

          I can say for sure, I whish we had a list of all the functions... still looking...

          I've started by creatining the auto assign, this forces you to implement message interpertation and message send back.

          Next was the basic ones, message type internal and presentation of the nodes.

          You will get battery level, configuration, scetch name and version, logs from the gateway, etc.

          I still havent implemented all the internal ones...

          Next i did the send messagetype, I created a generic one to log information form the sensors, so far temperature and humidity.

          Next I'll implement sending commands, like turnin on the AC, lights or fans.

          Cheers

          1 Reply Last reply
          0
          • E Offline
            E Offline
            extrablind
            wrote on last edited by
            #5

            Hello,

            I'm interesting in your work. Have you got some sources , a git repository ?
            What kind of connexion do you plan to code for gateway : serial mqtt ?
            BTW, i can be part of coding team.

            Regards

            1 Reply Last reply
            0
            • Prateek Gupta179P Offline
              Prateek Gupta179P Offline
              Prateek Gupta179
              wrote on last edited by
              #6

              @extrablind I forgot username and pass of my original ID. No I dont have a git repo as of now. I plan to host controller on cloud and send the protocol data using a MQTT Broker or HTTP using a RESTful api. I am still planning how to do it. Once I start it I'll surely add you as contributor.

              @barduino do u have a github repo?

              Also, if we make a core API kindoff thing which everyone can use to develop their own controllers it would be really awesome.

              barduinoB 1 Reply Last reply
              0
              • Prateek Gupta179P Prateek Gupta179

                @extrablind I forgot username and pass of my original ID. No I dont have a git repo as of now. I plan to host controller on cloud and send the protocol data using a MQTT Broker or HTTP using a RESTful api. I am still planning how to do it. Once I start it I'll surely add you as contributor.

                @barduino do u have a github repo?

                Also, if we make a core API kindoff thing which everyone can use to develop their own controllers it would be really awesome.

                barduinoB Offline
                barduinoB Offline
                barduino
                wrote on last edited by
                #7

                @Prateek-Gupta179

                I code in a visual language, not very suited for github.

                However you can access my code here

                I did exactly wht you wrote, there is a nodeJS app reading from the serial gateway and sending the payloads to a REST service.

                Cheers

                mntlvrM 1 Reply Last reply
                0
                • barduinoB barduino

                  @Prateek-Gupta179

                  I code in a visual language, not very suited for github.

                  However you can access my code here

                  I did exactly wht you wrote, there is a nodeJS app reading from the serial gateway and sending the payloads to a REST service.

                  Cheers

                  mntlvrM Offline
                  mntlvrM Offline
                  mntlvr
                  wrote on last edited by
                  #8

                  @barduino said:

                  @Prateek-Gupta179

                  I code in a visual language, not very suited for github.

                  However you can access my code here

                  I did exactly wht you wrote, there is a nodeJS app reading from the serial gateway and sending the payloads to a REST service.

                  Cheers

                  Do you plan to make this controller available to the Mysensor forum?

                  barduinoB 1 Reply Last reply
                  0
                  • mntlvrM mntlvr

                    @barduino said:

                    @Prateek-Gupta179

                    I code in a visual language, not very suited for github.

                    However you can access my code here

                    I did exactly wht you wrote, there is a nodeJS app reading from the serial gateway and sending the payloads to a REST service.

                    Cheers

                    Do you plan to make this controller available to the Mysensor forum?

                    barduinoB Offline
                    barduinoB Offline
                    barduino
                    wrote on last edited by
                    #9

                    @mntlvr

                    Absolutely! In fact it has been available since day 1.

                    Check this post

                    Since this is developed using a Platform you need to do some steps to set it up:

                    • Register as a developer here (this is free and there are no strings attached)
                    • Start your free and unlimited personal environment
                    • Install HAALL from here

                    and just hack away.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    16

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • MySensors
                    • OpenHardware.io
                    • Categories
                    • Recent
                    • Tags
                    • Popular