When kodi is playing a video it sets the variable living room lights to 30. even if its light out i dont want it to do anything with that. when it gets dark and motion is detected, i’d like to set the dimmer to 30 as set before.
it does sent the command but i think the 30 is a string rather then a number could this be possible?
item:
Number Living_Room_Main
Number Living_Room_Cube
Dimmer Living_Room_Cube_Dimmer "Cube Light Livingroom" <light> {channel="zwave:device:a4abc26e:node4:switch_dimmer"}
Dimmer Living_Room_Dimmer "Living Room Dimmer Main" <light> {channel="zwave:device:a4abc26e:node11:switch_dimmer"}
rules:
rule "kodi paused"
when
Item My_Item changed
then
if(My_Item.state== 1)
{logInfo('Kodi','kodi is playing ')
Living_Room_Main.sendCommand(30)
Living_Room_Cube.sendCommand(30)
if ((Living_Room_Lux.state as DecimalType)<80){
Living_Room_Cube_Dimmer.sendCommand("30")
Living_Room_Dimmer.sendCommand("20")
}
}
if(My_Item.state==2) {
logInfo('Kodi','Kodi Stopped')
Living_Room_Main.sendCommand("60")
Living_Room_Cube.sendCommand("40")
if ((Living_Room_Lux.state as DecimalType)<80){
Living_Room_Cube_Dimmer.sendCommand("40")
Living_Room_Dimmer.sendCommand("55")
}
}
end
rule "Livingroom Lights on by motion"
when
Item Living_Room_Motion changed to ON
then
if ((Living_Room_Lux.state as DecimalType)<80){
Living_Room_Cube_Dimmer.sendCommand(Living_Room_Cube.state as DecimalType)
Living_Room_Dimmer.sendCommand(Living_Room_Main.state as DecimalType)
}
end
log:
2018-06-12 21:54:12.670 [vent.ItemStateChangedEvent] - zwave_serial_zstick_a4abc26e_serial_sof changed from 20173 to 20174
2018-06-12 21:54:12.681 [vent.ItemStateChangedEvent] - zwave_device_a4abc26e_node3_meter_current changed from 1.83 to 1.22
2018-06-12 21:54:16.804 [ome.event.ItemCommandEvent] - Item 'Living_Room_Motion' received command ON
2018-06-12 21:54:16.814 [vent.ItemStateChangedEvent] - Living_Room_Motion changed from OFF to ON
2018-06-12 21:54:16.843 [ome.event.ItemCommandEvent] - Item 'Living_Room_Occu' received command ON
2018-06-12 21:54:16.854 [ome.event.ItemCommandEvent] - Item 'Living_Room_Cube_Dimmer' received command 40
2018-06-12 21:54:16.864 [ome.event.ItemCommandEvent] - Item 'Living_Room_Dimmer' received command 60
The last log item Received 60, yeah it doesn’t respond to that at all… what am i doing wrong?