As we are all playing with the great ESPeasy software I am struggling with the rules. I am not a programmer and as there is hardly any documentation available I bumped into a dead stop. Would someone be able to help me out?
In my believe in a domotica system all parts should work as much autonomous as possible. The 'server' should be there for remote control, push settings and logging but the individual parts should work on their own. This means you depend a lot on the local rules in your projects.
I have created a ledstrip dimmer with a PIR and a IR receiver. The idea is when you pass the light it pops on for 30 seconds and turns off again. If you want the light on you can either grab Domoticz or the IR remote control and control the intensity and it should be on till you switch it off. If you remove Domoticz out of the equation the IR remote should still work. Even when you remove the network it should still work with the remote and if switched off it should still work on the PIR.
My setup:
- ESP-01 loaded with ESPeasy 147_RC8 and serial communication disabled to gain 2 extra GPIO’s.
On GPIO 0 IR receiver
On GPIO 1
On GPIO 2 Dimmer
On GPIO 3 PIR
These are the rules I have put in:
Code: Select all
on pir#Switch=1.00 do
pwm,2,127,1000
timerSet 1,30
endon
on Rules#Timer=1 do
pwm,2,0,1000
endon
At this moment, I can control it with Domoticz but as soon as you pass it it will dim to the set level and goes off after 30 seconds. This is because the local rules overrule the Domoticz setting. I know why this is but don’t know how to solve it…
So I experimented with if statements and let the dimmer in Domoticz send an 'on action' 'http://192.168.xx.xx/control?cmd=event,dimon,1' when you switch it on in Domoticz and 'off action' 'http://192.168.12.37/control?cmd=event,dimon,0' when you switch if off. Just to have Domoticz report to the ESP it will overrule the PIR action and keep it on even when passing. But no luck.
I also would like to use the IR remote control to control the brightness and keep it to that level, report that level to Domoticz (so it knows how bright it’s set) and when switched off (reported to Domoticz) it goes back to the PIR operation. When you switch it on it goes back to the same level it was switched off to (report that to Domoticz again). This needs to be done through the rules of ESPeasy so it’s independent of Domoticz or network.
Why the focus on independency? I guess we all been there. The misses calling you in a panic "your things" do not work. So, you have to troubleshoot remotely and after 35 micro seconds the misses is irritated. In the end it’s the network having a hick-up or she unplugged the Domoticz raspberry pi. To avoid this as much as possible and have a stable and steady system I prefer to have all items as autonomously as possible. The bigger the independency the larger your success rate will be and the bigger investment you can make to automate your house. I do realize I am taking the difficult route here with all my wishes but I think a lot of projects get removed after a few weeks because of this. At least it does for me. After all, you are not the only one in the house.
Is anyone able to help me out on this one? All help is appreciated.
MH