Hello everybody!
I've been into espeasy for some time, mainly for monitoring my heating, room temperature and humidity.
Now I'd like to use some Sonoff Basic modules to switch my lights with domoticz.
All my lights are switched via impulse relays, and I'd like to change the installation as litte as possible, also all the lights should still be switchable 'by hand' (wife acceptance factor
So I've come up with the solution that if the light is switched on via a latching relay it also switches on a coupling relay that connects the GPIO 14 of the sonoff to ground so I always get a feedback to domoticz if the light is switched on or off.
Now I tried to define a rule to set a switch to "1" if GPIO14 is connected to ground and to set if to "0" if its not connected to ground, but I can't get it to work. All I get is a toggle switch reaction wich takes two "on and offs" of the light switch until the state changes to 1
So far I've come up with this script for the rules section:
on Button#value do
if [GPIO14#value] = 0
Button#value = 0
else
Button#value = 1
endif
endon
but it doesn't do what I want it to do.
I'd be very happy if someone could point me in the right direction!
regards, max
Espeasy with momentary switches / impulse (latching) relay
Moderators: grovkillen, Stuntteam, TD-er
-
- New user
- Posts: 2
- Joined: 31 Mar 2018, 15:39
Re: Espeasy with momentary switches / impulse (latching) relay
Button#value = 1 ???
I think, this is not possible.
Use TaskValueSet
And your rules are strange.
event Button#value is called, when new value is assigned to Button#value
and in this event you assign new value into it ...... circle
Why not using gpio14 for testing and sending to Domoticz directly?
I think, this is not possible.
Use TaskValueSet
And your rules are strange.
event Button#value is called, when new value is assigned to Button#value
and in this event you assign new value into it ...... circle
Why not using gpio14 for testing and sending to Domoticz directly?
Re: Espeasy with momentary switches / impulse (latching) relay
These have been set in Devices ?
Button#value <- what is it ? What GPIO is it using ?
GPIO14 has been defined in Devices ? (What is it's name there ?)
Button#value <- what is it ? What GPIO is it using ?
GPIO14 has been defined in Devices ? (What is it's name there ?)
Re: Espeasy with momentary switches / impulse (latching) relay
Hi,
i have a bhonofre module with espeasy, with this configuration:
rules:
On interruptor#Switch do
if [interruptor#Switch]=1
GPIO,4,1
else
GPIO,4,0
endif
endon
i have a bhonofre module with espeasy, with this configuration:
rules:
On interruptor#Switch do
if [interruptor#Switch]=1
GPIO,4,1
else
GPIO,4,0
endif
endon
- Attachments
-
- device_2.png (39.71 KiB) Viewed 5351 times
-
- device_1.png (39.71 KiB) Viewed 5351 times
-
- device_1.png (39.71 KiB) Viewed 5351 times
Re: Espeasy with momentary switches / impulse (latching) relay
Code: Select all
on Button#value do
if [Button#value] = 0
publish domoticz/in,{"idx":26,"nvalue":0,"svalue":"0"}
else
publish domoticz/in,{"idx":26,"nvalue":0,"svalue":"1"}
endif
endon
add GPIOx, 0 or GPIOx,1 to make something happen in module
Who is online
Users browsing this forum: Ahrefs [Bot] and 14 guests