Page 1 of 1

how to mount counterinput to dual inputs

Posted: 06 Oct 2021, 21:41
by BartSr
Hi
config : Build 20111 - Mega
I have a counter input (controlled from external pulses of kWH meter) connected to GPIO 2. On turn this is connected to Domoticz IDX 703 for processing as kWh measuring. Works OK !
Now I like to use same counterinput to control Domoticz in way it shows actual powerconsumption.

My Q: can someone help me about how to make the rule for this. (In short how to activate two inputs using one external signal.

TIA
-Bart

Re: how to mount counterinput to dual inputs

Posted: 06 Oct 2021, 21:58
by Ath
You can add a Dummy Device and decide how many values it should have (single..quad, single should be fine in t his case).
You can set the value of that device from the rules (you have enabled them in Tools/Advanced, I expect?), using the TaskValueSet,dummy,value1,<some calculation using [pulsecounter#count]> command. Connection to Domoticz is using the exact same way as your pulse counter, except it will need a new device ID you create in Domoticz.

If you want to relate the pulse count to time, you can use the Clock#Time event (on Clock#Time do...endon) or set up a LoopTimerSet,<timer>,<interval_seconds> or LoopTimerSet_ms,<timer>,<interval_milliseconds> command.
Be sure to read up on the Rules part of the documentation: https://espeasy.readthedocs.io/en/lates ... Rules.html

Re: how to mount counterinput to dual inputs

Posted: 22 Oct 2021, 19:20
by BartSr
Hi Ath,

Thanks for your help.
I found another way; just tie both inputs (physical) together. Now both GPIO's can handle their own task.

KR
-Bart