Direct pulse counting

I have been already using emoncms for monitoring electricity and PV energy for one year. Today I tried to connect pulse output from heat pump energy meter, but after couple of hours I am not successful. Pulse output is wired directly to RPi: S0+ wire to GPIO4 (pin7) and S0- wire to GND.
Emoncms config:

    Type = EmonHubPulseCounterInterfacer
        pulse_pin = 7
        # bouncetime = 2
        # rate_limit = 2
        pubchannels = ToEmonCMS,

        nodename = TC_pulse
        prefix = tc_
        nodeoffset = 3

    nodename = TC_pulse
       names = pulsy
       datacodes = h
       scales =1
       units = Wh

This input is not listed in Inputs:

What am I doing wrong?
Thanks for answers.

[Edited for presentation (Moderator (RW)]

For future reference, when posting code or output, please put 3 ‘backticks’ (normally found at the top left of the keyboard) on a line of their own before the code, and 3 more backticks also on a line of their own after the code:


If it is something like php you can add a language identifier after the first 3 backticks: ```php or even ```text if you don’t want any language markup applied.

Welcome, Josef, to the OEM forum.

I am not an emonCMS expert, and I have never attempted to use the Pulse Counter Interfacer, so I was hoping someone who knows more would answer. But I think your problem is here:

This defines the pulse input as coming from Node ID = 3 (the ‘natural’ Node ID = 0, nodeoffset is added to this), but emonHub is expecting the pulses to come from Node ID = 29:

I think you need nodeoffset = 29.

Many thanks for answer but change to nodeoffset = 29 did not help.

@TrystanLea Can you answer this please?

What do you see in the emonhub log?

IIRC, I think it is the physical pin number - I should make that clear in the instructions if it is.

Secondly, the logging should be at 5s as that is the default period it accumulates pulses before sending them.

No decoder is required. It just sends the number of pulses and you can decode that in the input processing. I also think there must not be a decoder (so emonhub just sends it on).

Long time since I did this, but I don’t think it needs a decoder. Just sends the number of pulses directly on.

I need to dig out my old system and check!

I hate it when you go back and it doesn’t make sense. The Python has an interval of 3s by default, but if emoncms is logging at 5s, it is going to miss pulses.

Ah, got access and yes, I set the rate_limit as 5 to match the logging in my working system.

I’ll update the docs!


    Type = EmonHubPulseCounterInterfacer
        pulse_pin = 15
        bouncetime = 5
        # bouncetime = 1
        # Rate_limit is the rate at which the interfacer will pass data
        # to emonhub for sending on. Too short and pulses will be missed.
        # rate_limit is minimum number of seconds between data output.
        # pulses are accumulated in this period.
        # rate_limit default to 2.
        rate_limit = 5
        pubchannels = ToEmonCMS,

        nodeoffset = 3

This setup works when physically connected to pin 15.

Note - the rate_limit must be the same as the logging interval in emoncms.

I need to update the docs to make this clear :frowning:

The figure returned is an increasing pulse count.

1 Like

And how does this appear on the Inputs page of emonCMS?

I’ll hold my hand up for :poop: documentation!

The interfacer sends an increasing pulse count, plus an increment.

Depending on the MQTT setting, something like this;

Publishing: emon/3 {"Pulse": 279, "Pulse Inc": 1, "time": 1691442654.2491546}


So then use the Wh accumulator (assuming a pulse is 1xWh).

I had a look at my system and it didn’t make sense at first glance!

So the rate of logging doesn’t matter unless you want to use the increment to give a pseudo current consumption rate.

1 Like

There is not any record according a pulse count.

Btw. I can see in log only records from time 1.39 to 1:46 every day.
/var/log is used to 100% (0 bytes free).

Ah, that is an issue - I’ll split this to a different topic.

Go into the emonhub page,


Edit config (RHS) and set log level to DEBUG


Then you should see some logging (once we have sorted `var/log’ out.