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. Announcements
  3. 2.0 Discussion: Units, sensor types and protocol

2.0 Discussion: Units, sensor types and protocol

Scheduled Pinned Locked Moved Announcements
170 Posts 23 Posters 83.8k Views 7 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.
  • L Offline
    L Offline
    lunarok
    wrote on last edited by
    #124

    Hi,

    Not very usefull post for you here, but I want to say I'm very pleased to see this discussion and the news I can read here or what appears in dev on the github.

    About the presentation of sub-type accepted. After getting an almost complete controller for Jeedom, we have difficulties to "predict" things to automate and make it very simple for user to use the plugin. Like for exemple, create commands. For relays and dimmer it was easy, but after when we look for servo or some extra type it's impossible to know for now what we can create.
    So reading, the sensor will tell it in presentation it's just perfect.

    Same for the presentation during node of lib used, that's just better than during the sensors, make sense.

    I read also on the protocol page, that there is a way for a node to request data from gateway/controller. Can this point be clarified, maybe it needs also the sensor/node to say what it can request ? That's also for automation of autolink. For us (Jeedom plugin) and I think for other, if we know the sensor is able to request some data, we can automaticly create the information item and the user will have only to map it to the equipment it wants to point. I don't know if this is still included/planned as I'm aware many of the "smart" part must be on the controller side, but with beautiful things like Scene Controller and LCD display, I can imagine there is a need ?

    I read also the OTA process will change a lot. So, is it better waiting 2.0 to include it on our side ? I mean, for the controller part, will this change a lot of things ?

    And last point, there is actually a internal message type Reboot. This one is indicated only working for OTA bootloader. Is that true ?
    If so, is it possible in 2.0 to include a way to request a complete presentation of an already started sensor. (that's why I ask for the Reboot message, simpler to request a reboot so the node will present itself at the same type)
    Sometimes it's easier when migrating for exemple or reinstall, and we know the ID of sensor to ask it for presentating itself than going there to unplug it.

    That's my thoughs after getting a little more in deep of protocol for the controler/plugin :)

    Cédric

    hekH T 2 Replies Last reply
    0
    • A Offline
      A Offline
      aliasdoc
      wrote on last edited by
      #125

      Hi, I think we could integrate an uuid system in protocol, like this one https://code.google.com/p/tinkerit/wiki/TrueRandom .

      1 Reply Last reply
      0
      • L lunarok

        Hi,

        Not very usefull post for you here, but I want to say I'm very pleased to see this discussion and the news I can read here or what appears in dev on the github.

        About the presentation of sub-type accepted. After getting an almost complete controller for Jeedom, we have difficulties to "predict" things to automate and make it very simple for user to use the plugin. Like for exemple, create commands. For relays and dimmer it was easy, but after when we look for servo or some extra type it's impossible to know for now what we can create.
        So reading, the sensor will tell it in presentation it's just perfect.

        Same for the presentation during node of lib used, that's just better than during the sensors, make sense.

        I read also on the protocol page, that there is a way for a node to request data from gateway/controller. Can this point be clarified, maybe it needs also the sensor/node to say what it can request ? That's also for automation of autolink. For us (Jeedom plugin) and I think for other, if we know the sensor is able to request some data, we can automaticly create the information item and the user will have only to map it to the equipment it wants to point. I don't know if this is still included/planned as I'm aware many of the "smart" part must be on the controller side, but with beautiful things like Scene Controller and LCD display, I can imagine there is a need ?

        I read also the OTA process will change a lot. So, is it better waiting 2.0 to include it on our side ? I mean, for the controller part, will this change a lot of things ?

        And last point, there is actually a internal message type Reboot. This one is indicated only working for OTA bootloader. Is that true ?
        If so, is it possible in 2.0 to include a way to request a complete presentation of an already started sensor. (that's why I ask for the Reboot message, simpler to request a reboot so the node will present itself at the same type)
        Sometimes it's easier when migrating for exemple or reinstall, and we know the ID of sensor to ask it for presentating itself than going there to unplug it.

        That's my thoughs after getting a little more in deep of protocol for the controler/plugin :)

        Cédric

        hekH Offline
        hekH Offline
        hek
        Admin
        wrote on last edited by
        #126

        @lunarok said:

        If so, is it possible in 2.0 to include a way to request a complete presentation of an already started sensor. (that's why I ask for the Reboot message, simpler to request a reboot so the node will present itself at the same type)
        Sometimes it's easier when migrating for exemple or reinstall, and we know the ID of sensor to ask it for presentating itself than going there to unplug it.

        True, reboot would send presentation again. But another option is to save the presentations in the api. Still a bit unclear which option I will choose.

        @aliasdoc
        What do you mean the random number should be used for?

        1 Reply Last reply
        0
        • nneeooN Offline
          nneeooN Offline
          nneeoo
          wrote on last edited by
          #127

          Hi. I would like my nodes measuring various values (temperature, humidity, ...) to send those values at specific times. I don't want to include the RTC on the node, so would like the node to request a sleep period from the controller. I can see there is no such possibility with the version 1.4 of the protocol. What do you think about including such thing?

          1 Reply Last reply
          0
          • hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by
            #128

            You can use VAR1-5 for this in 1.4.

            2.0 will have both VAR (used mostly for pushing custom data) and CONFIG (for custom node configuration).

            nneeooN 1 Reply Last reply
            0
            • BulldogLowellB Offline
              BulldogLowellB Offline
              BulldogLowell
              Contest Winner
              wrote on last edited by BulldogLowell
              #129

              Right now you can use the Time.h library and you don't need an RTC.

              Just sync the time with MySensors call...

              gw.requestTime(receiveTime);
              

              with the function:

              void receiveTime(unsigned long controllerTime) 
              {
                Serial.print("Time value received: ");
                Serial.println(controllerTime);
                RTC.set(controllerTime);
              }
              
              nneeooN 1 Reply Last reply
              0
              • hekH hek

                You can use VAR1-5 for this in 1.4.

                2.0 will have both VAR (used mostly for pushing custom data) and CONFIG (for custom node configuration).

                nneeooN Offline
                nneeooN Offline
                nneeoo
                wrote on last edited by
                #130

                @hek said:

                You can use VAR1-5 for this in 1.4.

                2.0 will have both VAR (used mostly for pushing custom data) and CONFIG (for custom node configuration).

                Yeah, good point. I somehow missed these general purpose variables. It might be good to add a dedicated type for it if you'll find it useful. If not I can live with the VAR for sure ;). Thanks.

                1 Reply Last reply
                0
                • BulldogLowellB BulldogLowell

                  Right now you can use the Time.h library and you don't need an RTC.

                  Just sync the time with MySensors call...

                  gw.requestTime(receiveTime);
                  

                  with the function:

                  void receiveTime(unsigned long controllerTime) 
                  {
                    Serial.print("Time value received: ");
                    Serial.println(controllerTime);
                    RTC.set(controllerTime);
                  }
                  
                  nneeooN Offline
                  nneeooN Offline
                  nneeoo
                  wrote on last edited by
                  #131

                  @BulldogLowell said:

                  Right now you can use the Time.h library and you don't need an RTC.

                  Just sync the time with MySensors call...

                  gw.requestTime(receiveTime);
                  

                  with the function:

                  void receiveTime(unsigned long controllerTime) 
                  {
                    Serial.print("Time value received: ");
                    Serial.println(controllerTime);
                    RTC.set(controllerTime);
                  }
                  

                  Thanks for pointing out this library. However I don't want to track the time on the node, but would like just request the time for which the node should sleep from the controller. I think it makes more sense to have the logic in controller.

                  BulldogLowellB 1 Reply Last reply
                  0
                  • nneeooN nneeoo

                    @BulldogLowell said:

                    Right now you can use the Time.h library and you don't need an RTC.

                    Just sync the time with MySensors call...

                    gw.requestTime(receiveTime);
                    

                    with the function:

                    void receiveTime(unsigned long controllerTime) 
                    {
                      Serial.print("Time value received: ");
                      Serial.println(controllerTime);
                      RTC.set(controllerTime);
                    }
                    

                    Thanks for pointing out this library. However I don't want to track the time on the node, but would like just request the time for which the node should sleep from the controller. I think it makes more sense to have the logic in controller.

                    BulldogLowellB Offline
                    BulldogLowellB Offline
                    BulldogLowell
                    Contest Winner
                    wrote on last edited by
                    #132

                    @nneeoo

                    Oh, you are requesting the duration of the sleep... not the moment at which you wish it to sleep.

                    I thought you were wanting it to transmit data at certain times...

                    nneeooN 1 Reply Last reply
                    0
                    • BulldogLowellB BulldogLowell

                      @nneeoo

                      Oh, you are requesting the duration of the sleep... not the moment at which you wish it to sleep.

                      I thought you were wanting it to transmit data at certain times...

                      nneeooN Offline
                      nneeooN Offline
                      nneeoo
                      wrote on last edited by
                      #133

                      @BulldogLowell said:

                      @nneeoo

                      Oh, you are requesting the duration of the sleep... not the moment at which you wish it to sleep.

                      I thought you were wanting it to transmit data at certain times...

                      Well, yes. I want the node to transmit at certain time. Since the controller should know when that time is, it has to be able to calculate for how long should the node sleep, when the node asks the controller. I hope you get my point.

                      BulldogLowellB 1 Reply Last reply
                      0
                      • nneeooN nneeoo

                        @BulldogLowell said:

                        @nneeoo

                        Oh, you are requesting the duration of the sleep... not the moment at which you wish it to sleep.

                        I thought you were wanting it to transmit data at certain times...

                        Well, yes. I want the node to transmit at certain time. Since the controller should know when that time is, it has to be able to calculate for how long should the node sleep, when the node asks the controller. I hope you get my point.

                        BulldogLowellB Offline
                        BulldogLowellB Offline
                        BulldogLowell
                        Contest Winner
                        wrote on last edited by BulldogLowell
                        #134

                        @nneeoo

                        yes, so you can use Henrik's advice and store a variable which is the time interval in seconds, minutes or even milliseconds.

                        pass that variable into a function that uses that time as the interval to transmit your data from the sensor.

                        something like this... pseudo code

                        int intervalFromController; //in minutes
                        
                        void setup()
                        {
                        
                        }
                        
                        void loop()
                        {
                          gw.begin(getVariables, RADIO_ID, false);
                          //your other stuff
                          updateSensorData(intervalFromController);
                        }
                        
                        void getVariables(const MyMessage &message) //
                        {
                          if (message.sensor == CHILD_ID)
                          {
                            if (message.type == V_VAR1)
                            {
                              // get your V_VAR1
                            }
                          }
                        }
                        updateSensorData(int interval)
                        {
                          static unsigned long lastTransmitTime;
                          if (millis() - lastTransmitTime >= interval *60000UL)
                          {
                            //collect and transmit sensor data
                           //request sensor interval
                          lastTransmitTime += interval * 60000UL;
                          }  
                        }
                        
                        1 Reply Last reply
                        0
                        • L lunarok

                          Hi,

                          Not very usefull post for you here, but I want to say I'm very pleased to see this discussion and the news I can read here or what appears in dev on the github.

                          About the presentation of sub-type accepted. After getting an almost complete controller for Jeedom, we have difficulties to "predict" things to automate and make it very simple for user to use the plugin. Like for exemple, create commands. For relays and dimmer it was easy, but after when we look for servo or some extra type it's impossible to know for now what we can create.
                          So reading, the sensor will tell it in presentation it's just perfect.

                          Same for the presentation during node of lib used, that's just better than during the sensors, make sense.

                          I read also on the protocol page, that there is a way for a node to request data from gateway/controller. Can this point be clarified, maybe it needs also the sensor/node to say what it can request ? That's also for automation of autolink. For us (Jeedom plugin) and I think for other, if we know the sensor is able to request some data, we can automaticly create the information item and the user will have only to map it to the equipment it wants to point. I don't know if this is still included/planned as I'm aware many of the "smart" part must be on the controller side, but with beautiful things like Scene Controller and LCD display, I can imagine there is a need ?

                          I read also the OTA process will change a lot. So, is it better waiting 2.0 to include it on our side ? I mean, for the controller part, will this change a lot of things ?

                          And last point, there is actually a internal message type Reboot. This one is indicated only working for OTA bootloader. Is that true ?
                          If so, is it possible in 2.0 to include a way to request a complete presentation of an already started sensor. (that's why I ask for the Reboot message, simpler to request a reboot so the node will present itself at the same type)
                          Sometimes it's easier when migrating for exemple or reinstall, and we know the ID of sensor to ask it for presentating itself than going there to unplug it.

                          That's my thoughs after getting a little more in deep of protocol for the controler/plugin :)

                          Cédric

                          T Offline
                          T Offline
                          ToSa
                          Code Contributor
                          wrote on last edited by
                          #135

                          @lunarok said:

                          And last point, there is actually a internal message type Reboot. This one is indicated only working for OTA bootloader. Is that true ?

                          Reset and OTA bootloader are independent - but you need to set the fuse bits of the MCU to enable the watchdog for the software reset to work. This is done automatically when flashing the OTA bootloader but you can do that as well in a separate step keeping the existing bootloader (e.g. optiboot).

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            aliasdoc
                            wrote on last edited by
                            #136

                            @hek said:

                            What do you mean the random number should be used for?

                            I am currently trying to develop a bridge between mysensors and home kit managed with RPi and for this purpose I need an uuid different of the id used in the my sensors library and I thought the above library is a good start for the generation of a uuid (almost unique).

                            1 Reply Last reply
                            0
                            • Z Offline
                              Z Offline
                              Zeph
                              Hero Member
                              wrote on last edited by
                              #137

                              If there is interest in using somewhat of a standard rather than rolling our own (and I think a case could be made either way), it would be worth reviewing the IoTDB effort which is also trying to describe the semantics of sensor/actuator control. For example:

                              https://iotdb.org/pub/iot-attribute.html

                              hekH 1 Reply Last reply
                              1
                              • Z Zeph

                                If there is interest in using somewhat of a standard rather than rolling our own (and I think a case could be made either way), it would be worth reviewing the IoTDB effort which is also trying to describe the semantics of sensor/actuator control. For example:

                                https://iotdb.org/pub/iot-attribute.html

                                hekH Offline
                                hekH Offline
                                hek
                                Admin
                                wrote on last edited by
                                #138

                                @Zeph said:

                                https://iotdb.org/pub/iot-attribute.html

                                Thanks interesting reading.

                                1 Reply Last reply
                                0
                                • daulagariD Offline
                                  daulagariD Offline
                                  daulagari
                                  Hero Member
                                  wrote on last edited by
                                  #139

                                  Yes, indeed interesting reading also in the light of controllers.

                                  1 Reply Last reply
                                  0
                                  • L Offline
                                    L Offline
                                    lunarok
                                    wrote on last edited by
                                    #140

                                    Hi,

                                    Please to see this post. As our plugin for Jeedom is complet now, I have some feedback to share.
                                    First, is there a date and status of version 2 for now ?

                                    Here my thoughs :

                                    • about units, I agree with the fact that it's lightier to have the Arduino not taking care of it, but instead use some conversion on the controller side

                                    • about value types, it will be better to have really type and not a notion of unit sometime here too like for power get only consuption and not kwh, really going all the way and give the unit control to the controller

                                    • about value types and sensor types, after writing the plugin, still weird for me to have a sensor presentation giving some clue on what type it is, but need to wait for some value to be sure. I mean power sensor for exemple that can get some different type of values, this is not really clean I think. Or the weather sensor, in one case it will send a value type that is numeric, the other one is text (forecast)

                                    • will it not be better to have some mechanism when it's an actuator to deliver the type of message it is accepting ? for exemple a heater, there is the off/on but also a mode type. How is it possible to know that the sensor is accepting all or only on/off ?

                                    So, for me, something like after a presentation being able on the controller to say what type of data and what commands we can say, will be the best. And important too, what data it can be requesting. I mean, now with the scene_controller to extend functions, we need to get data from the automation software too. Imagine to display some informations from outside the mySensors network.
                                    Maybe by completing the sensor_type and merging with value_types, removing the unit notion inside the value. And so during presentation we know all about the data it can send. And in second step during presentation, declare the actuator commands.

                                    One other point important and asked by some users, is it possible to integrate some security in the protocol ? As soon you talk about actuator accepting command from anyone, that's unsecure. Key given during inclusion by gateway and use for encode the data ?

                                    Thanks for reading

                                    Cédric

                                    1 Reply Last reply
                                    0
                                    • AnticimexA Offline
                                      AnticimexA Offline
                                      Anticimex
                                      Contest Winner
                                      wrote on last edited by
                                      #141

                                      About security, I'm looking into that. I am working on a concept involving key exchange and signing using an external circuit.

                                      Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                                      1 Reply Last reply
                                      0
                                      • L Offline
                                        L Offline
                                        lunarok
                                        wrote on last edited by
                                        #142

                                        Yes for security can be also a first presentation requiring a signing. Like what Puppet is doing, agents first present themself to the master, master is waiting for someone to accept a request, and after it gives the certificate to the client and then the client tell him verything about itself (facts in this view can be compared to the sketch and sensors presentation)

                                        But I don't know if it's easy with arduino this type of exchange.
                                        Other way can be a simple key we put in sketchs, and using the same on every of our home, and use it in the lib to encode the data.

                                        1 Reply Last reply
                                        0
                                        • AnticimexA Offline
                                          AnticimexA Offline
                                          Anticimex
                                          Contest Winner
                                          wrote on last edited by
                                          #143

                                          I am working on a security protocol, and have posted my take on things in the security thread. I will weigh in on this thread once I have verified my design, but so far, only two new message types should be needed, one to request security capabilities and once for capabilities and a nonce. I do not think software based security is a suitable solution due to memory constraints so I am going for a hardware based solution with a pre-shared key. I will publish more concrete examples once I have verified them.

                                          Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

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


                                          19

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          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