Hi there,
I am trying o integrate a light, which requires a momentary switch into domoticz.
It should be switchable at the light itself via a pushbutton and controllable from domoticz via a json command.
The hard part is taht i need a variable which trasmits the status of the light do domoticz.
I tried to use the build in LED for that.
My rule looks like this
on Knopf#Switch=0 do
Pulse,12,1,250
if [LED#Switch]=1
gpio,13,1
else
gpio,13,0
endif
endon
on an do
Pulse,12,1,250
gpio,13,0
endon
on aus do
Pulse,12,1,250
gpio,13,1
endon
the first part should be the reaction to the switch. ist works prefectly on its own. The second part should be the reavtion to the json command, which is on or off.
If I push the button on the sonoff it pulses on the relay three times and I don't know why.
Is it possible to refer to an event from inside the rule? kindoff like if button presses and led off -> event an
or can i just trigger the Knopf#switch via json
or the easiest way. can in switch 2 gpios in one json command.
Pulse switch via json and via button press Sonoff esp
Moderators: grovkillen, Stuntteam, TD-er
Re: Pulse switch via json and via button press Sonoff esp
Just call an event from domoticz . Instead of "gpio,13,0" as command take "event,aus". It will trigger the event aus.same works within rules
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: Pulse switch via json and via button press Sonoff esp
my problem is, taht i cannot call events that are not on top of the rules. for example
on Knopf#Switch=0 do
Pulse,12,1,250
if [LED#Switch]=1
gpio,13,1
else
gpio,13,0
endif
endon
on schalter do
Pulse,12,1,250
if [LED#Switch]=1
gpio,13,1
else
gpio,13,0
endif
so i need it to do the exact same action wether the button is pressed or it receives a switch command from json.
But if I trigger
http://192.168.0.65/control?cmd=event,schalter
it just responds ok and nothing happens. The pushbutton works as it should.
How can i change the rule so that this will work.
on Knopf#Switch=0 do
Pulse,12,1,250
if [LED#Switch]=1
gpio,13,1
else
gpio,13,0
endif
endon
on schalter do
Pulse,12,1,250
if [LED#Switch]=1
gpio,13,1
else
gpio,13,0
endif
so i need it to do the exact same action wether the button is pressed or it receives a switch command from json.
But if I trigger
http://192.168.0.65/control?cmd=event,schalter
it just responds ok and nothing happens. The pushbutton works as it should.
How can i change the rule so that this will work.
Who is online
Users browsing this forum: No registered users and 25 guests