What’s wrong with my rule? probably something simple, but i don’t see it
Door opens light goes on no problem there.
Now i want to send a push notification when my motion sensor is NOT on
If i remove the If statment its working, sending the notification always when i come in and leave
But i want to add a condition if movement ditected don’t send
The sensor i use is the FGMS-001 from fibaro
This is my code so fare:
rule "HalLichtAanDeurOpen"
when
Item E0Dvoordeur_DoorStatus changed from CLOSED to OPEN
then
{
E0LHAL_Switch.sendCommand(ON)
If E0MHAL_BinarySensor = CLOSED
sendBroadcastNotification("Voordeur open")
}
rule "HalLichtAanDeurOpen"
when
Item E0Dvoordeur_DoorStatus changed from CLOSED to OPEN
then
{
E0LHAL_Switch.sendCommand(ON)
If (E0MHAL_BinarySensor == CLOSED){
sendBroadcastNotification("Voordeur open")
}
}
end
Thanks for your quick response
I tried your code with = and == but it’s not working
I used CLOSED and OFF
This is my last version
rule "HalLichtAanDeurOpen"
when
Item E0Dvoordeur_DoorStatus changed from CLOSED to OPEN
then
E0LHAL_Switch.sendCommand(ON)
If (E0MHAL_BinarySensor.state == OFF){
sendBroadcastNotification("Voordeur open")
}
end
If I remove the if statment the send command is executed.
So it must be something within the if statment i gues
Are rules case sensitive? and what are the rules about cases?
This is the final code:
rule "HalLichtAanDeurOpen"
when
Item E0Dvoordeur_DoorStatus changed from CLOSED to OPEN
then
E0LHAL_Switch.sendCommand(ON)
if (E0MHAL_BinarySensor.state == OFF){
sendBroadcastNotification("Voordeur open")
}
end