mvalla / openhab-addons

Add-ons for openHAB
Eclipse Public License 2.0
24 stars 16 forks source link

alarm: add support for WHO=5 #88

Closed Tagada76 closed 1 year ago

Tagada76 commented 4 years ago

Hello All, It's possible to add support the who=5 "Alarm" ? example in my logs 2019-08-26 11:38:46.562 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: 51*##

2019-08-26 11:38:46.567 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: 55*##

2019-08-26 11:38:46.570 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: 57*##

2019-08-26 11:38:46.574 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: 59*##

i have a documentation for who=5

mvalla commented 4 years ago

i have a documentation for who=5

can you provide a link to the documentation for WHO=5 ?

Tagada76 commented 4 years ago

Hello massimo, Link : https://www.myopen-legrandgroup.com/content/uploads/2016/06/WHO_5.pdf

Regards Arnaud

mvalla commented 4 years ago

can you update the logs in the description and use "insert code button" (top of text box) when copy-paste the log here?

Tagada76 commented 4 years ago

`2019-08-26 11:38:46.562 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: 51*##

2019-08-26 11:38:46.567 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: 55*##

2019-08-26 11:38:46.570 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: 57*##

2019-08-26 11:38:46.574 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: 59*##`

mvalla commented 4 years ago

@Tagada76 you should copy it again from the OH log and paste it in the comment using code fences (put a ``` before and after)

francemgit commented 4 years ago

Hi,

I'm interested to WHO 5 too. Hereafter few logs after sending Alarm status frame on bus ( System active, System not engaged, Battery OK, Network OK) :


2019-09-15 09:40:59.808 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: *5*1*##
2019-09-15 09:40:59.824 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: *5*9*##
2019-09-15 09:40:59.836 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: *5*5*##
2019-09-15 09:40:59.847 [WARN ] [penwebnet.message.OpenMessageFactory] - ##openwebnet## INVALID FRAME: *5*7*##
gilbertococchi commented 4 years ago

Hi @mvalla and @Tagada76 I am happy to help adding support for WHO5 on Massimo's Openhab Binding.

Can you please explain what Alarm central you have?

I also have Bticino Alarm connected to My Home Up but I am not fetching any WHO 5 event from the OpenWebnet Windows client at all.

From @francesco-re-1107 experience on https://github.com/francesco-re-1107/openwebnet-alarm it seems like it's possible to check some Alarm information but controlling the alarm only by using auxiliary commands really. I cannot test openwebnet-alarm because it doesn't allow non numerical password...

It would help to understand how to intercept all the Burglar Central messages first.

fmalfatto commented 3 years ago

Any new? I confirm I have the 3486 central and I would help if possible. The who 5 support is mandatory for me to shift from Domoticz to Openhab.

m4rky-m4rk commented 3 years ago

A work around would be to use, if you have any, the alarms relay outputs. They can be used to indicate the alarms state if connected to the BUS via a contacts interface. The alarm state info is then avaiilable on the BUS and in openHAB. I use this method to monitor my alarm state, useful for some rules, while keeping the activation and deactivation of the alarm system completely isolated from my home automation.

fmalfatto commented 3 years ago

Yes, Mark, I agree, but my goal is to control just activation/deactivation as result of other conditions, such activate it at a certain hour only IF all sensors are allowing, deactivate it when we approach home AND all is under control... Domoticz allows me via AUX commands to activate/deactivate zones and to write rules or scripts for it, mantaining the securitiy because their execution is only allowed to known IPs and users and under https (reverse proxy needed) I could also use Domoticz to generate something when an alarm command is received and check it from Openhab, but I would like to avoid to maintain active two separate portals for the same thing.

fmalfatto commented 2 years ago

I was able to have my 3486 engaged/disengaged, thanks to some info I found here: https://community.openhab.org/t/solved-openwebnet-alarm-in-openhab/83906 I have both MHS1 (not sending anything to 3486) and LN4890 unofficial gateway. This one is reaching the 3486. Here are the steps I did: 1) downloaded the library from the link I posted and put in /usr/local/src/openwebnet-alarm-master 2) installed the exec binding and regex tranformation 3) defined the "alarm_3486.things" file:
Thing exec:command:alarm_state [command="/usr/bin/python /usr/local/src/openwebnet-alarm-master/alarm_status.py", interval=5, timeout=1, autorun=true ] 3) defined the "alarm_3486.items" file: Switch Allarme "Allarme" ["Switchable"] String Stato_allarme {channel="exec:command:alarm_state:output"} 4) defined 4 rules: allarme_off.rules allarme_on.rules allarme_rec_off.rules allarme_rec_on.rules This way: rule "Alarm state changed from 1 to 0" when Item Stato_allarme changed from 1 to 0 then Allarme.sendCommand(OFF) end // rule "Alarm state changed from 0 to 1" when Item Stato_allarme changed to 1 then Allarme.sendCommand(ON) end // rule "Alarm received OFF command" when Item Allarme received command OFF then executeCommandLine("/usr/bin/python","/usr/local/src/openwebnet-alarm-master/disable_alarm.py") end rule "Alarm received ON command" when Item Allarme received command ON then executeCommandLine("/usr/bin/python","/usr/local/src/openwebnet-alarm-master/enable_alarm.py") end // 5) PROBLEM There is a problem from the downloaded script "alarm_status.py". It does not always return the correct status 0 or 1 because of wrong decoding of the message returned from gateway, so I had to manage the empty return code forcing a "N" in such case: `from OpenWebNet import OpenWebNet server = OpenWebNet("192.168.1.50","20000","12345") res = server.stato_allarme()

check result

if res == "58##": #alarm is enabled print "1" if res == "59##": #alarm is disabled print "0" if res == "": print "N" In fact from events.log I see that the state of 3486 continously change, but this problem needs a debug of the python script that is too difficult for me: 2021-09-25 08:54:48.885 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Stato_allarme' changed from 0 to N 2021-09-25 08:54:54.303 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Stato_allarme' changed from N to 0 2021-09-25 08:55:10.589 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Stato_allarme' changed from 0 to N 2021-09-25 08:55:15.997 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Stato_allarme' changed from N to 0

So the whole structure works, but it is not smart. Is there anyone able to improve it? Thanks in advance! `

mvalla commented 1 year ago

Alarm (WHO=5) support has been added to the binding in openHAB 3.4 official distribution via https://github.com/openhab/openhab-addons/pull/13694