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. Hardware
  3. Node with only sendBatteryLevel into Home Assistant

Node with only sendBatteryLevel into Home Assistant

Scheduled Pinned Locked Moved Hardware
9 Posts 2 Posters 75 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.
  • A Offline
    A Offline
    Arno
    wrote on last edited by
    #1

    Hello experts,

    I've got the following question: Is it possible to have a node provide only it's battery level into home assistant?
    Basically I'm trying to run the example from link text. In the serial monitor of both the Node and the Gateway I'm seeing the battery level percentage correctly but I'm not able to get it to show up in home assistant. Sidenote, I've had a lot
    My hardware:
    Home Assistant running on a HP T620.
    Gateway: Arduino Uno with W5100 shield and NRF24L01+ radio
    Node: Arduino pro mini ATMEGA328p with NRF24L01+ radio with Voltage divider and filter cap from Mysensors documentation:
    link text

    Background: I'm playing around

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Arno
      wrote on last edited by
      #2

      I accidentally hit a keyboard shortcut to post this topic before it was ready. Now I'm not allowed to edit anymore (600s passed):
      Below is the post I intended with my edits to make it more clear:

      Hello experts,

      I've got the following question: Is it possible to have a node provide only it's battery level into home assistant?
      I don't see the example code "presenting" the battery percentage as with the DHT22. Could this be where my issue lies?

      Basically I'm trying to run the example from Mysensors Battery powered sensors. In the serial monitor of both the Node and the Gateway I'm seeing the battery level percentage correctly. I'm not able to get the value to show up in home assistant.

      Sidenote: I've had multiple DHT22 and DS18b20 sensors report succesfully with mysensors into home assistant before. When I was playing around and re-used the arduino (and didn't know to clear the EEPROM) I saw the battery percentage show up in HA under an old node-ID. So I cleared both Node, and Gateway EEPROM (using Mysensors sketch).

      Still no success so I've cleared both EEPROMs again, deleted my gateway in HA, deleted my configuration.yaml. deleted whatever log files I could find in HA, gave a new gateway IP. Reflashed both Arduinos and I'm not getting a "new device detected" in HA.

      My hardware:
      Home Assistant running on a HP T620.
      Gateway: Arduino Uno with W5100 shield and NRF24L01+ radio
      Node: Arduino pro mini ATMEGA328p with NRF24L01+ radio with Voltage divider and filter cap from Mysensors documentation:
      Mysensors Battery powered sensors

      I can include more logs, or whatever you need but I'll stop here to not make this post any bigger.
      Log showing Battery Percentage in the Gateway Log

      1624678 TSF:MSG:READ,1-1-0,s=255,c=3,t=0,pt=1,l=1,sg=0:65
      
      1 Reply Last reply
      0
      • E Offline
        E Offline
        eiten
        wrote on last edited by
        #3

        Well, battery level is an attribute in Home Assistant, so you can only see it as a byproduct of a reading. Workaround is to open the persistence file, there, you can see the battery level even in no reading is shown in the frontend: Bildschirmfoto vom 2023-04-02 23-18-02.png

        1 Reply Last reply
        2
        • A Offline
          A Offline
          Arno
          wrote on last edited by
          #4

          Thank you! I've been breaking my head over this, I'm still extremely new to home assistant and mysensors. It's indeed visible in my persistence file:
          3eabaa6a-3d65-4614-8a35-663ca2b5b6ae-image.png

          Next question: suppose I wish to use these attributes as if they are a sensor, for example in the "gauge" or "chart" card. Is there a common best practice you'd recommend me?

          I've found a topic on the home assistant website describing ways to use an attribute by creating a sensor entry in the configuration.yaml file.

          Home Assistant Community Lovelace UI - Gauge Card: Add attribute variable

          E 1 Reply Last reply
          0
          • A Arno

            Thank you! I've been breaking my head over this, I'm still extremely new to home assistant and mysensors. It's indeed visible in my persistence file:
            3eabaa6a-3d65-4614-8a35-663ca2b5b6ae-image.png

            Next question: suppose I wish to use these attributes as if they are a sensor, for example in the "gauge" or "chart" card. Is there a common best practice you'd recommend me?

            I've found a topic on the home assistant website describing ways to use an attribute by creating a sensor entry in the configuration.yaml file.

            Home Assistant Community Lovelace UI - Gauge Card: Add attribute variable

            E Offline
            E Offline
            eiten
            wrote on last edited by
            #5

            @Arno

            sensor:
              - platform: template
                sensors:
                  greenhouse_battery:
                    friendly_name: "Batterie Gewächshaus-Klimasensor"
                    unit_of_measurement: "%"
                    icon_template: mdi:battery
                    unique_id: "greenhouse_battery"
                    value_template: "{{ states.sensor.air_temperature.attributes.battery_level }}"
            
            1 Reply Last reply
            1
            • A Offline
              A Offline
              Arno
              wrote on last edited by
              #6

              Hi Eiten,

              I appreciate you helping me out. Unfortunately I'm still not getting it to work.
              How do I find the correct "name" of the battery measuring node?

              See a screenshot of my configuration.yaml. I've added a random binary sensor + sensor of the average ping time attribute (Fritzbox ping time avg) and that works as expected.

              Where do I find what I need to fill for "Battery_Meter2".
              The screenshot of my persistence file is also given: (same as above basically, there is an upload error for some reason)
              ![0_1681035971813_b5780ffd-b9ab-49d9-99ca-f2ffd2edd6c6-image.png](Uploading 100%)
              ![0_1681036107234_d45cb8ad-ac5a-44c0-a456-707aeeb6be51-image.png](Uploading 100%)

              1 Reply Last reply
              0
              • E Offline
                E Offline
                eiten
                wrote on last edited by
                #7

                Hey Arno,

                now it's getting a little bit complicated... as I have my HomeAssistant in German. Go to "Developement tools" (Entwicklerwerkzeuge), then to "States" (Zustände). There you can finde the name of your device.

                1 Reply Last reply
                1
                • A Offline
                  A Offline
                  Arno
                  wrote on last edited by
                  #8

                  Hi Eiten,

                  Vielen dank :). I've been succesfull to get a battery level to come through. Thanks again.

                  In the end I used a DHT22 sensor with battery monitoring and the node was automatically detected as a "device". In the "states" section you mentioned I can also see my previous attempts with just battery monitoring so I'm confident it would work too.

                  1 Reply Last reply
                  1
                  • E Offline
                    E Offline
                    eiten
                    wrote on last edited by
                    #9

                    Great! I'm glad it works and thank you very much for reporting back!

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


                    20

                    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