I want to create a string to report my alarm status. and not sure where to start.
my setup is as follows.
I have a raspberry pi ( OpenHAB-DB) that monitors my alarm via the alarm panel Output relays.
this is done with 4 GPIO of the PI.
pin 1 = Arm away
pin 2 = Arm Stay
pin 3 = Burglary ( Pulsed out 1s/1s)
pin 4 = Panic ( Pulsed out 1s/1s)
how I have it currently is as items and sitemap. and statuses is sent directly from node red. as links.
If openHAB runs on the RPi to have its GPIOs connected then just use the proper GPIO binding.
If it’s different devices use MQTT. Rules you don’t need for this simple mapping purpose.
I thought you already had these Items in openHAB, and just needed to umm collate them. Rules are meant for that. I’m not sure how MQTT - which just shovels data from here to there - could help with that.
You didn’t say, but I guess you wouldn’t want this master status pulsing like some of the onputs do? So there will be some timing element to do.
I think I would create extra Items like Panic_static. A little rule would run if Panic changes to ON and the rule would update Panic_static to ON.
Panic_static would be set up with the expire binding so that it falls back to OFF state after say 3 seconds since the last update.
That will convert the pulsing inputs to a nice steady state.
Now we just need a rule triggered by a group member change, that group containing all of the steady-state conditions.
The rule can have a default string “disarmed”, and examine each input Item in ascending priority order to change the string if needed, finally updating your master status Item.
use to run openhab on the pi and hade them conected and used the gpio binding. but moved openhab over to my server in workshop.and created the remote DB.
I just want to be Abel to see what the alarm status is .
I have only started with writing rules. now. so I am still learning.
but I am getting there
I am going to spend some time on this , this weekend. and will past some configs here. for feedback. once done I can create a tutorial on haw to do it and will upload it.
all I need to do is create a rule that will broadcast status changes to my iOS app and then also have the information logged to a log file. something like Alarm.log.
to keep records of the alarm status changes.
hi guys. I have come to a point that I got stuck.
in my rule I want open had to broadcast the alarm status once it happens. it pushes it to the iOS app. but seems I am missing something. I am only starting with rules now. so I am a noob on them.
can you guys have a look and steer me in the right direction…
rule "Armed-Away"
when
Item Alarm_Status changed from Disarmed to Armed-Away
then
// do something
sendBroadcastNotification("Alarm Armed Away")
end
rule "Burglary"
when
Item Alarm_Status changed to Burglary
then
// do something
sendBroadcastNotification("Break-IN")
end
rule "Panic-Duress"
when
Item Alarm_Status changed to Panic-Duress
then
// do something
sendBroadcastNotification("Panic-Duress")
end
rule "Disarmed"
when
Item Alarm_Status changed to Disarmed
then
// do something
sendBroadcastNotification("Alarm Disarmed")
end
I receive notifications on my iPhone . and want the alarm status to be sent to to my ios app . when the alarm status changes. ( I got the system monitoring to work that sends a online / offline when my remote db drops off. )
but can’t get the alarm one to work.
Thanks for the simple rule. will check using it.
thanks for the help