Fibaro smoke sensor Configuration i OpenHab

I included my Fibaro Smoke sensor from HABmin by pressing the inclusion button on my smoke sensor – OpenHAB included it but didn’t get the vendor information right away – but after pressing the inclusion button 3 times again it turned up nicely.

In the Items directory I have added this configuration to my default.items file:

Group All
Group Security (All)
Group SmokeSensors "Kitchen" (Security)
Switch Smoke_Sensor_smoke "Smoke detected in kitchen [%s]" (SmokeSensors) { zwave="4:command=sensor_alarm,alarm_type=1" }
Switch Smoke_Sensor_tampered "Smoke sensor kitchen tampered [%s]" (SmokeSensors) { zwave="4:command=sensor_alarm,alarm_type=0" }
Number Smoke_Sensor_battery "Smoke sensor kitchen battery [%s %%]" (SmokeSensors) { zwave="4:command=BATTERY" }
Number Smoke_Sensor_temp "Kitchen temperature [%.1f C]" (SmokeSensors) { zwave="4:command=SENSOR_MULTILEVEL,sensor_type=1" }
DateTime Smoke_Sensor_updated "Last updated [%1$td/%1$tm/%1$tY %1$tH:%1$tM:%1$tS]" (SmokeSensors) { zwave="4:command=info,item=LAST_UPDATE" }

And this configuration to my default.sitemap  file

sitemap default label="Main Menu"
{
Frame label="Kitchen" {
Text item=Smoke_Sensor_smoke
Text item=Smoke_Sensor_tampered
Text item=Smoke_Sensor_battery
Text item=Smoke_Sensor_temp
Text item=Smoke_Sensor_updated
}
}

Finally I have added two rules to notify me on a push notification if the alarm is trickered:


import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*

rule “PushoverSmokeSensorInKitchenTampered”
when
Item Smoke_Sensor_tampered changed
then
if (Smoke_Sensor_tampered.state.toString()== “ON”) {
pushover(“Smoke Sensor Tampered”, “NameOnMyiPhoneOnPushoverWebsite”)
}

logInfo(“Smoke_Sensor_tampered changed: “,Smoke_Sensor_tampered.state.toString())
end

 

And …


import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*

rule “PushoverSmokeSensorInKitchenTriggered”
when
Item Smoke_Sensor_smoke changed
then
if (Smoke_Sensor_smoke.state.toString()== “ON”) {
pushover(“Smoke detected in kitchen”, 2)
}

logInfo(“Smoke_Sensor_smoke changed: “,Smoke_Sensor_smoke.state.toString())
end