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. Development
  3. Can I associate sensor value directly to arduino node device?

Can I associate sensor value directly to arduino node device?

Scheduled Pinned Locked Moved Development
5 Posts 2 Posters 1.0k 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.
  • coffeeaddictC Offline
    coffeeaddictC Offline
    coffeeaddict
    wrote on last edited by coffeeaddict
    #1

    I searched the forums but can't seem to find this addressed anywhere.

    I am currently setting battery percentage by calling sendBatterlyLevel(), this sets a a variable BatteryLevel variable on my arduino node device on Vera Edge.
    I also created a sensor to set a voltage variable on a sensor device for this arduino node:

    • MyMessage voltageMsg(CHILD_ID_BATTERY, V_VOLTAGE);
    • ...
    • present(CHILD_ID_BATTERY, S_POWER);
    • ...
    • send(voltageMsg.set(setVoltage, 1)); //set voltage and how many decimals (1 in our case)

    This works fine but all I care about is voltage so would be nice if I could simply set a voltage variable on the arduino node device in vera and dispense and have one less sensor device (the S_POWER sensor device).

    If I assign a specific node id NODE_ID to my arduino node device could I do something like:

    • #define MY_NODE_ID 1
    • ...
    • MyMessage voltageMsg(MY_NODE_ID, V_VOLTAGE); or maybe MyMessage voltageMsg(MY_NODE_ID, V_VAR1);
    • ...
    • send(voltageMsg.set(12.1, 1)); //set voltage and how many decimals (1 in our case)

    FYI - the reason I want voltage in addition to battery percentage is to get something more specific AND because I've chosen to limit battery percentage range to vals corresponding to 0 - 12.5 volts (typical for my battery when NOT charging) while the voltages I see actually go well over that when my solar system is charging.

    Thanks

    1 Reply Last reply
    0
    • mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      What you've already done is the way to do it.

      If you have a temperature node and all you care about is temperature, you have a single child sensor with temperature.
      If you have a voltage node and all you care about is voltage you have a single child sensor with voltage.

      1 Reply Last reply
      0
      • coffeeaddictC Offline
        coffeeaddictC Offline
        coffeeaddict
        wrote on last edited by
        #3

        Yeah, I realize that is preferred way but in this case, since battery percentage is already going to the arduino node device in vera, why not set voltage there as well?
        On the other hand, I realize I used the wrong sensor device type S_POWER when I should have used S_MULTIMETER. I will switch this and
        hopefully voltage will show up in the vera UI directly for that sensor device without having to drill down to view variables.

        Did more searching and found Push Data to Vera Node
        where @hek reveals one can use child id 255 for the arduino node so I may try this as well.

        1 Reply Last reply
        0
        • mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by mfalkvidd
          #4

          sendBatteryLevel actually uses child id 255. You can see that if you look at the debug output from the node or the gateway. I am not sure how controllers handle getting other values than battery percentage on that child id though.

          coffeeaddictC 1 Reply Last reply
          0
          • mfalkviddM mfalkvidd

            sendBatteryLevel actually uses child id 255. You can see that if you look at the debug output from the node or the gateway. I am not sure how controllers handle getting other values than battery percentage on that child id though.

            coffeeaddictC Offline
            coffeeaddictC Offline
            coffeeaddict
            wrote on last edited by
            #5

            I verified a variable named Voltage DOES get created and is set on the Vera arduino node device if I create MyMessage with:

            • MyMessage voltageMsg(255, V_VOLTAGE);

            and send value with:

            • send(voltageMsg.set(12.1, 1));
            1 Reply Last reply
            1
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            18

            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