help to create a rule for a toggle switch

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
reza
Normal user
Posts: 88
Joined: 13 Jun 2017, 21:14

help to create a rule for a toggle switch

#1 Post by reza » 14 Jun 2017, 16:58

hi friends.
please help me.
i want use a toggle switch (up-down) with relay. i use usual rules or usual setting but there is some problem.
i need 2 feature for relay control with espeasy. but i can not do it with rule , please help.
first , i want key work with relay locally , until when wifi is disconnect(for each reason) so we can on/off light handy.
second , i dont want relay on / off just with "key = 0" or "key = 1" . i want relay work with change state of toggle key.for example when light on with key (key up) then light off with domoticz app, so i want i can light on again with key but just one change state of toggle key (key down) .now if we light on/off with key and light off/on with app, so if we want again turn on with key , we must change 2 state (one up and one down) and this is bad. so i need help for a rule that we run this 2 feature in one rule .
thank you

reza
Normal user
Posts: 88
Joined: 13 Jun 2017, 21:14

Re: help to create a rule for a toggle switch

#2 Post by reza » 15 Jun 2017, 07:38

there is not any body to help me ? :(

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: help to create a rule for a toggle switch

#3 Post by ManS-H » 15 Jun 2017, 08:09

In Domoticz:
http://192.168.0.120/control?cmd=event,toggle

In EspEasy:
On toggle do
if [Schemerlamp-1#Switch]=0
gpio,0,1 // Lamp on
else
gpio,0,0 // Lamp off
endif
EndOn

See this as an example, see of this works for your situation. And yes, this is working for me. Even with this switch. https://m.nl.aliexpress.com/s/item/3273 ... f7141f8e23

reza
Normal user
Posts: 88
Joined: 13 Jun 2017, 21:14

Re: help to create a rule for a toggle switch

#4 Post by reza » 15 Jun 2017, 09:28

ManS-H wrote: 15 Jun 2017, 08:09 In Domoticz:
http://192.168.0.120/control?cmd=event,toggle

In EspEasy:
On toggle do
if [Schemerlamp-1#Switch]=0
gpio,0,1 // Lamp on
else
gpio,0,0 // Lamp off
endif
EndOn

See this as an example, see of this works for your situation. And yes, this is working for me. Even with this switch. https://m.nl.aliexpress.com/s/item/3273 ... f7141f8e23
thank you for answer . but i think this is not true and dont have that features. frist this command(http://192.168.0.120/control?cmd=event,toggle ) use for on action or off action or both in domoticz ? also i think when on/off with key so there is a Inconsonance between key and dummy device in domoticz. because key dont send any report of turn on/off to domoticz.

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: help to create a rule for a toggle switch

#5 Post by ManS-H » 15 Jun 2017, 10:27

reza wrote: 15 Jun 2017, 09:28
ManS-H wrote: 15 Jun 2017, 08:09 In Domoticz:
http://192.168.0.120/control?cmd=event,toggle

In EspEasy:
On toggle do
if [Schemerlamp-1#Switch]=0
gpio,0,1 // Lamp on
else
gpio,0,0 // Lamp off
endif
EndOn

See this as an example, see of this works for your situation. And yes, this is working for me. Even with this switch. https://m.nl.aliexpress.com/s/item/3273 ... f7141f8e23
thank you for answer . but i think this is not true and dont have that features. frist this command(http://192.168.0.120/control?cmd=event,toggle ) use for on action or off action or both in domoticz ? also i think when on/off with key so there is a Inconsonance between key and dummy device in domoticz. because key dont send any report of turn on/off to domoticz.
Yeah, then must do you it with yourself. For me works it for 3 lamp fully automatic with domoticz en i can do it by hand with the Vhome remote switch.
Before you ask more, read this: https://www.letscontrolit.com/forum/vie ... php?t=2039

reza
Normal user
Posts: 88
Joined: 13 Jun 2017, 21:14

Re: help to create a rule for a toggle switch

#6 Post by reza » 15 Jun 2017, 13:06

ManS-H wrote: 15 Jun 2017, 10:27
reza wrote: 15 Jun 2017, 09:28
ManS-H wrote: 15 Jun 2017, 08:09 In Domoticz:
http://192.168.0.120/control?cmd=event,toggle

In EspEasy:
On toggle do
if [Schemerlamp-1#Switch]=0
gpio,0,1 // Lamp on
else
gpio,0,0 // Lamp off
endif
EndOn

See this as an example, see of this works for your situation. And yes, this is working for me. Even with this switch. https://m.nl.aliexpress.com/s/item/3273 ... f7141f8e23
thank you for answer . but i think this is not true and dont have that features. frist this command(http://192.168.0.120/control?cmd=event,toggle ) use for on action or off action or both in domoticz ? also i think when on/off with key so there is a Inconsonance between key and dummy device in domoticz. because key dont send any report of turn on/off to domoticz.
Yeah, then must do you it with yourself. For me works it for 3 lamp fully automatic with domoticz en i can do it by hand with the Vhome remote switch.
Before you ask more, read this: https://www.letscontrolit.com/forum/vie ... php?t=2039
thank you i will read this .

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests