Page 1 of 1

Relay board and 2 way switching problems...

Posted: Tuesday 30 October 2018 12:32
by Nickharding
Hi guys.

At home I have a network of raspberry Pi 3’s running. Numerous as slaves and one as a master which my Siri connects to using homebridge and this works great.

On my slave in the loft I have a large relay board to which I have rewired all my lighting to be 2 way, going to the relay board.

The problem I’m having is I can turn the lights on and off using domotics, and same at the manual switch.

The issue is when I turn the manual switch on, domoticz obviously does not get updated and thinks the lights state is off.

This plays hell as to turn the light off via voice I have to tell Siri to turn it on? Hard to explain.

What is my way around this? I was thinking a light sensor in each room? But then it will be misunderstood when the sun is shining.

Also thought about maybe a voltage detector on each line so it knows when it’s live or not?

Let me know your ideas or if anyone else has come up with a solution.

Many thanks,

Nick.

Re: Relay board and 2 way switching problems...

Posted: Tuesday 30 October 2018 18:54
by SweetPants
In my personal opinion best way is to sense the output voltage via an optocoupler and read the state using an Arduino or ESP and feed domoticz with the results (without triggering On/Off actions). I use this method to sense a local switched relay (using standard wall switch) and update domoticz with this state. viewtopic.php?f=51&t=23796

Re: Relay board and 2 way switching problems...

Posted: Wednesday 31 October 2018 1:42
by Nickharding
SweetPants wrote: Tuesday 30 October 2018 18:54 In my personal opinion best way is to sense the output voltage via an optocoupler and read the state using an Arduino or ESP and feed domoticz with the results (without triggering On/Off actions). I use this method to sense a local switched relay (using standard wall switch) and update domoticz with this state. viewtopic.php?f=51&t=23796
Thanks for your reply, would i need one of these for each light that its running? currently it is configured like this...
WhatsApp Image 2018-10-30 at 20.15.43.jpeg
WhatsApp Image 2018-10-30 at 20.15.43.jpeg (197.92 KiB) Viewed 607 times
WhatsApp Image 2018-10-30 at 20.15.42.jpeg
WhatsApp Image 2018-10-30 at 20.15.42.jpeg (236.53 KiB) Viewed 607 times
WhatsApp Image 2018-10-30 at 20.15.41.jpeg
WhatsApp Image 2018-10-30 at 20.15.41.jpeg (218.41 KiB) Viewed 607 times
There will be another 4 lights being connected at the end of this week, just hard to find the time with my job haha.

Could you show me some pics of your setup? so i can get more of an idea?

Thanks for your help.

Re: Relay board and 2 way switching problems...

Posted: Wednesday 31 October 2018 8:34
by SweetPants
You need something like this (the circled part) to detect the mains.
My_Switch.png
This schematic is with an ESP8266