Tip: Using "virtual" relays as control/memory/status indicators

44 views
Skip to first unread message

cybe...@gmail.com

unread,
Apr 28, 2022, 1:01:20 PM4/28/22
to TasmotaUsers
Possibly this is old news to some of you, but I had to build time and movement sensor based porchlight logic, and I had the idea to use "virtual relays" to make the local logic easier, as well as more transparent to my HomeAssistant server.

Basically, I used two unconnected GPIO pins to create extra relay outputs, and redirected the input to one of those virtual outputs.

See attached image 1 (Tasmota) and image 2 (home assistant)

PorchLight 1.PNG

PorchLight 2.PNG

- Now, I can see the state of the sunlight-based timer window
- I can see of the movement detector is active
- The needed *local* logic can be simpler (ok, this is a little subjective)
- All 3 status, including the Radar movement detector, is auto-pupulated into HomeAssistant for optional additional logic there.

- I can very simply manually override all 3 buttons. For example, turn off the timer window, and turn on the light, so the radar will not trigger the turn/on turn/off while I am working in and out of the garden area.

As mentioned, I feel local logic is simpler. And I am a big fan of local logic. 
Nodered is nice, for broader more complex and inter-device logic, but intra-device, a device should be self-providing.
(image 3)

PorchLight 3.PNG
Full config notes, including the rules above but annotated,  attached for anyone who wants to play with this.

PS: I tried to also make the 60 second delay a control, by using a virtual PWM pin, but that does not show the numeric value in the GUI. Only the Off vs On (zero vs non zero) state.
PorchLight 4.txt

cybe...@gmail.com

unread,
May 4, 2022, 3:55:26 PM5/4/22
to TasmotaUsers
A small improvement, now the DELAY-OFF time is also settable with the GUI.
Pretty nice, even if I say so myself.

The only small issue is, you have to refresh the webpage to see the new value after you slide it.

Capture.PNG

Capture2.PNG

Full annotated notes in the attachment.


Simon Porchlight 3.txt

Craig Curtin

unread,
May 11, 2022, 5:40:31 PM5/11/22
to TasmotaUsers
Very nice and thanks for sharing - gives me some ideas with some multi relay boards i have 

Craig

Reply all
Reply to author
Forward
0 new messages