Espeasy with momentary switches / impulse (latching) relay

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
baustromverteiler
New user
Posts: 2
Joined: 31 Mar 2018, 15:39

Espeasy with momentary switches / impulse (latching) relay

#1 Post by baustromverteiler » 31 Mar 2018, 15:58

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

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

Re: Espeasy with momentary switches / impulse (latching) relay

#2 Post by kimot » 31 Mar 2018, 19:16

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?

Oxyandy
Normal user
Posts: 95
Joined: 09 Mar 2018, 08:45

Re: Espeasy with momentary switches / impulse (latching) relay

#3 Post by Oxyandy » 01 Apr 2018, 00:13

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 ?)

maluko
Normal user
Posts: 112
Joined: 02 Sep 2015, 00:49

Re: Espeasy with momentary switches / impulse (latching) relay

#4 Post by maluko » 01 Apr 2018, 00:25

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
Attachments
device_2.png
device_2.png (39.71 KiB) Viewed 5367 times
device_1.png
device_1.png (39.71 KiB) Viewed 5367 times
device_1.png
device_1.png (39.71 KiB) Viewed 5367 times

Oxyandy
Normal user
Posts: 95
Joined: 09 Mar 2018, 08:45

Re: Espeasy with momentary switches / impulse (latching) relay

#5 Post by Oxyandy » 01 Apr 2018, 01:34

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
Will not make ESP module do anything, but will report, idx matching what you need in dashboard
add GPIOx, 0 or GPIOx,1 to make something happen in module

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests