Pulse Counter, does not reset to zero - help
Moderators: grovkillen, Stuntteam, TD-er
Pulse Counter, does not reset to zero - help
Hi all,
I have been at this problem for months and cannot sort it.
I have two pulse-counters, one for House Power and one for Solar Power.
When either supply drops to zero, the readings always stay at the last power.
The input is via an optical sensor counting the flashing pulses.
This pulse, when the error occurs, lights the LED and it stays ON.
I require a timeout or something to return the power to zero and wait for another pulse when it start back up again.
I am rubbish at describing and hope some one can help.
I have tried writing rules for this using the Timer,1,0 etc but still cannot sort it.
Does the Pulse Counter have any time out options I can use
Regards
nick
I have been at this problem for months and cannot sort it.
I have two pulse-counters, one for House Power and one for Solar Power.
When either supply drops to zero, the readings always stay at the last power.
The input is via an optical sensor counting the flashing pulses.
This pulse, when the error occurs, lights the LED and it stays ON.
I require a timeout or something to return the power to zero and wait for another pulse when it start back up again.
I am rubbish at describing and hope some one can help.
I have tried writing rules for this using the Timer,1,0 etc but still cannot sort it.
Does the Pulse Counter have any time out options I can use
Regards
nick
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.
And a HackRF One, as a present to myself.
Re: Pulse Counter, does not reset to zero - help
We need more info to be able to help you
- what release of ESPEasy do you have installed? (Name of the .bin file please)
- configuration of your pulse counter devices
- rules?
- hardware schematics
- what release of ESPEasy do you have installed? (Name of the .bin file please)
- configuration of your pulse counter devices
- rules?
- hardware schematics
/Ton (PayPal.me)
Re: Pulse Counter, does not reset to zero - help
Sorry about that:
No hardware circuit diagram as it is a standard wiring.
The circuit works, pulse count is spot on with input pulses
No other problems other than the output kWh stays at the last power
and does not change to zero if pulse is removed, hence i asked about timeout.
ESPEasy_mega-20200913_normal_ESP8266_4M.bin
Sensor used for light/pulse detection - Photodiode (4 terminal module )
there are no rules set either
No hardware circuit diagram as it is a standard wiring.
The circuit works, pulse count is spot on with input pulses
No other problems other than the output kWh stays at the last power
and does not change to zero if pulse is removed, hence i asked about timeout.
ESPEasy_mega-20200913_normal_ESP8266_4M.bin
Sensor used for light/pulse detection - Photodiode (4 terminal module )
there are no rules set either
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.
And a HackRF One, as a present to myself.
Re: Pulse Counter, does not reset to zero - help
It is a known issue that the count values may not be persistent on a reboot, when you use formula.
Re: Pulse Counter, does not reset to zero - help
It is not on a re-boot though.
If I stop the pulse, the output does not follow, it stays the same value as the last pulses it counted.
effectively, the pulse is a continuous low/high, wherever it stopped at that time.
So, all I can think of is that a time-out after, say 30 seconds , being about 3 watts maybe, not calculated,
the output calculation would be reset to zero.
i know what I want it to do but for me to write a timeout into the plug-in would be impossible.
The plugin seems to stick in interrupt forever and not do a reset on the output,
Sorry but I cannot describe what I require / need.
If I am having this problem somebody else must be.
I monitor the output of espeasy in domoticz and the "stuck" value caused havoc in the log as it becomes a straight line at the last power.
If I stop the pulse, the output does not follow, it stays the same value as the last pulses it counted.
effectively, the pulse is a continuous low/high, wherever it stopped at that time.
So, all I can think of is that a time-out after, say 30 seconds , being about 3 watts maybe, not calculated,
the output calculation would be reset to zero.
i know what I want it to do but for me to write a timeout into the plug-in would be impossible.
The plugin seems to stick in interrupt forever and not do a reset on the output,
Sorry but I cannot describe what I require / need.
If I am having this problem somebody else must be.
I monitor the output of espeasy in domoticz and the "stuck" value caused havoc in the log as it becomes a straight line at the last power.
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.
And a HackRF One, as a present to myself.
Re: Pulse Counter, does not reset to zero - help
Below shows Domoticz and ESPEasy
Solar-Power kWh is different as I have been removing the input to see if it changes
Solar-Power kWh is different as I have been removing the input to see if it changes
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.
And a HackRF One, as a present to myself.
Re: Pulse Counter, does not reset to zero - help
There's a command to clear a pulse counter task. Syntax is as follows: resetpulsecounter,taskindex
Here is an untested rule file example that should clear either wattage counter if it hasn't changed value in 30 seconds:
BTW, I get nervous when I see names and/or values with a hyphen in them. I suggest changing all references of House-Power to House_Power and Solar-Power to Solar_Power. This avoids parser confusion (hyphen could be interpreted as negation/subtraction).
- Thomas
Here is an untested rule file example that should clear either wattage counter if it hasn't changed value in 30 seconds:
Code: Select all
On House-Power#Watts do // New watts count, prolong timeount.
timerSet,1,30
endon
On Solar-Power#Watts do // New watts count, prolong timeount.
timerSet,4,30
endon
On Rules#Timer=1 do
resetpulsecounter,1 // Clear task 1 counter
endon
On Rules#Timer=4 do
resetpulsecounter,4 // Clear task 4 counter
endon
- Thomas
Re: Pulse Counter, does not reset to zero - help
Hi Thomas,
Thanks for the reply.
I tried the above, did not change a thing.
I found that the value in the devices display is 0, but the output of the log is still the last power that was received.
I also tried putting it in a Dummy Value, as below,, this is the last one I tried, and I tried a few combinations, still the same. This is odd.
I may get it one day
Thanks for the reply.
I tried the above, did not change a thing.
I found that the value in the devices display is 0, but the output of the log is still the last power that was received.
I also tried putting it in a Dummy Value, as below,, this is the last one I tried, and I tried a few combinations, still the same. This is odd.
Code: Select all
on System#Boot do
TaskValueSet 2,1,0
endon
On House_Power#Watts do
if [House_Power#Watts] = inf // tried other values , on no pulse inf is shown, this was to test
TaskValueSet 2,1,0
ResetPulseCounter,1
SetPulseCounterTotal,0,1
endif
TaskValueSet 2,1,[House_Power#Watts]
endon
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.
And a HackRF One, as a present to myself.
Re: Pulse Counter, does not reset to zero - help
Seems like I cannot detect / act on a value of " inf " when the pulse stops.
The log shows inf but the devices displays 0, neither can be used in a formula for some reason
The log shows inf but the devices displays 0, neither can be used in a formula for some reason
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.
And a HackRF One, as a present to myself.
Re: Pulse Counter, does not reset to zero - help
The infinite ("inf") value might be due to a divide-by-zero error. Your Watts formula could be causing this.The log shows inf but the devices displays 0, neither can be used in a formula for some reason
For example, when %value% = 0 there is a divide-by-zero condition. Reference your formula:
Code: Select all
3600000.0/%value%
It is not presently allowed to compare a value to "inf" string, at least not that I am aware of. As an unproven workaround, I suggest using rules that check if the value exceeds unusually big positive or negative numbers (>99999999, <-99999999).Seems like I cannot detect / act on a value of " inf " when the pulse stops.
If the value is displayed as zero, but the value sent by the task's controller isn't zero, then try using a rule to send the value instead of allowing the plugin's controller setting do it.I found that the value in the devices display is 0, but the output of the log is still the last power that was received.
- Thomas
Re: Pulse Counter, does not reset to zero - help
Thanks Thomas, I will look into this.
i just felt a bit stupid as ESP has been about for a few years and no-one has ever complained about this.
So I thought it was just me, but I will give it a go and see what happens,
Regards
nick
i just felt a bit stupid as ESP has been about for a few years and no-one has ever complained about this.
So I thought it was just me, but I will give it a go and see what happens,
Regards
nick
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.
And a HackRF One, as a present to myself.
Who is online
Users browsing this forum: Bing [Bot] and 52 guests