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. Domoticz
  4. Add demand variable to electricity pulse counter

Add demand variable to electricity pulse counter

Scheduled Pinned Locked Moved Domoticz
5 Posts 2 Posters 1.7k 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.
  • carlylerC Offline
    carlylerC Offline
    carlyler
    wrote on last edited by carlyler
    #1

    Great work here MySensors team and thank you for sharing. I am just getting started.
    After some struggling with my first controller choice I tried Domoticz, with the development branch, and sensors attached to the ESP8266 GW came right up! However, I immediately need help. I cannot find anything that explains how to add a variable to a sensor and get it recognized in the controller. Can someone please share an example? Others have asked, some have come up with a work around and some have went unanswered. I am not deterred by difficulty, but I need at least an outline to begin the journey.
    Why am I trying to do this: Our electric plan has a demand component so it is very handy to see and track that value. Obviously, the pulse rate, or "interval" in the MySensor example, is the demand I just need to get that displayed in the controller.

    edit: sorry, after reading my post and looking at some old code I realized your doing everything and Watt is the instantaneous demand, however what I am needing is the power company's demand, which is calculated over a 30min interval. Since I have Watts, I have 2 choices: 1) record that in the sensor and send it up, or 2) record it in the controller, then that becomes more of a Domoticz question, I guess. Personally I like 1, but could be persuaded.

    Comments/suggestions?

    1 Reply Last reply
    0
    • carlylerC Offline
      carlylerC Offline
      carlyler
      wrote on last edited by
      #2

      My thought process and findings:
      I found the custom values, V_VAR[1:5], but I also found a post that says these are not accessible in Domoticz. So this makes me wonder why, and what good are they? Only for developers I surmise.
      I wondered who stipulates that S_POWER will only report V_WATT and V_KWH? Then I realized that probably a lot of changes need to occur on both GW and Cntlr to support another var.
      I found this Domoticz post from a link in MySensors forum, https://www.domoticz.com/forum/viewtopic.php?t=6517, where he suggests just sending up another sensor, a virtual sensor if you will. I tried it and it works great!

       // Register this device as power sensor
         present(CHILD_ID_HEM, S_POWER);
         present(CHILD_ID_HEM2, S_POWER);
      

      0_1474284754959_DomoticzUtility.jpg

      I still feel 1 or custom variables in each sensor type, that you can have access to in the cntlr, might come in handy.

      AWIA 1 Reply Last reply
      0
      • carlylerC carlyler

        My thought process and findings:
        I found the custom values, V_VAR[1:5], but I also found a post that says these are not accessible in Domoticz. So this makes me wonder why, and what good are they? Only for developers I surmise.
        I wondered who stipulates that S_POWER will only report V_WATT and V_KWH? Then I realized that probably a lot of changes need to occur on both GW and Cntlr to support another var.
        I found this Domoticz post from a link in MySensors forum, https://www.domoticz.com/forum/viewtopic.php?t=6517, where he suggests just sending up another sensor, a virtual sensor if you will. I tried it and it works great!

         // Register this device as power sensor
           present(CHILD_ID_HEM, S_POWER);
           present(CHILD_ID_HEM2, S_POWER);
        

        0_1474284754959_DomoticzUtility.jpg

        I still feel 1 or custom variables in each sensor type, that you can have access to in the cntlr, might come in handy.

        AWIA Offline
        AWIA Offline
        AWI
        Hero Member
        wrote on last edited by
        #3

        @carlyler Hi, I am trying to understand what you want to accomplish.. What does the 'demand' value from the electricity company stand for? I would like to assume that this would be expressed in kWh or (avg.) Watt. Either way you can use the standard power sensors in both Domoticz and MySensors. Please let us know.

        1 Reply Last reply
        1
        • carlylerC Offline
          carlylerC Offline
          carlyler
          wrote on last edited by
          #4

          Hi AWI.
          You have the idea. They watch in 30min intervals the amount of power you consume or average kW. Then they charge you for the largest interval they saw in the billing cycle. I think of as charging and discharging a cap; in code I used a fixed length FIFO and subtract the ends, which are delta 30min.

          I agree, and you likely read how I handled it, would you suggest a different approach? Being new it just took me awhile to realize that I could present a virtual sensor.

          AWIA 1 Reply Last reply
          0
          • carlylerC carlyler

            Hi AWI.
            You have the idea. They watch in 30min intervals the amount of power you consume or average kW. Then they charge you for the largest interval they saw in the billing cycle. I think of as charging and discharging a cap; in code I used a fixed length FIFO and subtract the ends, which are delta 30min.

            I agree, and you likely read how I handled it, would you suggest a different approach? Being new it just took me awhile to realize that I could present a virtual sensor.

            AWIA Offline
            AWIA Offline
            AWI
            Hero Member
            wrote on last edited by
            #5

            @carlyler thanks for the explanation. That's an interesting way of charging for electricity... The "virtual sensor" had me a little confused as it is also used to create real virtual devices in Domoticz. I think you handled it the royal way. Although you could argue that the "calculation" should take place in the controller.
            Have fun and when you designed a way to lower your electricity bill let me know :smile:

            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