items file:
Code: Select all
String iBeam_Hall "Hall PIR [%s]" <motion> {mqtt="<[mqtt:/SPC/G_SPC_ZONE_INPUT_2:state:JSONPATH(status)]"}
Code: Select all
rule "PIR toggles light"
when
Item iBeam_Hall changed
then
if (iBeam_Hall.state == "open") {
zwave_device_15a390b5594_node2_switch_dimmer.sendCommand(ON)
}
else if (iBeam_Hall.state == "closed") {
zwave_device_15a390b5594_node2_switch_dimmer.sendCommand(OFF)
}
end
This is the Mosquitto sub feed:
Code: Select all
mosquitto_sub -v -t /#
/SPC/G_SPC_AREA_MODE_1 {"update_time":1491385018195,"status":"unset"}
/SPC/G_SPC_ZONE_INPUT_1 {"update_time":1491385018183,"status":"closed"}
/SPC/G_SPC_ZONE_STATUS_1 {"update_time":1491385018183,"status":"ok"}
/SPC/G_SPC_ZONE_INPUT_2 {"update_time":1491392732843,"status":"closed"}
/SPC/G_SPC_ZONE_STATUS_2 {"update_time":1491385018184,"status":"ok"}
/SPC/G_SPC_ZONE_INPUT_3 {"update_time":1491385018184,"status":"closed"}
/SPC/G_SPC_ZONE_STATUS_3 {"update_time":1491385018184,"status":"ok"}
/SPC/G_SPC_ZONE_INPUT_4 {"update_time":1491389782807,"status":"closed"}
/SPC/G_SPC_ZONE_STATUS_4 {"update_time":1491385018184,"status":"ok"}
/SPC/G_SPC_ZONE_INPUT_5 {"update_time":1491385018184,"status":"closed"}
/SPC/G_SPC_ZONE_STATUS_5 {"update_time":1491385018184,"status":"isolate"}
/SPC/G_SPC_ZONE_INPUT_6 {"update_time":1491385018184,"status":"closed"}
/SPC/G_SPC_ZONE_STATUS_6 {"update_time":1491385018184,"status":"ok"}
/SPC/G_SPC_ZONE_INPUT_7 {"update_time":1491385018184,"status":"closed"}
/SPC/G_SPC_ZONE_STATUS_7 {"update_time":1491385018184,"status":"ok"}
/SPC/G_SPC_AREA_MODE_1 0
/SPC/G_SPC_AREA_MODE_1 3
Code: Select all
Switch Toggle_Alarm "Toggle Alarm" {mqtt=">[mqtt:/SPC/G_SPC_AREA_MODE_1:command:ON:0],>[mqtt:/SPC/G_SPC_AREA_MODE_1:command:OFF:3]"}
Should it even be possible to control the alarm like this, or is it all read-only?