Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OpenHAB Driver
#1
OpenHAB is a JAVA-based open source automation software, http://www.openhab.org. It can run on almost all hardware, including Windows and Raspberry PI. It has apps for both android and IOS, and has a number of connection options, such as MQTT, SNMP, HTTP, and has a number of various interface/display options. Here's the summary from their website:

  1. is designed to be absolutely vendor-neutral as well as hardware/protocol-agnostic
  2. can run on any device that is capable of running a JVM (Linux, Mac, Windows)
  3. lets you integrate an abundance of different home automation technologies into one
  4. has a powerful rule engine to fulfill all your automation needs
  5. comes with different web-based UIs as well as native UIs for iOS and Android
  6. is fully open source
  7. is maintained by a passionate and growing community
  8. is easily extensible to integrate with new systems and devices
  9. provides APIs for being integrated in other systems

OpenHAB has also joined the cloud (band-wagon), and has a free, no-limits cloud service that connects and allows item values to be logged and uploaded to an external secure site, myopenhab.org.

IMHO, the documentation for version 2.x is great for the beginner but advanced subjects are difficult to locate or unavailable. OpenHAB has an active community and is actively developing new bindings (i.e., device drivers) for external connections. I found the community forum a better resource, than the online docs, but the built-in docs for the REST API are very comprehensive.

Attached is a CQC device driver for monitoring events, such as changes to an OpenHAB item's (field's) value. Other events could be monitored, but the driver does not support any other event types (yet). The driver's connection is only one-way, as any commands to the openhab instance can be completed using the REST API.

A TCP connection to the device running OpenHAB is required for the driver, since it implements a SSE (Server-side Event) protocol, where a persistent, one-way connection is created after a HTTP request.

The driver config file allows for multiple items to listened for (subscribed). Config file format, is as follows, (keyword names are not case-sensitive):

###############        CONFIG FILE - for OpenHAB Device Driver        ###############
####
#### ---- One config item per line, Use '~' for seperator. Lines with '#' will be ignored. ---- ####
####
# PollInterval will polling define interval, in milliseconds, default is 500
PollInterval~250

# Add additional custom fields on seperate lines, driver requires at least 1
ItemChange~someItemName
ITEMCHANGE~anotherItemName
itemchange~yetAnotherItemName
itemchange~AfourthItemName

# DebugEnable will dump debugging and detailed logging to a local file in MacroFileRoot
DebugEnable~False


Attached Files
.cqcdrvpack   OpenHAB-v1-0.CQCDrvPack (Size: 10.64 KB / Downloads: 0)
Reply
#2
Excellent stuff - I am aware of OpenHAB but have never used it. I know many have though and it is very popular. What is the use case scenario you are thinking of with this driver. Isn't OpenHAB its own automation system?

My first immediate thought was to use CQC with OpenHAB for MQTT, but I think a Node Red driver would be better if its just for that reason.

Is this meant to be a gateway to those protocol that are not currently supported in CQC but are in OpenHAB
Mykel Koblenz
Illawarra Smart Home
Reply
#3
(05-08-2018, 12:00 PM)znelbok Wrote: What is the use case scenario you are thinking of with this driver.  Isn't OpenHAB its own automation system?

Is this meant to be a gateway to those protocol that are not currently supported in CQC but are in OpenHAB

Yes, OpenHAB is another automation system, but designed to be run on lighter hardware. For me, openHAB is a backup or redundant monitor, depending on how stable I see it. I haven't enjoyed everything about OpenHAB, and I by-no means see it as a replacement to CQC, just another horse in the stable.

Recently, I've been experimenting with the various cloud automation services, integration capabilities, and I really appreciated the free cloud service for upload of data/events. I also found OpenHAB to be the only FREE service that allows me to send a string (or number) parameter via IFTTT to my home automation system, without exposing an open port to the internet.

So all this pushed me to develop and release the driver, and I thought others might find other use cases, as well, such as MQTT.
Reply
#4
Driver updated to version 1.1

Change Log:
-- Each ItemChange entry has a corresponding field created by the driver, with the same name and a standard field item prefix
-- Driver connects to OpenHAB and requests the current value of these field(s) upon startup
-- ItemChange fields are writable and send the corresponding command to OpenHAB
-- Field item prefix default string is 'oh_' , but can be updated in config file
-- Debug filename set be set in config file

Config File - Examples:

# FieldPrefix will prefix all item change field names, default is 'oh_' (lowercase o, lowercase h, underscore)
FieldPrefix~FLD-

# DebugFile is filename and full path of debug lof file, but only used when DebugEnable is set to true
DebugFile~\\OpenHAB\\OpenHAB-1.log


Attached Files
.cqcdrvpack   OpenHAB-v1-1.CQCDrvPack (Size: 13.84 KB / Downloads: 1)
Reply
#5
There isn't actually a ~ in the field names is there?
Dean Roddey
Software Geek Extraordinaire
Reply
#6
(05-27-2018, 04:53 PM)Dean Roddey Wrote: There isn't actually a ~ in the field names is there?

No, I needed a delimiter character for the config file, each line typically is a key/value pair. Below is from the config template:

#### ---- One config item per line, Use '~' for separator. Lines with '#' will be ignored. ---- ####
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Issues debugging IP based driver jnolting 5 133 Yesterday, 11:52 AM
Last Post: Dean Roddey
  Enhance Driver Test Harness Field Monitor rbroders 1 8 Yesterday, 10:49 AM
Last Post: Dean Roddey
  Koyo Click PLC Driver rbroders 75 26,613 09-23-2018, 01:18 PM
Last Post: rbroders
  Carrier Infinity HVAC Driver beelzerob 34 12,274 09-07-2018, 01:15 PM
Last Post: lleo
  Amazon Echo Hue Simulator Driver wuench 113 35,746 09-02-2018, 07:24 AM
Last Post: TurboSam
  Sony TV IP driver dogman 10 709 08-01-2018, 03:53 PM
Last Post: znelbok
  Generic Modbus Driver - Serial & IP znelbok 24 10,909 07-20-2018, 01:21 PM
Last Post: znelbok
  Sony Bravia TV Driver znelbok 12 1,651 06-11-2018, 09:19 AM
Last Post: Dean Roddey
  XBMC Driver wuench 427 153,422 05-29-2018, 03:02 AM
Last Post: znelbok
  Pushbullet Driver whozeawhat 1 431 05-13-2018, 07:27 AM
Last Post: whozeawhat

Forum Jump:


Users browsing this thread: 1 Guest(s)