EDIT. I have two problems.
- I cant get the svg icon to change… (this has become secudary now because of #2).
- I simply cant get ng-class to work for the PIR. And I fail to understand why.
I made two new objects in Inkscape.
They´re are totally identical, except one is using ng-class from a door contact, and the other is using ng-class from a proxy item of the PIR involved.
They both uses the same css id.
Problem:
Only the door contact is working.
This is my items:
Switch ZWaveNode5ZW100MultiSensor6_MotionAlarm "Multisensor6 PIR Alarm [MAP(motion.map):%s]" <cum_motion> (gMotion) {channel="zwave:device:controller:node5:alarm_motion"}
Switch ProxyMultiSensor "Multisensor6 PIR Alarm [MAP(motion.map):%s]"
And this is a small rule to have the proxy behave like the original:
rule "Proxy Multisensor6"
when
Item ZWaveNode5ZW100MultiSensor6_MotionAlarm changed
then
if(ZWaveNode5ZW100MultiSensor6_MotionAlarm.state == OFF)
ProxyMultiSensor.sendCommand(OFF)
else
ProxyMultiSensor.sendCommand(ON)
end
This is two screendumps of the setup on Inkscape. First the door contact:
And the proxyitem of the PIR:
Normally I would say, this is due to wrong state of the proxyitem.
But this is the tail log from openhab:
2019-05-11 13:52:11.572 [ome.event.ItemCommandEvent] - Item 'ProxyMultiSensor' received command OFF
2019-05-11 13:52:11.596 [vent.ItemStateChangedEvent] - ProxyMultiSensor changed from ON to OFF
2019-05-11 13:54:30.007 [ome.event.ItemCommandEvent] - Item 'ProxyMultiSensor' received command ON
2019-05-11 13:54:30.038 [vent.ItemStateChangedEvent] - ProxyMultiSensor changed from OFF to ON
2019-05-11 13:54:49.614 [ome.event.ItemCommandEvent] - Item 'ProxyMultiSensor' received command OFF
2019-05-11 13:54:49.620 [vent.ItemStateChangedEvent] - ProxyMultiSensor changed from ON to OFF
2019-05-11 13:54:54.325 [ome.event.ItemCommandEvent] - Item 'ProxyMultiSensor' received command ON
2019-05-11 13:54:54.355 [vent.ItemStateChangedEvent] - ProxyMultiSensor changed from OFF to ON
2019-05-11 13:55:15.613 [ome.event.ItemCommandEvent] - Item 'ProxyMultiSensor' received command OFF
2019-05-11 13:55:15.621 [vent.ItemStateChangedEvent] - ProxyMultiSensor changed from ON to OFF
I have tried with the original PIR item as well (I was using the original PIR item all the time and it didn´t work, In a try to find a reason for not working, I thought it might be due to the item name. So I created the proxy item indsted). Didn´t do any good either…
Can someone explain what the heck is going on? I really dont get it
This is the screendump from habpanel when the door contact is OPEN:
EDIT…
Figured the problem… I have to use ‘, true’ in the argument, even though this is not a trasnform item…
Like this:
itemState(‘some_pri’, true) == ‘ON’
The my PIR sensors are working.