Jump to content


Photo
- - - - -

OmniLinkBridge to integrate Home Assistant, SmartThings, Node-RED


  • Please log in to reply
124 replies to this topic

#1 rsw686

rsw686

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 462 posts
  • Experience:guru
  • Software:Open Source Automation
  • Hardware:HAI OmniPro II
  • Tech:UPB, Z-Wave, ZigBee, 1-Wire, RadioRA2
  • Phone:Asterisk, FreePBX

Posted 13 October 2018 - 09:34 PM

OmniLinkBridge is a C# service that allows you to control your OmniPro II controller from SmartThings (Web API) and Home Assistant (MQTT). You can also use it with NodeRed (MQTT) to create flows for advanced control of your devices. As the successor to HAILogger is also provides logging and notifications. You can download and/or contribute on GitHub.

The big feature for this rewrite is the MQTT module. To get started with Home Assistant you need an MQTT broker such as Mosquitto running and a Windows (.NET Framework 4.5.2) or Linux system (mono) to run OmniLinkBridge. Once configured Home Assistant will auto discover and add the OmniPro II devices.

configuration.yaml
mqtt:
    broker: localhost
    username: mosquitto
    password: yourpassword
    discovery: true
    discovery_prefix: homeassistant
OmniLinkBridge.ini
mqtt_enabled = yes
mqtt_server = hassio
mqtt_port = 1883
mqtt_username = mosquitto
mqtt_password = yourpassword
mqtt_discovery_prefix = homeassistant

Out of the box with Home Assistant 0.80.0 there are two caveats. For full functionality you will need to add a custom_components folder to your config directory and override the following. Links to the pull requests are below, so you can track the status of these being included into the next version of Home Assistant.
alarm_control_panel/mqtt.py Adds night mode
climate/mqtt.py Adds temperature low and high setpoints

Edited by rsw686, 13 October 2018 - 09:45 PM.


#2 pete_c

pete_c

    Cocoonut

  • -=Gold Supporter=-
  • 8978 posts
  • Location:House
  • Experience:average
  • Software:Main Lobby, Open Source Automation
  • Hardware:HAI OmniPro II, Mi Casa Verde Vera, Ocelot
  • Tech:X10-PLC, X10-RF, UPB, INSTEON, Z-Wave, ZigBee, 1-Wire, xAP, xPL, ALC
  • Audio:Russound
  • Video:MythTV
  • CCTV:analog, ip, dvr
  • Phone:Asterisk, FreePBX, Ooma, POTS, VoIP via ISP

Posted 14 October 2018 - 07:45 AM

Thank you Ryan.
 
Downloaded and unzipped bin files for use.

I have left the HAILogger application running.
 
testing by running
 
mono OmniLinkBridge.exe -i
 
checking log.txt file and see this:
 
2018-10-14 07:29:22,131 [1] ERROR OmniLinkBridge.Settings - Invalid port specified for controller_port
2018-10-14 07:29:35,667 [1] ERROR OmniLinkBridge.Settings - Invalid port specified for controller_port
2018-10-14 07:30:23,265 [1] ERROR OmniLinkBridge.Settings - Invalid port specified for controller_port
2018-10-14 07:36:05,514 [1] ERROR OmniLinkBridge.Settings - Invalid port specified for controller_port
2018-10-14 07:37:58,916 [1] ERROR OmniLinkBridge.Settings - Invalid port specified for controller_port
 
To test currently only have connection to OmniPro 2 panel configured.
 
Disabled:
 
1 - mysql logging
2 - web service
3 - mqtt
4 - Email, prowl and push.

Copied OmniLinkBridge directory over to a Windows 2016 Standard desktop. Running executible to test and see the same in the log.txt file.

2018-10-14 15:11:31,858 [1] ERROR OmniLinkBridge.Settings - Invalid port specified for controller_port
2018-10-14 15:25:55,529 [1] ERROR OmniLinkBridge.Settings - Invalid port specified for controller_port

#3 rsw686

rsw686

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 462 posts
  • Experience:guru
  • Software:Open Source Automation
  • Hardware:HAI OmniPro II
  • Tech:UPB, Z-Wave, ZigBee, 1-Wire, RadioRA2
  • Phone:Asterisk, FreePBX

Posted 14 October 2018 - 08:35 PM

@pete_c
 
Please verify the OmniLinkBridge.ini file is in the same folder and has controller_port = 4369. If you renamed the HAILogger.ini, that won't work as I changed some of the setting names. For example controller_port used to be named hai_port.

Edited by rsw686, 14 October 2018 - 08:36 PM.


#4 pete_c

