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. My Project
  3. MySensorsTracker - a simple logger for MySensors MQTT messages

MySensorsTracker - a simple logger for MySensors MQTT messages

Scheduled Pinned Locked Moved My Project
diagnosemqttdatabaselogging
7 Posts 4 Posters 148 Views 6 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.
  • C Offline
    C Offline
    canyouhearmenow
    wrote on last edited by
    #1

    I needed a simple tool for keeping track of all the MySensors nodes which I had built and deployed around the house over the years:

    • what is the battery level of each sensor node?
    • what was the last time I changed the battery on that sensor node, i.e. how many months has it been running with the current battery?
    • see at a glance if a sensor has crashed, i.e. has not sent any messages for, say, more than a day
    • is a sensor node sending strange messages?

    This is implemented as a Python script running on a server, with a web-based interface for browsing and filtering messages.

    Source code and documentation in Github

    Here are a few screenshots:
    f0dc543d-0d2c-4411-9ae3-39f6da5b62a9-image.png

    b1865410-8e2e-42f5-92c1-562cdab6e604-image.png

    c2e0a623-5b2c-46b7-adc3-a54c69b67939-image.png

    skywatchS 1 Reply Last reply
    5
    • C canyouhearmenow

      I needed a simple tool for keeping track of all the MySensors nodes which I had built and deployed around the house over the years:

      • what is the battery level of each sensor node?
      • what was the last time I changed the battery on that sensor node, i.e. how many months has it been running with the current battery?
      • see at a glance if a sensor has crashed, i.e. has not sent any messages for, say, more than a day
      • is a sensor node sending strange messages?

      This is implemented as a Python script running on a server, with a web-based interface for browsing and filtering messages.

      Source code and documentation in Github

      Here are a few screenshots:
      f0dc543d-0d2c-4411-9ae3-39f6da5b62a9-image.png

      b1865410-8e2e-42f5-92c1-562cdab6e604-image.png

      c2e0a623-5b2c-46b7-adc3-a54c69b67939-image.png

      skywatchS Offline
      skywatchS Offline
      skywatch
      wrote on last edited by
      #2

      @canyouhearmenow That looks practical and useful - well done!

      1 Reply Last reply
      0
      • CrankyCoderC Offline
        CrankyCoderC Offline
        CrankyCoder
        wrote on last edited by
        #3

        has anyone thrown this in a docker yet? :)

        Home Automation Tinkerer
        www.CrankyCoder.net

        Controller: HomeAssistant in Kubernetes
        Gateway: MQTTClientGateway
        MySensors: 2.3

        1 Reply Last reply
        0
        • E Offline
          E Offline
          evb
          wrote on last edited by
          #4

          @canyouhearmenow I've adapted your script to support authentication and SSL connection. See my pull request :-)

          Meanwhile, I see in your printscreens, API, version, battery changed, etc.
          Is this data filled in via your sketches? Are the nodes sending this information? Via the presentation?

          C 1 Reply Last reply
          0
          • E evb

            @canyouhearmenow I've adapted your script to support authentication and SSL connection. See my pull request :-)

            Meanwhile, I see in your printscreens, API, version, battery changed, etc.
            Is this data filled in via your sketches? Are the nodes sending this information? Via the presentation?

            C Offline
            C Offline
            canyouhearmenow
            wrote on last edited by
            #5

            @evb Thanks for your contribution, I will look at your pull request as soon as I can!

            I have adopted a convention for my sketches where they all report the project name and subversion revision number. In the presentation() function, I have a line like

            sendSketchInfo("MyWindowSensor", "$Rev: 1267 $" );
            

            The API version is sent by the MySensors framework automatically.

            The date of the last battery change I have to enter manually (Nodes screen, popup menu item "battery replaced" when you hover over the node number).

            E 1 Reply Last reply
            0
            • C canyouhearmenow

              @evb Thanks for your contribution, I will look at your pull request as soon as I can!

              I have adopted a convention for my sketches where they all report the project name and subversion revision number. In the presentation() function, I have a line like

              sendSketchInfo("MyWindowSensor", "$Rev: 1267 $" );
              

              The API version is sent by the MySensors framework automatically.

              The date of the last battery change I have to enter manually (Nodes screen, popup menu item "battery replaced" when you hover over the node number).

              E Offline
              E Offline
              evb
              wrote on last edited by evb
              #6

              @canyouhearmenow I didn't see my version of the sketch, but then I saw that the column sk_version was commented out.
              I added again this missing column. I don't use revision, only version.

              I saw also that the api_version of my repeaters were not reported. I added support for this to the code.

              The sqlite db is filling up with all these mqtt messages.
              Do you clean up this after some time?

              Great work, thanks for putting it online :-)

              C 1 Reply Last reply
              0
              • E evb

                @canyouhearmenow I didn't see my version of the sketch, but then I saw that the column sk_version was commented out.
                I added again this missing column. I don't use revision, only version.

                I saw also that the api_version of my repeaters were not reported. I added support for this to the code.

                The sqlite db is filling up with all these mqtt messages.
                Do you clean up this after some time?

                Great work, thanks for putting it online :-)

                C Offline
                C Offline
                canyouhearmenow
                wrote on last edited by
                #7

                @evb Still haven't had a chance to look at your PR, sorry.
                Yes, the database tends to grow :-) I have about 80MB after a year of use. Just added a function to delete all messages older than, say, a year.

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


                15

                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