Hi Domosapiens
That's the first I've seen those docs, I've been going by the Wiki all this time, thanks for that.
I should have mentioned I do have a start with this already but I'm not sure it can be adapted to work like this.
I'm by no means a programmer but I have been able to study the rules and with the help of others come up with a solution.
So my current setup is one ESP and One Relay. I have the ESP configured to be manually operated by the momentary pushbutton but I also have it configured to be operated with Openhab.
In ESP Easy I have 2 devices set up they are both Switch input devices configured as normal switches.
The switch with the relay attached to it is configured to send it's state to Openhab MQTT so I can tell if the light is on or off from the Server.
The other device on the ESP is the pushbutton called SwitchIn. When pressed I have a rule that does this.
Code: Select all
On SwitchIn#Switch=0 do //When The "Button/SwitchIn" is pressed attached to GPIO15 and 3.3v
if [Relay1#State]=1 //If the GPIO 12 Relay1 is high/on=1
GPIO,12,0 //Set GPIO12 to off=0
else
GPIO,12,1 //Otherwise set GPIO12 to on=1
endif
endon
This makes sure if I press the physical button to turn the light on and I leave the room and then look at my phone and notice the light was left on via the software OpenHAB can shut it off with the appropriate command.
I attempted to just create another Rule Set that was adapted double click and the other relay and that worked a little.
Code: Select all
On SwitchIn#Switch=3 do //When The Button/SwitchIn is pressed attached to GPIO15 and 3.3v
if [Relay2#State]=1 //If the GPIO 13 Relay2/SSR is high/on=1
GPIO,13,0 //Set GPIO13 to off=0
else
GPIO,13,1 //Other wise set GPIO13 to on=1
endif
endon
But with it setup like that it was messing with Relay 1 every time I pushed the button.
Hopefully this clears things up.
Any advice on modifying this setup? Will something like this work?
Code: Select all
On SwitchIn#Switch=0, or 3 do
if [Relay1, or Relay2#State]=1
GPIO,12,0
else
GPIO,12,1
else
GPIO,13,0
else
GPIO,13,1
endif
endon
Again I'm not good with creating rules.
Thanks again.