pete_c

    Cocoonut

  • -=Gold Supporter=-
  • 8978 posts
  • Location:House
  • Experience:average
  • Software:Main Lobby, Open Source Automation
  • Hardware:HAI OmniPro II, Mi Casa Verde Vera, Ocelot
  • Tech:X10-PLC, X10-RF, UPB, INSTEON, Z-Wave, ZigBee, 1-Wire, xAP, xPL, ALC
  • Audio:Russound
  • Video:MythTV
  • CCTV:analog, ip, dvr
  • Phone:Asterisk, FreePBX, Ooma, POTS, VoIP via ISP

Posted 14 October 2018 - 10:06 PM

Thank you Ryan.
 
Yes I had done a copy and paste of the top HAI section from the HAILogger.ini file to the OmniLinkBridge.ini.
 
Working now.

Tested Email notifications and Samsung Smartthings and working fine.

#5 pete_c

pete_c

    Cocoonut

  • -=Gold Supporter=-
  • 8978 posts
  • Location:House
  • Experience:average
  • Software:Main Lobby, Open Source Automation
  • Hardware:HAI OmniPro II, Mi Casa Verde Vera, Ocelot
  • Tech:X10-PLC, X10-RF, UPB, INSTEON, Z-Wave, ZigBee, 1-Wire, xAP, xPL, ALC
  • Audio:Russound
  • Video:MythTV
  • CCTV:analog, ip, dvr
  • Phone:Asterisk, FreePBX, Ooma, POTS, VoIP via ISP

Posted 16 October 2018 - 12:46 PM

Testing MQTT configuration today running on Mono with Ubuntu 18.04 64 bit and Windows 2016 standard 64 bit.
 
Configuration file settings are:
 
# MQTT
# Can be used for integration with Home Assistant
mqtt_enabled = yes
mqtt_server = 192.168.244.175
mqtt_port = 1883
 
175 is the IP of the Mosquitto broker here.

I do not have Mosquitto installed on the box running OmniLinkBridge.
 
When I manually run the application see this: (mono OmniLinkBridge -i)
 

OmniLinkBridge.Modules.MQTTModule: 2018-10-16 12:45:18,204 DEBUG: Error An address incompatible with the requested protocol was used

OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:15:43,403 DEBUG: Publishing areas
OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:15:43,450 DEBUG: Publishing zones
OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:15:43,460 DEBUG: Publishing units
OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:15:43,464 DEBUG: Publishing thermostats
OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:15:43,470 DEBUG: Publishing buttons
OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:15:47,062 DEBUG: Error An address incompatible with the requested protocol was used
OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:15:52,064 DEBUG: Error An address incompatible with the requested protocol was used
OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:15:57,068 DEBUG: Error An address incompatible with the requested protocol was used
OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:16:02,072 DEBUG: Error An address incompatible with the requested protocol was used
OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:16:07,073 DEBUG: Error An address incompatible with the requested protocol was used

 
Not sure why I see this message.
 

#6 pete_c

pete_c

    Cocoonut

  • -=Gold Supporter=-
  • 8978 posts
  • Location:House
  • Experience:average
  • Software:Main Lobby, Open Source Automation
  • Hardware:HAI OmniPro II, Mi Casa Verde Vera, Ocelot
  • Tech:X10-PLC, X10-RF, UPB, INSTEON, Z-Wave, ZigBee, 1-Wire, xAP, xPL, ALC
  • Audio:Russound
  • Video:MythTV
  • CCTV:analog, ip, dvr
  • Phone:Asterisk, FreePBX, Ooma, POTS, VoIP via ISP

Posted 16 October 2018 - 01:44 PM

Running on Windows 2016 works fine.  Same configuration file. 

I can see the Mosquitto messages on the Homeseer server.

Attached File  MMessages.jpg   328.35K   15 downloads

Installed Home Assistant today on another box running Ubuntu 18.04 64 bit. Used an old Shuttle Netop that has been in off mode now for a couple years.

Configured per your above instructions and worked right out of the box.
 

#7 rsw686

rsw686

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 462 posts
  • Experience:guru
  • Software:Open Source Automation
  • Hardware:HAI OmniPro II
  • Tech:UPB, Z-Wave, ZigBee, 1-Wire, RadioRA2
  • Phone:Asterisk, FreePBX

Posted 17 October 2018 - 11:59 AM


OmniLinkBridge.Modules.MQTTModule: 2018-10-16 13:16:07,073 DEBUG: Error An address incompatible with the requested protocol was used

 
Not sure why I see this message.
 

 
That error is from the MQTTnet.Extensions.ManagedClient nuget library I am using. I would check the OmniLinkBridge.ini config to make sure you have mqtt_server defined.

Edited by rsw686, 17 October 2018 - 12:00 PM.


#8 pete_c

pete_c

    Cocoonut

  • -=Gold Supporter=-
  • 8978 posts
  • Location:House
  • Experience:average
  • Software:Main Lobby, Open Source Automation
  • Hardware:HAI OmniPro II, Mi Casa Verde Vera, Ocelot
  • Tech:X10-PLC, X10-RF, UPB, INSTEON, Z-Wave, ZigBee, 1-Wire, xAP, xPL, ALC
  • Audio:Russound
  • Video:MythTV
  • CCTV:analog, ip, dvr
  • Phone:Asterisk, FreePBX, Ooma, POTS, VoIP via ISP

Posted 17 October 2018 - 06:17 PM

Thank you Ryan.
 
Yes it is correct.  It works fine in Windows 2016 but not in Linux Mono.  Using same INI file for both.
 
# MQTT
# Can be used for integration with Home Assistant
mqtt_enabled = yes
mqtt_server = 192.168.244.175
mqtt_port = 1883
mqtt_username =
mqtt_password =
mqtt_discovery_prefix = homeassistant
# mqtt_discovery = id=5;device_class=battery
# specify a range of numbers like 1,2,3,5-10
mqtt_discovery_ignore_zones =
mqtt_discovery_ignore_units =
# device_class must be battery, door, garage_door, gas, moisture, motion, problem, smoke, or window
#mqtt_discovery_override_zone = id=5;device_class=garage_door
#mqtt_discovery_override_zone = id=6;device_class=garage_door
 
I am using same broker (IP) for other Mosquitto stuff...IE: Node Red, Homeseer, SonOff WiFi modded modules et al.

#9 rsw686

rsw686

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 462 posts
  • Experience:guru
  • Software:Open Source Automation
  • Hardware:HAI OmniPro II
  • Tech:UPB, Z-Wave, ZigBee, 1-Wire, RadioRA2
  • Phone:Asterisk, FreePBX

Posted 17 October 2018 - 06:44 PM

Thats interesting as it works on CentOS 7 with mono. The connect code is all handled inside the nugget package that is precompiled. Do you use docker? For simplicity Im planning to build a docker image.

#10 pete_c

pete_c

    Cocoonut

  • -=Gold Supporter=-
  • 8978 posts
  • Location:House
  • Experience:average
  • Software:Main Lobby, Open Source Automation
  • Hardware:HAI OmniPro II, Mi Casa Verde Vera, Ocelot
  • Tech:X10-PLC, X10-RF, UPB, INSTEON, Z-Wave, ZigBee, 1-Wire, xAP, xPL, ALC
  • Audio:Russound
  • Video:MythTV
  • CCTV:analog, ip, dvr
  • Phone:Asterisk, FreePBX, Ooma, POTS, VoIP via ISP

Posted 18 October 2018 - 06:40 AM

The OmniLinkBridge directory / program is installed on the Ubuntu 18.04 64 bit computer which is the same computer as the HAILogger program.

 

~# lsb_release -a
LSB Version:    core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID:    Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:    bionic

 

~# mono -V
Mono JIT compiler version 5.16.0.179 (tarball Thu Oct  4 10:20:38 UTC 2018)
Copyright © 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug
    Interpreter:   yes
    LLVM:          yes(3.6.0svn-mono-/)
    GC:            sgen (concurrent by default)
 

Mosquitto Broker is running on an RPi with Stretch computer

 

Stretch175:~# lsb_release -a
No LSB modules are available.
Distributor ID:    Raspbian
Description:    Raspbian GNU/Linux 9.4 (stretch)
Release:    9.4
Codename:    stretch
 

Stretch175:~# mono -V
Mono JIT compiler version 5.16.0.179 (tarball Thu Oct  4 12:22:11 UTC 2018)
Copyright © 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       normal
    Notifications: epoll
    Architecture:  armel,vfp+hard
    Disabled:      none
    Misc:          softdebug
    Interpreter:   yes
    LLVM:          yes(3.6.0svn-mono-/)
    GC:            sgen (concurrent by default)
 

Stretch175:~# mosquitto
1539861755: mosquitto version 1.5.3 starting
1539861755: Using default config.
1539861755: Opening ipv4 listen socket on port 1883.
 

Home Assistant is running on another computer here:

 

Shuttle:~# lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:    bionic
 

Hass.io was installed per documentation related to docker.  It is running fine. 


Node Red is also installed on same said computer as Home Assistant. 



#11 pete_c

