how to mount counterinput to dual inputs

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
BartSr
Normal user
Posts: 115
Joined: 27 Sep 2019, 17:45

how to mount counterinput to dual inputs

#1 Post by BartSr » 06 Oct 2021, 21:41

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

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: how to mount counterinput to dual inputs

#2 Post by Ath » 06 Oct 2021, 21:58

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
/Ton (PayPal.me)

BartSr
Normal user
Posts: 115
Joined: 27 Sep 2019, 17:45

Re: how to mount counterinput to dual inputs

#3 Post by BartSr » 22 Oct 2021, 19:20

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

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests