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. OpenHAB
  4. Battery Level from Mysensor node

Battery Level from Mysensor node

Scheduled Pinned Locked Moved OpenHAB
battery monitor
9 Posts 3 Posters 4.0k Views 3 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.
  • MasonkanteM Offline
    MasonkanteM Offline
    Masonkante
    wrote on last edited by
    #1

    Hi,

    I know my problem is probably present in this forum, I try to find it but with no results.

    I'm using Openhab 1.8.1 on Raspberry Pi 2, mqtt mysensor gateway and I have a node with arduino nano (temperature, humidity, motion and light sensor). MySensor version is 1.5.

    I want to integrate it with power battery and I want to monitor the battery level in Openhab (I get the project directly from mysensor site) .
    I see that mysensor has sendBatteryLevel, but I don't succeed to show value in my sitemap.
    Battery level is internal message like sketch name but I succeed to show sketch name in openhab using the follow string request:

    mqtt="<[mysensor:MyMQTT/20/255/V_SKETCH_NAME:state:default]"
    

    How can see battery level sent using sendBatteryLevel? Is possible without using custom message?

    Thanks in advance.

    M 1 Reply Last reply
    0
    • MasonkanteM Masonkante

      Hi,

      I know my problem is probably present in this forum, I try to find it but with no results.

      I'm using Openhab 1.8.1 on Raspberry Pi 2, mqtt mysensor gateway and I have a node with arduino nano (temperature, humidity, motion and light sensor). MySensor version is 1.5.

      I want to integrate it with power battery and I want to monitor the battery level in Openhab (I get the project directly from mysensor site) .
      I see that mysensor has sendBatteryLevel, but I don't succeed to show value in my sitemap.
      Battery level is internal message like sketch name but I succeed to show sketch name in openhab using the follow string request:

      mqtt="<[mysensor:MyMQTT/20/255/V_SKETCH_NAME:state:default]"
      

      How can see battery level sent using sendBatteryLevel? Is possible without using custom message?

      Thanks in advance.

      M Offline
      M Offline
      mbj
      wrote on last edited by
      #2

      @Masonkante I could not make it work with MySensors v1.5, Openhab and the Sensebender sketch because (as you have noticed) battery level is an internal message. I had to make a custom message but this is easily made so it is not much of a drawback. I wanted a message for the actual level in mV as well so it did not matter much.

      1 Reply Last reply
      0
      • MasonkanteM Offline
        MasonkanteM Offline
        Masonkante
        wrote on last edited by
        #3

        Hi,

        Thanks for your answer @mbj !
        I implement sending of battery level using custom message.
        It is a good solution for me.

        In this moment I have system connected to usb via programmer (not to power battery, it is my next step).
        I see that arduino read a variable battery level on analogic input...from max voltage level 100% to 85% level.
        It's normal behavior?

        I think that using costant power supply the level must be always at 100%.
        I suppose the problem is connected or to arduino analogic input or to usb power supply (even if using a tester on circuit voltage seem to be costant).
        Have you ever seen something similar?

        Thanks in advance.

        M 1 Reply Last reply
        0
        • MasonkanteM Masonkante

          Hi,

          Thanks for your answer @mbj !
          I implement sending of battery level using custom message.
          It is a good solution for me.

          In this moment I have system connected to usb via programmer (not to power battery, it is my next step).
          I see that arduino read a variable battery level on analogic input...from max voltage level 100% to 85% level.
          It's normal behavior?

          I think that using costant power supply the level must be always at 100%.
          I suppose the problem is connected or to arduino analogic input or to usb power supply (even if using a tester on circuit voltage seem to be costant).
          Have you ever seen something similar?

          Thanks in advance.

          M Offline
          M Offline
          mbj
          wrote on last edited by
          #4

          @Masonkante So far I have only one battery powered node, the Sensebender Micro. I do not remember seeing any varying readings when connected to the programmer but this node is powered from programmer only during programming.
          So I do not have much experience from running it on power from a FDTI programmer.

          You mentioned first that your node is a nano so it is a bit unclear to me if you refer to a Sensebender or a nano.

          1 Reply Last reply
          0
          • MasonkanteM Offline
            MasonkanteM Offline
            Masonkante
            wrote on last edited by
            #5

            @mbj
            I'm using arduino nano.
            I will try to test the configuration and also use other arduino type.
            May be a possible configuration or hardware error, I need to verify circuit.

            Thanks!

            M 1 Reply Last reply
            0
            • MasonkanteM Masonkante

              @mbj
              I'm using arduino nano.
              I will try to test the configuration and also use other arduino type.
              May be a possible configuration or hardware error, I need to verify circuit.

              Thanks!

              M Offline
              M Offline
              mbj
              wrote on last edited by
              #6

              @Masonkante With the nano you have power regulators and other stuff involved as well. Also you will get a poor battery life using that one if it is not modified a lot. Have you looked at this?
              https://www.mysensors.org/build/battery

              1 Reply Last reply
              0
              • MasonkanteM Offline
                MasonkanteM Offline
                Masonkante
                wrote on last edited by
                #7

                @mbj
                Yes, I know it.
                My idea is to switch to arduino pro mini, remove power led and test duration, before remove the regulator.
                Nano is used only to develop sketch and test connection.

                M 1 Reply Last reply
                0
                • MasonkanteM Masonkante

                  @mbj
                  Yes, I know it.
                  My idea is to switch to arduino pro mini, remove power led and test duration, before remove the regulator.
                  Nano is used only to develop sketch and test connection.

                  M Offline
                  M Offline
                  mbj
                  wrote on last edited by
                  #8

                  @Masonkante Another alternative is to build your own using a 328P-PU chip. This is at least a lot more fun and the only thing needed is the chip itself (almost).

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Samuel235
                    Hardware Contributor
                    wrote on last edited by
                    #9

                    Hello there @Masonkante - I recommend that you check out my current build for reference to battery powering a custom board. I have created a board that uses a ATmega328p-au powered through a coin cell battery to act as a switch module. By all means use my thread for information on how to create a low powered arduino alternative for your desired needs.

                    Thanks,
                    Sam.

                    MySensors 2.1.1
                    Controller - OpenHAB (Virtual Machine)
                    Gateway - Arduino Mega MQTT Gateway W5100

                    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