pete_c

    Cocoonut

  • -=Gold Supporter=-
  • 8978 posts
  • Location:House
  • Experience:average
  • Software:Main Lobby, Open Source Automation
  • Hardware:HAI OmniPro II, Mi Casa Verde Vera, Ocelot
  • Tech:X10-PLC, X10-RF, UPB, INSTEON, Z-Wave, ZigBee, 1-Wire, xAP, xPL, ALC
  • Audio:Russound
  • Video:MythTV
  • CCTV:analog, ip, dvr
  • Phone:Asterisk, FreePBX, Ooma, POTS, VoIP via ISP

Posted 18 October 2018 - 07:32 AM

Very odd here Ryan...
 
Running it on the Intel based Ubuntu with current Mono still see this error on running the exe.
 
OmniLinkBridge.Modules.MQTTModule: 2018-10-18 07:24:47,140 DEBUG: Error An address incompatible with the requested protocol was used

Same Mono version running on both computers.
 
Running it on the ARM. based Ubuntu with current Mono (Pine64) I get no errors.
 
Works perfect.
 
The Intel computer is faster and has more memory than the Pine 64 computer. 
 
I am running Homeseer 3 which uses Mono on both of these computers and I was running HAI Logger on the Intel computer just fine.  OmniLinkBridge works on the Intel computer except for the Mosquitto piece.

Learning here running Home Assistant. Working fine.

Temps coming from the OP2 panel are all in C versus F.

Fixed temps relating to Climate...to °F easy fix.

Tested alarm functions, unit functions et al in Home Assistant...all working fine.

#12 rsw686

rsw686

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 462 posts
  • Experience:guru
  • Software:Open Source Automation
  • Hardware:HAI OmniPro II
  • Tech:UPB, Z-Wave, ZigBee, 1-Wire, RadioRA2
  • Phone:Asterisk, FreePBX

Posted 18 October 2018 - 08:38 AM

Did you add the github custom_components/climate/mqtt.py to your Home Assistant config folder? If not the out of the box MQTT climate only supports a single temperature target and will default to 21 degrees. OmniLinkBridge publishes low and high temperature targets and expects my changes to the MQTT climate module.

 

https://raw.githubus...climate/mqtt.py



#13 pete_c

pete_c

    Cocoonut

  • -=Gold Supporter=-
  • 8978 posts
  • Location:House
  • Experience:average
  • Software:Main Lobby, Open Source Automation
  • Hardware:HAI OmniPro II, Mi Casa Verde Vera, Ocelot
  • Tech:X10-PLC, X10-RF, UPB, INSTEON, Z-Wave, ZigBee, 1-Wire, xAP, xPL, ALC
  • Audio:Russound
  • Video:MythTV
  • CCTV:analog, ip, dvr
  • Phone:Asterisk, FreePBX, Ooma, POTS, VoIP via ISP

Posted 18 October 2018 - 12:47 PM

Thank you Ryan.  Still learning HA here.  I do not see where the cutom components directory is:
 
Attached File  CC.jpg   96.54K   2 downloads
 
Guessing that I drop the directory here eh?
 
/home/pete/.homeassistant/custom_components/climate/mqtt.py

1 - cd /home/pete/.homeassistant
2 - mkdir custom_components
3 - mkdir climate
4 - nano mqtt.py
5 - chmod +x mqtt.py

Restarted HA.
 
 

#14 rsw686

rsw686

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 462 posts
  • Experience:guru
  • Software:Open Source Automation
  • Hardware:HAI OmniPro II
  • Tech:UPB, Z-Wave, ZigBee, 1-Wire, RadioRA2
  • Phone:Asterisk, FreePBX

Posted 18 October 2018 - 03:05 PM

Yes that looks correct. Side note I added a Dockerfile to the git repo and directions on how to build an image. I switched my install over to a docker container. I'd give that a try on your Ubuntu computer that wasn't working with MQTT. If nothing else it makes updating easier as you can just git pull, build a docker image, and stop / start a new container.



#15 pete_c

pete_c

    Cocoonut

  • -=Gold Supporter=-
  • 8978 posts
  • Location:House
  • Experience:average
  • Software:Main Lobby, Open Source Automation
  • Hardware:HAI OmniPro II, Mi Casa Verde Vera, Ocelot
  • Tech:X10-PLC, X10-RF, UPB, INSTEON, Z-Wave, ZigBee, 1-Wire, xAP, xPL, ALC
  • Audio:Russound
  • Video:MythTV
  • CCTV:analog, ip, dvr
  • Phone:Asterisk, FreePBX, Ooma, POTS, VoIP via ISP

Posted 18 October 2018 - 04:13 PM

Thanks Ryan...will do that...the larger computer is doing Ubuntu 18.04 / 16Gb of RAM and a couple of Windows Virtual boxes for some Microsoft stuff (like Kinect and Cortana and SAPI). Docker will not be any issue on it.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users