need help configuring switch

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
wonk
Normal user
Posts: 20
Joined: 29 Nov 2020, 21:31

need help configuring switch

#1 Post by wonk » 03 Mar 2021, 17:47

Hi,
I connected a switch TCRT5000 to a NodeMCU with ESPEasy. The optical digtal sensor is looking to a ferraris counter with a turning wheel. Its normaly HIGH and a count is a LOW impulse for some tenth second. As I do not have a special plugin for this switch, I took the normal switch input plugin here: https://espeasy.readthedocs.io/en/lates ... witch-page. I only changed the GPIO data to D6, where my wire is connected. But it does not work. The green value on the devices tap does not change, althouph I see at the device LED, that the status is changing. What data on the device page do I have to alter?
Gruss, wonk

ingoiot
Normal user
Posts: 83
Joined: 15 Aug 2019, 22:09

Re: need help configuring switch

#2 Post by ingoiot » 03 Mar 2021, 19:37

can you measure a voltage on the GPIO pin?
also the overview page is not always that fast.
is there something in the logs?

wonk
Normal user
Posts: 20
Joined: 29 Nov 2020, 21:31

Re: need help configuring switch

#3 Post by wonk » 04 Mar 2021, 10:23

Hi,
sorry, it is the other way: when LED on sensor is ON, the signal is LOW, when LED ist OFF for a short time, signal goes up to 2.5V.
Some log output:

Code: Select all

66295831: SW : GPIO=12 State=1 Output value=1
66296917: SW : GPIO=12 State=0 Output value=0
66304351: WD : Uptime 1105 ConnectFailures 6490 FreeMem 19216 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
66325617: SW : GPIO=12 State=1 Output value=1
66326717: SW : GPIO=12 State=0 Output value=0
66334351: WD : Uptime 1106 ConnectFailures 6490 FreeMem 19136 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
66347718: SW : GPIO=12 State=1 Output value=1
66347817: SW : GPIO=12 State=0 Output value=0
66357317: SW : GPIO=12 State=1 Output value=1
66358518: SW : GPIO=12 State=0 Output value=0
66364351: WD : Uptime 1106 ConnectFailures 6490 FreeMem 19136 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
66392017: SW : GPIO=12 State=1 Output value=1
66393317: SW : GPIO=12 State=0 Output value=0
66394351: WD : Uptime 1107 ConnectFailures 6490 FreeMem 19136 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
What sort of timecode is the first number?
Although there is a switch of output state, I cannot see this in the green value output.
Gruss, wonk

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: need help configuring switch

#4 Post by TD-er » 04 Mar 2021, 10:26

The first number is the 'uptime' in msec.
N.B. this may wrap to 0 every 49.7 days :)

ingoiot
Normal user
Posts: 83
Joined: 15 Aug 2019, 22:09

Re: need help configuring switch

#5 Post by ingoiot » 04 Mar 2021, 13:36

maybe this is what you are looking for?

https://espeasy.readthedocs.io/en/lates ... R5000.html

wonk
Normal user
Posts: 20
Joined: 29 Nov 2020, 21:31

Re: need help configuring switch

#6 Post by wonk » 04 Mar 2021, 18:02

Hi,
thank you, that helps. It is the right plugin, it shows values. But I do not understand configuring. It seems, I can get three values: Delta, Total, Time
What is Delta, Total, Time?
What is the meaning of %value% in this case?
Why do I have to set an interval?
I only know that every 480 turns of the wheel are 1 KWh.
Gruss, wonk

ingoiot
Normal user
Posts: 83
Joined: 15 Aug 2019, 22:09

Re: need help configuring switch

#7 Post by ingoiot » 04 Mar 2021, 20:52

dont knmow how this really works,but im guessing that

setting type to total and mode to change,
activating send single event with all values,
setting the formula to %value%/480
at an intervall of 10 sec.
should give you the total amount of used kwh since last reboot. every 10 seconds.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 38 guests