Best way to link Relay and Buttons

Moderator: leecollings

Post Reply
Totter
Posts: 4
Joined: Saturday 21 November 2015 4:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: San Francico, U.S.
Contact:

Best way to link Relay and Buttons

Post by Totter »

Hello

I have a working relay node and a working buttons with lights node.

The goal is to have the buttons control the relays turning on/off and if the relays were turned off through domoticz the button leds would update showing that the relays are off.

Currently I have set up the buttons as lights in mysensors and the relays as lights . Then in Blocky I did a long if then else setup to get the corresponding light or relay to toggle depending on the situation. It has some issues in that at some point things start to randomly cycle on and off. I think as blocky toggled the switch it would retrigger itself in a loop and the lights and the relays would toggle on and off endlessly. I am new to blocky seems like it needs a break statement.

However even if I could use a break statement I was wondering if there is some way, more elegant, to simply make the state of one device match the state of another, without using a long blocky "if then else".

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest