- openHAB version: 2.5.2-1 (released version)
Currently I am using Insteon as my lightning system and it works correctly with OH. However when the power goes out and comes back the lights turn on even though they were off before the power outage. OH does recognice these lights that are ON what I want to do is to notify me in case I;m not home when OH is back up again and also send me the number of lights on.
I found this post where they manage to count the lights turned on, however I have used it on a rule in the following way.
rule “reboot”
when
System started
then
var luceson = {{(itemsInGroup(‘gL_LucesSwitches’) | filter:{type:‘Switch’, state:‘ON’}).length + (itemsInGroup(‘gL_LucesDimmers’) | filter:{type:‘Dimmer’, state:‘!0’}:true).length}}
sendBroadcastNotification(“¡Tú smarthome está devuelta nuevamente!”+luceson)end
However the following error appears
2020-09-24 15:47:57.609 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘notificaciones.rules’ has errors, therefore ignoring it: [68,55]: no viable alternative at input ‘|’
[68,57]: missing ‘)’ at ‘filter’
[68,63]: mismatched input ‘:’ expecting ‘}’
[68,69]: mismatched input ‘:’ expecting ‘}’
[68,78]: mismatched input ‘,’ expecting ‘}’
[68,85]: mismatched input ‘:’ expecting ‘end’
My groups are as follow:
Items:
Group:Switch gL_LucesSwitches
Group:Dimmer gL_LucesDimmers
If I understand correctly this is not the format in which I have to write it down to store it in a variable. How can I accomplish this?
Any other reccomendation is appreciated. Thank you!