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. Feature Requests
  3. S_COMBO to merge multiple sensors input

S_COMBO to merge multiple sensors input

Scheduled Pinned Locked Moved Feature Requests
4 Posts 3 Posters 1.8k Views 2 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.
  • X Offline
    X Offline
    X-Ryl669
    wrote on last edited by
    #1

    S_COMBO/V_COMBO new mode in order to merge multiple sensors value in a single message
    The basic structure should be like this:

    When type is S_COMBO/V_COMBO, the payload is made with multiple (uint8 variable-type, uint8 data[]) tuple, up to 24 bytes.
    For example, if you have a node that's temperature and humidity capable, it would send a message like this:

    MyMessage msg(CHILD_ID, V_COMBO);
    uint8 msgTemplate[] = { V_TEMP, 0, V_HUM, 0 };
    [...]
    msgTemplate[1] = readCurTemp(); msgTemplate[3] = readCurHum();
    gw.send(msg.set(msgTemplate));
    

    This would require almost no modification to the current software.
    The main advantage is saving power, only a single packet is sent (instead of multiple packets for each sensor, plus ACK).
    This limits however each type payload to one byte.
    Another improvement would be to reuse the existing parsing code by adding a MyMessage.set/get method like this:

    inline bool isCombo() const { return type == V_COMBO; }
    MyMessage & setCombo(uint8_t pos, uint8_t type, uint8_t value) 
    { 
        data[pos*2] = type; data[pos*2+1] = value; 
        return *this; 
    }
    

    On the gateway, an additional case should be taken when serializing to/from Ethernet or Serial so it appears not like a combo.

    1 Reply Last reply
    0
    • tbowmoT Offline
      tbowmoT Offline
      tbowmo
      Admin
      wrote on last edited by
      #2

      @X-Ryl669

      Why not just send multiple packages, one for each sensor type?

      X 1 Reply Last reply
      0
      • tbowmoT tbowmo

        @X-Ryl669

        Why not just send multiple packages, one for each sensor type?

        X Offline
        X Offline
        X-Ryl669
        wrote on last edited by
        #3

        @tbowmo Each packages would use a single message. Here, the idea is that a single message of 32 bytes does not take more power to send than a message of 12 bytes (what's power hungry is waking up the radio, transmitting a burst). For battery powered device, it makes a difference

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

          Interesting idea,

          Maybe you could let gateway unpack the COMBO message before handing it over to controller. This way no additional changes is needed on that side.

          I would appreciate if you wanted to create a github pull request (on the development branch) with your verified changes.

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


          17

          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