HAI omnilink binding for Openhab 2.0

Well, interestingly. I found in PaperUI if I create a “Room” Thing and set the unit number that of a Compose “Scene Control Switch” , I will get on, off, scene A, B, C, D, state, etc. channels for the device. By playing around in the Control I can get the room to turn on/off, but there is no dimmer and scenes do not work.

I can also create a UPB Unit Thing and set it’s unit number to that of a Compose “Room” and it will provide On, Off, Dim channels. The dim slider doesn’t work very well, but it does kinda work, and on/off work correctly. But no scenes are present or work - this probably makes sense since extended X-10 Codes are sent to trigger Compose scenes, however, I’d have thought that the OmniPro II would have abstracted that.

@craigh I’ve been using the binding with great success!

Is there any way to add other types of Units (other than UPB)?

I have a bunch of ‘Somfy URTSI’ roller shutters supported by the OmniLink protocol (Up/Stop/Down).

Thx! L

Did you ever create that write up ? All was going well for me using PaperUI, I had both local an remote access, etc. – until I wanted to add Tags for Alexa and HomeKit access. I tried using the REST add-on to add them, but they don’t show up in the MyOpenhab interface. Now I’m lost in the textual configuration process …

Can you post what you have in area-modes.map? I’m trying to recreate what you’ve done and this is really the first thing I’ve tried to do in openhab2

Hello - I’m wondering if someone can provide me some assistance.
First off - huge thank you to @digitaldan for creating the original library and @craigh for porting it to the Openhab2 platform.

I was using the Openhab 1 platform (and omnilink binding) successfully for quite some time. I recently decided to upgrade to Openhab2 after my old RaspberryPi was fried in a lightning strike (long story). I didn’t have a backup of my configuration.

I’ve got Openhab2 up and running, omnilink binding installed and detecting all my zones etc.

What I can’t do is DETERMINE THE CURRENT STATUS OF THE ALARM! It’s driving my insane. I’ve tried all sorts of configuration settings.

I simply cannot get the “Alarm Mode” item to properly register. I’ve tried:
String Alarm_Mode “Mode: [%s]” (Area_Main) {omnilink=“area_status_mode:1”}
I’ve tried:
String Alarm_Mode “Mode: [%s]” (Area_Main) {channel=“omnilink:area:[ID of panel]:1:mode”}

Help! I just want to be able to display “Disarmed”, “Away”, “Night”, etc.

Can anyone provide some guidance? Thanks so much…

this is what I use

Number    VT_HomeSecurityMode_Number                "Alarm [MAP(omnilinksecuritymodes.map):%s]"    (gSA_Home)            {channel="omnilink:area:9ffcfafd:1:mode"}

and this is the .map file

0=OFF
1=DAY
2=NIGHT
3=AWAY
4=VACATION
5=DAY INSTANT
6=NIGHT DELAYED
9=ARMING DAY
10=ARMING NIGHT
11=ARMING AWAY
12=ARMING VACATION
13=ARMING DAY INSTANT
14=ARMING NIGHT DELAYED

Thanks @mjcumming … I changed the ID to my specific installation as well, unfortunately it doesn’t return a value, it only returns a dash (’-’) … so … nothing. :frowning:

what firmware version of the HAI?

I’m running the latest version. I’ve always been diligent at pulling down the latest firmware as they become available in PC Access.

When I arm the system I see this in the logger

2018-09-27 09:20:37.049 [vent.ItemStateChangedEvent] - omnilink_area_9ffcfafd_2_mode changed from 0 to 9

Unfortunately not for me. I just armed the system and saw no such mode change.
Instead I saw the following:

2018-10-04 20:32:29.635 [vent.ItemStateChangedEvent] - Param2 changed from {"eventNumber":18796,"timeDataValid":true,"month":10,"day":4,"hour":20,"minute":25,"eventType":50,"parameter1":2,"parameter2":1} to {"eventNumber":18797,"timeDataValid":true,"month":10,"day":4,"hour":20,"minute":26,"eventType":48,"parameter1":2,"parameter2":1}

And a “LastLog” changed with the same information.
Then my motion sensors tripped from open to closed for a moment before reopening. But no such luck with the mode change…

Any ideas?

@bdaz
I believe you are seeing a different log entry. @mjcumming is referring to an openhab event log entry, it looks like you are seeing the LastLog item that was created to read the event log off of the omni. They are not the same log entries.

Yours is showing “Event Type 48” along with a lot of other information which translates to “Alarm set to Disarm”. I use the LastLog functionality to send Pushover notifications to my cell phone for various functions. Here is my .map file for the event log (used for the LastLog item only):

0=IDK
1=HOUSE
2=OUTSIDE
4=ZONE BYPASSED
5=ZONE RESTORED
6=ALL ZONES RESTORED
15=Pool Pump ON
16=Pool Pump OFF
17=Pool Sweep ON
18=Pool Sweep OFF
48=Alarm set to DISARM
49=Alarm set to DAY
50=Alarm set to NIGHT
51=Alarm set to AWAY
52=Alarm set to VACATION
53=Alarm set to DAY INSTANT
54=Alarm set to NIGHT DELAYED
105=DOOR LOCKED
106=DOOR UNLOCKED
128=ZONE TRIPPED
129=ZONE TROUBLE
130=REMOTE PHONE ACCESS
131=REMOTE PHONE LOCKOUT
132=ZONE AUTO BYPASSED
133=ZONE TROUBLE CLEARED
134=PC ACCESS
135=ALARM ACTIVATED
136=ALARM RESET
137=SYSTEM RESET
138=MESSAGE LOGGED
139=ZONE SHUT DOWN
140=ACCESS GRANTED
141=ACCESS DENIED

NOTE: Some of the status are custom for my set up.

@swamiller Steve - thank you! My log file isn’t firing the ItemStateChangedEvent from the “omnilink_area_[id]_2_mode” like @mjcumming describes at all, however that mapping you provided is infinitely useful, and does map to what I had been doing with the alarm at that point.

Pushover notifications of an alarm status is exactly what I was looking for. So I have a place to start.

Just wish I Could figured out why I’m not getting any update events from the panel itself, and only these last log message events…

@bdaz
I’ll share how I do my Pushover notifications. You will need to get Pushover Action set up first.

Simple Rule Example for Burglar Alarm:

rule "Burglar Alarm Notification"
when
	Item AlarmBurglary changed 	
then
	if (AlarmBurglary.state==ON) {
		sendPushoverMessage(pushoverBuilder("BURGLAR ALARM!!").withEmergencyPriority())
	}
	else cancelPushoverEmergency("Burglar Alarm Off")
end

Read the Omni Log File Rule:

NOTE: I am a total DIY’er (not code savvy) and I feel this may be a bit “cluged”. I am open to doing this a better way if there is one.

This method requires the JSONPath Transformation.

rule "Read Log and Notify"
when
    Item LastLog received update
then
    Thread::sleep(100)
    val json = LastLog.state.toString
    val tempUser = transform("JSONPATH", "$.parameter1", json)
    val tempEvent = transform("JSONPATH", "$.eventType", json)
    val tempParam2 = transform("JSONPATH", "$.parameter2", json)
    val vUser = transform("MAP","usercode.map", tempUser)
    val vEvent = transform("MAP","omnieventcode.map", tempEvent)
    
  if (tempEvent == "105" || tempEvent == "106") {
      val vParam2 = transform("MAP","door.map",tempParam2) 
      postUpdate(Param2, vParam2)     
    } else {
      val vParam2 = transform("MAP","omnieventcode.map",tempParam2)
      postUpdate(Param2, vParam2)
    }
    val message=Param2.state.toString + " " + vEvent + " by " + vUser
    //logInfo("Log", Param2.state.toString + " " + vEvent + " by " + vUser)
    postUpdate(LastUser, vUser) 
    postUpdate(LogEvent, vEvent)
    sendPushoverMessage(pushoverBuilder(message))
    Thread::sleep(100)
end

This rule uses .map files to convert status numbering from the Omni panel to user understandable text. Many of the event number codes are from the HAI/Leviton API document. Others are custom messages (converted to a digit) that I prgrammed into my Omni panel via PC Access.

The usercode.map file is a number list of the users you have programmed in you Omni. This avoids the need to expose any user codes in OpenHAB.

0=SYSTEM
1=SERVICE CODE
2=[NAME OF USER]
3=[NAME OF USER] 
4=[NAME OF USER]
255=SYSTEM

door.map - this really equates to zone numbers assignments, I happen to have my first 3 zones assigned to doors. I should probably open this up to the rest of my zone names, at some point.

1=FRONT
2=BACK
3=GARAGE ENTRY

Example in action: I set the alarm from “Night” mode to “Off”.

2018-10-06 09:22:54.970 [vent.ItemStateChangedEvent] - AlarmMode changed from 2 to 0

Event log entry with event type 50 (user 255 System) changing to event type 48 (by user 7).

The LastLog JSON output:

2018-10-06 09:22:55.647 [vent.ItemStateChangedEvent] - LastLog changed from {"eventNumber":12894,"timeDataValid":true,"month":10,"day":5,"hour":23,"minute":23,**"eventType":50**,"parameter1":255,"parameter2":1} to {"eventNumber":12895,"timeDataValid":true,"month":10,"day":6,"hour":9,"minute":22,**"eventType":48**,"parameter1":7,"parameter2":1}

OH event log entries:

2018-10-06 09:22:55.782 [vent.ItemStateChangedEvent] - LastUser changed from SYSTEM to Steve

2018-10-06 09:22:55.786 [vent.ItemStateChangedEvent] - LogEvent changed from Alarm set to NIGHT to Alarm set to DISARM

The Pushover notification looks like this on my phone:

Hopefully this helps.

2 Likes

Thank you @swamiller - this is great stuff. I’m going to get my inability to get “mode” status fixed first, then I fully intend to use what you’ve provided, as you’ve done a great job of cleaning up the Pushover notifications vs. what I provided in my openhab1.x release. Thank you for sharing!

OK. So I think I may be getting closer to why I cannot get the status of the HAI OmniPro II alarm in openHAB. I just noticed this error upon startup:

I’ve got my fingers crossed that @digitaldan or @craigh can help?

2018-10-08 08:09:40.377 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: 2018-10-8T8:2:59 is not in a valid format.
java.lang.IllegalArgumentException: 2018-10-8T8:2:59 is not in a valid format.
at org.eclipse.smarthome.core.library.types.DateTimeType.(DateTimeType.java:98) ~[?:?]
at org.openhab.binding.omnilink.handler.OmnilinkBridgeHandler.getSystemStatus(OmnilinkBridgeHandler.java:422) ~[?:?]
at org.openhab.binding.omnilink.handler.OmnilinkBridgeHandler.channelLinked(OmnilinkBridgeHandler.java:469) ~[?:?]
at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:300) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.time.format.DateTimeParseException: Text ‘2018-10-8TT00:00:008:2:59’ could not be parsed at index 8
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949) ~[?:?]
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851) ~[?:?]
at java.time.LocalDateTime.parse(LocalDateTime.java:492) ~[?:?]
at org.eclipse.smarthome.core.library.types.DateTimeType.parse(DateTimeType.java:186) ~[?:?]
at org.eclipse.smarthome.core.library.types.DateTimeType.(DateTimeType.java:93) ~[?:?]

I can’t find the Omnilink binding anymore after a rebuild of my server. Must I install it via a .jar file now?

Where can I find the latest iteration, or what am I missing? I have installed the Eclipse IoT binding.

Thanks.

@B73C
The Market Place version still shows up on mine. Verify your Marketplace settings:

Yup, that was it, thanks.

I had Maturity Level set to Production/Stable. I wasn’t aware that would make a difference.

Thank you.