HAI omnilink binding for Openhab 2.0

openhab2
omnilink
binding
Tags: #<Tag:0x00007f0148be3f20> #<Tag:0x00007f0148be3cc8> #<Tag:0x00007f0148be3ae8>

(Craig) #61

Ok. I was finally able to get this binding migrated to the 2.4.0 master of openhab. The date issue that was seen earlier should be fixed. There is probably an issue with reconnection to the omnilink, but that really shouldn’t happen too often for anyone.

The latest build is available via the marketplace.


(Michael Cumming) #62

Hi Craig,

Error is gone, thank you.

Would it be possible to add the ability to set the time on the Omni controller from OH? It drifts a fair bit…

Mike


(Craig) #63

I have a rule which syncs the clock in the middle of the night. Try this:

rule "sync omnilink clock to server "
when
        Time cron "0 37 3 * * ?"
then
        logInfo("Rules","Syncing omnilink clock")
        omnilink_controller_omni_sysdate.sendCommand( new DateTimeType() )
end

(Dave Tench) #64

I think I’m experiencing the issue with reconnection to my panel. When I go back and look at my items in PaperUI>Configuration>Things it often shows my omnilink items as offline.

If i do an openhab2.service restart everything is OK for a few hours, then they go offline again.

What else am I doing wrong?

Also, in my openhab.log I see an error where I think my version of the omnilink binding is way off…

2018-10-31 17:15:11.648 [WARN ] [.omnilink.handler.AudioSourceHandler] - Exception Polling Event Log

org.openhab.binding.omnilink.handler.BridgeOfflineException: com.digitaldan.jomnilinkII.OmniNotConnectedException at org.openhab.binding.omnilink.handler.OmnilinkBridgeHandler.reqEventLogData(OmnilinkBridgeHandler.java:519) [227:org.openhab.binding.omnilink:2.2.0.201712151530]

“openhab.binding.omnilink:2.2.0.201712151530” is quite old, is it not? How can I force openHAB to fetch the new one mentioned above?


(Craig) #65

yes, it does look like you are losing the connection.

I haven’t been terribly involved with openhab development lately. It seems they now recommend eliminating referencing the google guava library, which with an extension is what I was using for reconnect in this binding.

I have tried to look at other bindings but haven’t been able to find one that reconnects. If anyone else knows how the scheduling of reconnecting is suggested now, would appreciate some feedback.

Otherwise I will try and keep looking for a solution.


(Dave Tench) #66

OK, I’ll standby for any updates on the binding, but does it look like I’m still using an old one?

Should I be installing the .jar manually or do I continue to use the one from the Marketplace and hope it updates when needed?


(Steve M.) #67

@B73C
I ended up using the .jar in my addon’s folder. I found the Marketplace bindings will turn on and off when I update snapshots, including the Omnilink binding. It has been much more stable as an addon.


(Michael Cumming) #68

Same problem here with Milestone builds.


(Dave Tench) #69

Understood, thank you. Where can I find the latest snapshot now?

I can never be sure I’m getting the latest one…

Dave


(Michael Cumming) #70

Thanks Craig

For anyone interested, equivalent code in Jython is


@rule("Update Omni Time")

@when("Time cron 0/10 * * * * ?")
def set_omni_time(event):
    item = ir.getItem ("omnilink_controller_9ffcfafd_sysdate")
    events.sendCommand (item, DateTimeType ())



(Dave Tench) #71

I think I may have answered my own question as to where the latest binding is but I had to do some digging.

Using this link from other threads (https://s3-us-west-2.amazonaws.com/craigham-pub/org.openhab.binding.omnilink-2.2.0-SNAPSHOT.jar) I simply removed the last bit and used:

https://s3-us-west-2.amazonaws.com/craigham-pub/

to see that there is a 2.4.0 with a Last Modified stamp of 2018-10-25T21:39:09.000Z.

I will download this one and use this .jar instead of the Marketplace one in the hope that it stops reverting to an older build.

Is this link the best place to watch for any updates to this snapshot?


(Michael Cumming) #72

@craigh I would like to use the Omni all on/off - keypad 4 0 / 4 1

I see this channel event in the logger but cannot figure out how to use it

2018-11-01 08:33:38.408 [vent.ChannelTriggeredEvent] - omnilink:area:9ffcfafd:1:all_on_off_Event triggered OFF

(Craig) #73

@mjcumming are there imports etc that go above that rule in jython? I have a combination of jython/xtend but have not used the annotations before.

Thanks,
Craig


(Craig) #74

Yes that AWS folder is the place to look for bindings that i build.

I imagine the binding builds will continue being there as getting a binding accepted into the main github is significant work and effort and my past procrastination has shown I don’t have the appetite for it.


(Michael Cumming) #75

Hi Craig,

Entire code block is below. Note this uses the new decorators but together by @5iver


from org.slf4j import Logger, LoggerFactory

from openhab.rules import rule

from openhab.triggers import when, CronTrigger

from threading import Timer

import datetime

scriptExtension.importPreset("RuleSupport")

scriptExtension.importPreset("RuleSimple")



@rule("Update Omni Time")

@when("Time cron 0 0 1 * * ?")
def set_omni_time(event):
    item = ir.getItem ("omnilink_controller_9ffcfafd_sysdate")
    events.sendCommand (item, DateTimeType ())






(Craig) #76

I didn’t write the code for the on/off functionality…

However, in looking at the AreaHandler it looks like you can only track all on/off events within openhab, but not initiate.


(Brian OConnell) #77

@mjcumming -. You can file an issue in GitHub and I will try and get to it. I am currently working on some other bindings so it may be a bit.

As a workaround you can setup an openhab button for all on / all off and invoke that from the binding.


(Craig) #78

@broconne if you do get a chance to take a look notice that I have migrated the binding over to the omnilink-binding branch now for the 2.4 dev. I tried to rebase the digitaldan… branch to the latest but got totally lost.


(Michael Cumming) #79

Hi Brian, I set up a flag and program on the Omni and catch the flag change in OH.

Works, but not pretty :slight_smile:

Mike


(Steve M.) #80

Consequently, that is the same method I used to get my omni controlled zigbee locks to function in OH.

Fun with flags!