Switch value not updating when operated from Domoticz

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
danielchagasrs
Normal user
Posts: 20
Joined: 09 Jan 2017, 20:20
Location: Porto Alegre / Brazil

Re: Switch value not updating when operated from Domoticz

#11 Post by danielchagasrs » 09 Jan 2017, 20:37

I spent hours trying, but no matter what I change, I'm always stuck with the problem of having to press the button twice, when triggerd by domoticz.
Here is my setup at this time:

<< DOMOTICZ: >>
kitchen dummy switch, IDX 76
actions:
On: http://192.168.25.156/control?cmd=event,kitchenon
Off: http://192.168.25.156/control?cmd=event,kitchenoff
======================================
======================================
ESP devices:

Name: kitchen_light:
Type: input switch (normal switch, inversed),
IDX: 76
GPIO: 14
Send data = on
Value name: Switch
---------------------
Name: kitchen_btn:
Type: Push button type input switch (push btn, active low).
IDX: 76
GPIO: 3
Send data = on
Value name: Switch
-----------------------
<< RULES: >>
on kitchen_btn#Switch do
if [kitchen_btn#Switch]=1
event kitchenon
else
event kitchenoff
endif
endon

on kitchenon do
gpio,14,0
inputswitchstate,3,1
endon

on kitchenoff do
gpio,14,1
inputswitchstate,3,0
endon

===========================
What am I doing wrong?
I tried taskvalueset... it changes the value under devices tab, but still need to press twice to take the action.
inputswitchstate doesnt do anything.

danielchagasrs
Normal user
Posts: 20
Joined: 09 Jan 2017, 20:20
Location: Porto Alegre / Brazil

Re: Switch value not updating when operated from Domoticz

#12 Post by danielchagasrs » 09 Jan 2017, 21:19

I just had an idea, and it worked for me... maybe it's not the best solution, but it's simple and works fine.

========================
on kitchen_btn#Switch do
if [kitchen_light#Switch]=0
gpio,14,0
else
gpio,14,1
endif
endon
========================

It's a very basic toggle event...

Before this, I tried this one:
">>>>>>>>>>>>>
on kitchen_btn#Switch do
SendToHTTP domoticz_ip,8080,/json.htm?type=command&param=switchlight&idx=174&switchcmd=Toggle
endon
"<<<<<<<<<<<<<
but the "&param=" gets replaced by a weird symbol and the toggle doesn't work...

vojtishek
Normal user
Posts: 70
Joined: 12 Jan 2017, 08:00

Re: Switch value not updating when operated from Domoticz

#13 Post by vojtishek » 03 Feb 2017, 13:27

Hi all,

regarding momentary push button, It can be wired to the Sonoff to turn it off/on or pair a remote control to it.
You just need to solder it on contacts on current momentary button.
But be aware, it will not allow you to use classic wall switch, you need something like a "doorbell switch".

Whole job described here

http://support.iteadstudio.com/support/ ... /page/last

Post Reply

Who is online

Users browsing this forum: No registered users and 59 guests