threeway switch traveler system

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Sprokkie
Normal user
Posts: 16
Joined: 14 Jan 2018, 21:39

threeway switch traveler system

#1 Post by Sprokkie » 22 Dec 2018, 23:17

Hi,

i want to control light in a room with domoticz an the threeway switch.
The wall switch is a threeway switch so i can buils a travelar system
Walswitch and relay witch changeover contacts together is should work as a traveler system

Now i encounter the problem that the actual state of the light is not corrensponding wth the lightswitch icon in domotiqz.
So i added a 230v -> 3V optocoupler system and read the acutal state of te light in to domotiqz.
Send the actual state with the IDX number of the domotiqz virtual switch.
When i test on a breadboard the domitiqz icon switches acrodingly to the state.
If i turn on the lghts wiht the wall switch the relay is switched back by domotiqz :(
Experimented with togle in rules, toggle works now something to prevent execute the toggle from domotiqz when the threeway switched is used.

Any idea how to solve this ?

i used the words threeway switch and travaler system from wikipedia: https://en.wikipedia.org/wiki/Multiway_switching

kimot
Normal user
Posts: 161
Joined: 12 Oct 2017, 20:46

Re: threeway switch traveler system

#2 Post by kimot » 23 Dec 2018, 22:30

In real world circuit looks like this:
https://www.mylms.cz/obrazky/elektronik ... lace-5.png

So put ESPeasy in to first switch box - connect mains and lamp through relay and all switches change to push buttons and connect them parallel to one gpio.
Then each button press change relay status and report it to Domoticz, or Domoticz event change status of relay.

Some rules inspiration for Sonoff Basic ( relay=gpio12, LED=gpio13 )

Code: Select all

 
on lamp_on do
    gpio,12,1
    gpio,13,0
endon

on lamp_off do
    gpio,12,0
    gpio,13,1
endon

on lamp_change do
  if [rele#Switch]=1
    event,lamp_off
    SendToHTTP 192.168.1.253,8080,/json.htm?type=command&param=switchlight&idx=19&switchcmd=Off
  else
    event,lamp_on
    SendToHTTP 192.168.1.253,8080,/json.htm?type=command&param=switchlight&idx=19&switchcmd=On
  endif
endon

on SW01#Switch do
  event,lamp_change
endon

Sprokkie
Normal user
Posts: 16
Joined: 14 Jan 2018, 21:39

Re: threeway switch traveler system

#3 Post by Sprokkie » 26 Dec 2018, 15:39

thx for your reply,

Changing to pusbutton is not that easy, i have a wall switch that controls two separate lights it is a double three way switch.
it can only be a changover switch.
i wanted to use the relay as the second threeway swithc like you suggested.

i just need a way to update the icon in domotiqz without sending the command back to the esp module
the command can only be send when i clikc on the icon.

kimot
Normal user
Posts: 161
Joined: 12 Oct 2017, 20:46

Re: threeway switch traveler system

#4 Post by kimot » 26 Dec 2018, 22:57

I think it is not possible.
Instead of use rules that way, that sending command back from Domoticz is not problem.
First - do not fill IDX number for your switch device and send status to Domoticz only via rules and JSON.

In my rules example above event "lamp_change" switches relay and reports status to Domoticz.
Domoticz receives this new status, changes its icon and sends event "lamp_off" or "lamp_on" back to ESPeasy, but this events only sets relay to the same state like event
"lamp_change".

When you click on icon in Domoticz, Domoticz changes icon end sends event to ESP, which switches relay to correct state.

Or use dummy variable and timer.
When sending status from ESP to Domoticz, set variable to 1 and start timer for 3 or 5 sec.
Timer event will set variable back to 0.
When ESP receives event from Domoticz, by rules check status this dummy variable.
If 1 - do nothing ( it is Domoticz response for our status reporting ).
If 0 - switch relay, because somebody click icon on dashboard.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests