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. Announcements
  3. πŸ’¬ Power Meter Pulse Sensor

πŸ’¬ Power Meter Pulse Sensor

Scheduled Pinned Locked Moved Announcements
183 Posts 40 Posters 45.0k Views 37 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.
  • gohanG Offline
    gohanG Offline
    gohan
    Mod
    wrote on last edited by
    #107

    @hek is it me or the WATT readings are never sent? What could it be? Only V_VAR1 and V_KWH are sent.

    1 Reply Last reply
    0
    • gohanG gohan

      BTW, is there a way to have the pulse meter running on gateway? I got stuck because at startup it asks the controller the last count value and since the controller is not yet connected it just doesn't work.

      rejoe2R Offline
      rejoe2R Offline
      rejoe2
      wrote on last edited by
      #108

      @gohan How about

      #define MY_TRANSPORT_WAIT_READY_MS 2000
      

      This will start up your code so you won't miss any pulses until controller is ready.
      You may ask for the last known Value in presentation(), then it will be fetched as soon as the controller is really there after startup. This could/should be combined with a bool pcReceived, so you may decide to either add the value received from controller to the counts the node meassured in between or just use the received value (starting from second time value is received from controller).

      Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

      1 Reply Last reply
      0
      • gohanG Offline
        gohanG Offline
        gohan
        Mod
        wrote on last edited by
        #109

        That actually is not that critical, as I am going to move to MQTT and that should be working anyway. Right now it is working on a UNO with NRF24, but my biggest issue is the WATT reading that it is missing

        1 Reply Last reply
        0
        • gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #110

          Any more suggestions on the Watt issue?

          1 Reply Last reply
          0
          • hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by
            #111

            Did you by any chance change SLEEP_MODE to true?

            gohanG 1 Reply Last reply
            0
            • gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #112

              No, I get every pulse reported as soon as it is detected.

              1 Reply Last reply
              0
              • gohanG Offline
                gohanG Offline
                gohan
                Mod
                wrote on last edited by gohan
                #113

                I think I found a problem: the WATT calculation is returning values over 172000 watts and since I put 10000 as the max value, it was not sending anything. I double checked my energy meter and indeed it is 1000 pulses per KWH and this is what I set in sketch

                1 Reply Last reply
                1
                • hekH hek

                  Did you by any chance change SLEEP_MODE to true?

                  gohanG Offline
                  gohanG Offline
                  gohan
                  Mod
                  wrote on last edited by
                  #114

                  @hek I said I found the problem, I didn't say I know how to solve it πŸ˜…

                  1 Reply Last reply
                  0
                  • gohanG Offline
                    gohanG Offline
                    gohan
                    Mod
                    wrote on last edited by
                    #115

                    Here is the log I get from node

                    7230 TSF:MSG:READ,0-0-250,s=1,c=2,t=24,pt=0,l=7,sg=0:1682675
                    rece
                    
                    Received last pulse count from gw:1682675
                    
                    11817 TSF:MSG:SEND,250-250-0-0,s=1,c=1,t=17,pt=5,l=4,sg=0,ft=0,st=OK:528
                    Watt:528
                    
                    Watt:197065
                    
                    21820 TSF:MSG:SEND,250-250-0-0,s=1,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=OK:1682677
                    21913 TSF:MSG:SEND,250-250-0-0,s=1,c=1,t=18,pt=7,l=5,sg=0,ft=0,st=OK:1682.6770
                    Watt:196807
                    
                    36824 TSF:MSG:SEND,250-250-0-0,s=1,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=OK:1682679
                    36917 TSF:MSG:SEND,250-250-0-0,s=1,c=1,t=18,pt=7,l=5,sg=0,ft=0,st=OK:1682.6790
                    Watt:197368
                    
                    51827 TSF:MSG:SEND,250-250-0-0,s=1,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=OK:1682681
                    51920 TSF:MSG:SEND,250-250-0-0,s=1,c=1,t=18,pt=7,l=5,sg=0,ft=0,st=OK:1682.6810
                    Watt:196850
                    

                    Am I the only one using this sketch?

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mickecarlsson
                      wrote on last edited by
                      #116

                      Please post you sketch.

                      1 Reply Last reply
                      0
                      • gohanG Offline
                        gohanG Offline
                        gohan
                        Mod
                        wrote on last edited by
                        #117

                        it is the one in https://www.mysensors.org/build/pulse_power

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          mickecarlsson
                          wrote on last edited by mickecarlsson
                          #118

                          How is the pulse counter set up? Is it connected to the S0 port?
                          Edit:
                          If you are using S0 it is vital that you use a pull down resistor, if you dont’t have that you get false pulses.
                          pulse connection

                          1 Reply Last reply
                          0
                          • gohanG Offline
                            gohanG Offline
                            gohan
                            Mod
                            wrote on last edited by
                            #119

                            I'm using the lm393 light detector. Domoticz is able to do a calculation from the pulses to give a Watt value and it is correct but it does it every 5 minutes and it is too slow for me

                            sundberg84S 1 Reply Last reply
                            0
                            • gohanG gohan

                              I'm using the lm393 light detector. Domoticz is able to do a calculation from the pulses to give a Watt value and it is correct but it does it every 5 minutes and it is too slow for me

                              sundberg84S Offline
                              sundberg84S Offline
                              sundberg84
                              Hardware Contributor
                              wrote on last edited by
                              #120

                              @gohan - is Domoticz updating anything (except switches) faster than 5 min? I dont think so...

                              Controller: Proxmox VM - Home Assistant
                              MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
                              MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
                              RFLink GW - Arduino Mega + RFLink Shield, 433mhz

                              S 1 Reply Last reply
                              2
                              • gohanG Offline
                                gohanG Offline
                                gohan
                                Mod
                                wrote on last edited by
                                #121

                                If you send the watt reading faster it updates like the switch, anyway I need the watt values for node-red also

                                1 Reply Last reply
                                0
                                • gohanG Offline
                                  gohanG Offline
                                  gohan
                                  Mod
                                  wrote on last edited by
                                  #122

                                  Could it be the Light sensor is triggering more interrupts from each pulse?

                                  1 Reply Last reply
                                  0
                                  • NiklasON NiklasO

                                    Just changed from 1-wire counter to MySensors for logging my power consumption. Using the same LED detector as I did when using 1-wire. Also changed watt limit to 20 000 (my heat pump likes to use 9-10kW sometimes). The wires from the old 1-wire net now provide power for the new MySensors-sensor. I have 10 000 led blinks per kWh. Had som crazy counter values with 1-wire that totally messed up the graphs and haven't seen anything like that with this sketch. Let's hope it stays that way. ;) Dumping data to Domoticz. This sensor gives me higher resolution as a bonus. The 1-wire counter was read every minute, this every 20-sec. ;-)

                                    0_1490286464866_Domoticz_-_Google_Chrome_2017-03-23_17-27-32_78641890.png

                                    0_1490286540285_Domoticz_-_Google_Chrome_2017-03-23_17-28-46_94994234.png

                                    My old 1-wire counter with one crazy value messing upp all the graphs:
                                    0_1490286637201_Domoticz_-_Google_Chrome_2017-03-23_17-30-09_29365468.png
                                    I know that you can hold shift and click the value that is crazy to make the graphs show up good but you loose the data for the full day. That's not good. ;-)

                                    henninneH Offline
                                    henninneH Offline
                                    henninne
                                    wrote on last edited by
                                    #123

                                    @niklaso

                                    Hi Niklas,

                                    I know this is a very old post, but its worth a try. How did you get out the daily Kwh usage? As default my sensor only gives Watts and Kwh (accumulated from start), I have tried to run a Scene in Vera UI7 where there are a function in the sensor called resetKWh(), but it looks like it doesn't do anything. Any tips would be great, thanks.

                                    Henning

                                    1 Reply Last reply
                                    0
                                    • sundberg84S sundberg84

                                      @gohan - is Domoticz updating anything (except switches) faster than 5 min? I dont think so...

                                      S Offline
                                      S Offline
                                      smilvert
                                      wrote on last edited by
                                      #124

                                      @gohan I think it is a little tricky to update domoticz every minute but try update the sql-file, see the domoticz forum
                                      https://www.domoticz.com/forum/viewtopic.php?t=10183

                                      1 Reply Last reply
                                      0
                                      • gohanG Offline
                                        gohanG Offline
                                        gohan
                                        Mod
                                        wrote on last edited by
                                        #125

                                        The main issue is the fact that the sensor is not calculating the instant power correctly

                                        xydixX 1 Reply Last reply
                                        0
                                        • D Offline
                                          D Offline
                                          DaTim69
                                          wrote on last edited by
                                          #126

                                          I created this kWh sensor with the TCRT5000 IR Barrier Line Track Sensor.
                                          My powermeter is a ferarrismeter with 375 rotations per kWh.
                                          I also had the problem with spikes in the power usage. But after long...too long investigation I solved the problem.
                                          At my config it was a double issue.

                                          Issue 1.
                                          The problem is the pulse width of the rotation.
                                          The pulse are at night ( low power) much wider that during the day when more power is consumed. At night the spikes in power usage where huge.

                                          Issue 2.
                                          Switching on/off the halogen light causes spikes and related to also strange power measurement.

                                          Solution:
                                          I added a second arduino mini pro as a pulse regulator between the TCRT5000 and the power meter arduino.
                                          this arduino triggers on Rising and will always give a 100ms puls. Als debounce is handled (spikes).
                                          I don't upload the sketch here, I'm a beginning programmer on arduino. It's made on " trail and error" but it functions as it supposed to do.
                                          If someone wants a copy feel free to contact mee

                                          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