rossko57
(Rossko57)
May 6, 2019, 2:18pm
2
Sc00by:
if (GMotor.state == ON) {
timer = createTimer(now.plusSeconds(3), [ |
val mqttActions=getActions(“mqtt”,“mqtt:broker:MQTTBroker”)
mqttActions.publishMQTT(“siren”,“1”)
else
That’s all a bit jumbled. Using { } with if/else is a good idea. You need to finish creating your timer block ] before continuing with an if/else from outside of the timer block.
Relevant discussion
In my installation when I receive signal from flood sensor I will activate blinging led.
Because I have many sensors I have several similar sections:
rule "FloodAlarm_BathroomLower_Activated"
when
Item FloodSensorLazienkaDolna changed from OFF to ON or
Item FloodSensorLazienkaDolna changed from NULL to ON
then
<activate blinking led>
floodAlarmIsActivated = true
...
end
// FloodAlarm activation BathroomUpper (edge activated)
rule "FloodAlarm_BathroomUpper_Activated…