OmniLinkBridge to integrate Home Assistant, SmartThings, Node-RED

pete_c

Guru
Here created a test output, updated and reconfigured the OmniLinkBridge via the HA GUI.
Note in HA instead of an INI file it is using a yaml file.
 
1 - in PCA created a test general output and labeled it test.
2 - in HA reconfigured the OmniLinkBridge - Rebuild
3 - in HA checked the configuration.
 
I do see an error in the loading of the HA OmniLinkBridge:
 
Add-on: OmniLink Bridge
MQTT bridge, web service API, time sync, and logging for HAI/Leviton OmniPro II controllers
-----------------------------------------------------------
Add-on version: 1.1.10
You are running the latest version of this add-on.
parse error: Expected string key before ':' at line 1, column 4
[08:36:56] ERROR: Unknown HTTP error occured
System: (amd64 / qemux86-64)
Home Assistant Core: 2021.7.4


OK it worked. Looked at all of the OmniBridgeMQTT stuff and found my test output button.
Created a toggle button using the HASS:power button in a single card.

Tested it looking at PCA / Status. It works fine.
 

pete_c

Guru
Here is the test toggle button.  You toggle it once to turn it on and toggle again to turn it off.  You can watch the status via PCA.

Been tinkering here with connecting ESP01 modded with Tasmota triggered by output then turn on or off MQTT/Tasmota switches. (here on have X10, UPB, Zigbee and ZWave controllers connected to the OmniPro 2 panel and want to test controller Tasmota switches with the panel)
 
PCA Output configuration:
 
[sharedmedia=gallery:images:1479]

PCA Output status:

[sharedmedia=gallery:images:1478]
 
HA Test output button - working fine.
 
[sharedmedia=gallery:images:1477]

Here also testing the Ring alarm system (all cloud) managed via MQTT and it works great and prefer to use HA to manage it rather than my smart phone.
 

ihf

Active Member
Thank you! I finally figured out (just now) that some of my outputs seem to look like lights and some are switches. Not sure what determines how they are categorized since they are all relay outputs but I have it working now.
 

pete_c

Guru
Great news!!!!
 
Here use one output (2) to toggle my garage door opener...it is massaged though as today it is digital...so I purchased a tiny digital button and wired it to work with a toggle switch (OmniPro output)....output is not directly connected to the button ...
 

pete_c

Guru
Just an FYI here if you do not want to deal with HA / MQTT...Homeseer Rob has written an OmniPro 2 plugin which works really nicely in Homeseer running in Windows or Ubuntu.  The GUI is the same.
 

OMNI for HS3 (rmasonjr)
 
The old Homeseer Omni Plugin used a serial connection.  The new one uses an ethernet connection.
 
The plugin does not do MQTT but there is an MQTT plugin now for Homeseer so you can use it.
 

rsw686

Active Member
For those interested below is the config I use for controlling the garage doors with an OmniPro 2. It requires a zone, output, button, and automation rule. By not setting the output name, it won't be discovered by Home Assistant. The button is then used to momentarily turn the output on. In Home Assistant you then combine these into a switch or cover.
 
PC Access
 
Zone: Name: Overhead Left, Zone Type: Entry/Exit
Output:  Description: Garage Opener Left
Button: Name: Garage Left

WHEN Garage Left
THEN Garage Opener Left ON FOR 1 SECOND

OmniLinkBridge.ini

mqtt_discovery_override_zone = id=5;device_class=garage_door
Home Assistant configuration.yaml

cover:
- platform: template
covers:
garage_overhead_left:
device_class: garage
friendly_name: Overhead Left
value_template: "{{ is_state('binary_sensor.overhead_left', 'on') }}"
open_cover:
service: switch.turn_on
entity_id: switch.garage_left
close_cover:
service: switch.turn_on
entity_id: switch.garage_left


Code:
switch:
  - platform: template
    switches:
      garage_overhead_left:
        friendly_name: Overhead Left
        value_template: "{{ is_state('binary_sensor.overhead_left', 'on') }}"
        icon_template: >
            {% if is_state('binary_sensor.overhead_left', 'on') %}
              mdi:garage-open
            {% else %}
              mdi:garage
            {% endif %}
        turn_on:
          service: switch.turn_on
          entity_id: switch.garage_left
        turn_off:
          service: switch.turn_on
          entity_id: switch.garage_left
 
 

tigers

Active Member
Hi, I had some problem with my OPII console yesterday (stuck in some system reset loop - a RAM cleanup from the installer setup seems to have fixed it, reloaded all my config with PC ACCESS to be sure, so I'm pretty sure the names in the OPII console are still the same).
Problem is that this messed up something with OmniLinkBridge and now I have SOME of the sensors with a duplicate entry in Home Assistant, with a trailing suffix "_2".
That is: I had a "switch.garage_A" listed as unavailable and a "switch.garage_A_2"
This completely messed up my configuration since all my customization to sensor icons, all my automations, etc. still refer to the old names.
What is the best way to start anything "from scratch" so I can have the old names back?
I thought of:
- stopping OmniLinkBridge;
- delete the MQTT integration in Home Assistant (so I get rid of all the names (new and old);
- stopping Home Assistant;
- deleting all the topics with MQTT Explorer;
- restating everything up again.
 
Is this correct or is there an easier way to do so?
 

grantlewis

Active Member
Yep, I've had this happen, too. For different reasons, but I know exactly what you're talking about. Proceed with the following steps c-a-r-e-f-u-l-l-y.
 
First create a Full Snapshot of your system. I'd suggest that you save a copy to another computer or to a cloud service, etc.
 
In the root of your Home Assistant server is a hidden folder named .storage. Open that folder, and then in it, open the file named core.entity_registry. Search that file for one of the entities ending in _2. Here's a faked example created for this post:

            {
                "entity_id": "binary_sensor.office_window_sensor_2",
                "config_entry_id": null,
                "device_id": null,
                "area_id": null,
                "unique_id": "77A573AF",
                "platform": "wyzesense",
                "name": "Office Window",
                "icon": null,
                "disabled_by": null,
                "capabilities": {},
                "supported_features": 0,
                "device_class": "door",
                "unit_of_measurement": null,
                "original_name": null,
                "original_icon": null
            },
            {
                "entity_id": "binary_sensor.office_window_sensor",
                "config_entry_id": null,
                "device_id": null,
                "area_id": null,
                "unique_id": "77A563F3",
                "platform": "wyzesense",
                "name": "Office Window",
                "icon": null,
                "disabled_by": null,
                "capabilities": {},
                "supported_features": 0,
                "device_class": "door",
                "unit_of_measurement": null,
                "original_name": null,
                "original_icon": null
            },
 

Notice how each entity is set off with an open brace and a close brace with a comma. (The final entity in the file won't have a comma after its closing brace.) As you edit, make sure you maintain the indentions, braces, etc.
 
In above example, the "new" entity, the one that actually works and that Home Assistant can control, has a _2 at the end of its name. The "old" (now non-working) entity, the one to which your automations refers, does not end in _2. So what you want to do is to delete the second entity entirely -- everything from its opening brace through and including the comma after its closing brace -- and then edit the "new" entity to give it the entity_id that the "old" one had. This should allow your existing automations to refer to the new, working entities.
 

            {
                "entity_id": "binary_sensor.office_window_sensor",
                "config_entry_id": null,
                "device_id": null,
                "area_id": null,
                "unique_id": "77A573AF",
                "platform": "wyzesense",
                "name": "Office Window",
                "icon": null,
                "disabled_by": null,
                "capabilities": {},
                "supported_features": 0,
                "device_class": "door",
                "unit_of_measurement": null,
                "original_name": null,
                "original_icon": null
            },
 
 
Repeat that process until you've removed all duplicated _2 entities. Save your file and reboot the HA server. If something goes horribly awry, restore your Snapshot and try again. If everything's OK, make a second Snapshot but hold on to the first one for a few days just in case you need to revert.
 
Others may have suggestions on how to remedy the problem, but this is what always works for me. Good luck!
 

rsw686

Active Member
tigers said:
Hi, I had some problem with my OPII console yesterday (stuck in some system reset loop - a RAM cleanup from the installer setup seems to have fixed it, reloaded all my config with PC ACCESS to be sure, so I'm pretty sure the names in the OPII console are still the same).
Problem is that this messed up something with OmniLinkBridge and now I have SOME of the sensors with a duplicate entry in Home Assistant, with a trailing suffix "_2".
That is: I had a "switch.garage_A" listed as unavailable and a "switch.garage_A_2"
This completely messed up my configuration since all my customization to sensor icons, all my automations, etc. still refer to the old names.
What is the best way to start anything "from scratch" so I can have the old names back?
I thought of:
- stopping OmniLinkBridge;
- delete the MQTT integration in Home Assistant (so I get rid of all the names (new and old);
- stopping Home Assistant;
- deleting all the topics with MQTT Explorer;
- restating everything up again.
 
Is this correct or is there an easier way to do so?
 
OmniLinkBridge overwrites all Home Assistant discovery information for all homeassistant/*/omnilink/* MQTT topics when started. Home Assistant needs to be restarted to cleanup any old devices it might have discovered from MQTT. Once those devices are gone the ones with the 2 suffix can be renamed using the Home Assistant UI under Configuration -> Devices -> omnilink, clicking on an entity, and changing the Entity Id.
 

abbachia

Member
has anybody dealt with the following issue?
 
Changing an "Area" for any one of the MQTT (AKA OmniLinkbridge) integrated devices changes all of the areas for all of the devices associated with that integration.  is there a way to split them to different areas?  can't seem to find anybody dealing with this issue
 

tigers

Active Member
I believe that's because the omnilink is the "device", with lots of entities associated. I don't think that this can be changed with the current Home Assistant setup, maybe this could be done if omnilinkbridge starts to present them to mqtt as different devices.
 

sjht

Active Member
I know this has been covered (been through this thread), but I think there are some changes with the HA interface and wouldn't mind some help.  I installed the OLB.  Configured to my OmniPro2.  It connects fine and starts pulling info, etc.  Next I installed the Mosquitto broker (MQTT), could someone take me from there to get at the specific units, etc. from my OP2?  Example, read to add a new user.  Where do you do that. Nothing called this, but you can add People?  :)  Then what to do after that?  Maybe someone who understands could consolidate startup info across many posts.  Thanks!  
 

pete_c

Guru
Good news @SJHart.
 
The integration to HA has changed a bit to become more plug n play.  Used to be an INI file adjustment and today it is just in the OmniLinkBridge configuration page in HA.
 
could someone take me from there to get at the specific units, etc. from my OP2?
 
You will see whatever you have configured or not configured in the ini / yaml file.   IE: a zone that changes when connected to a contact switch or PIR.  Light switches that you can turn on and off.  Enabling the alarm or disabling the alarm.  
 
Example, read to add a new user.  Where do you do that. Nothing called this, but you can add People?   :)  
 
You cannot add users to the OmniPro panel with the OmniLinkBridge.
 
Then what to do after that?  Maybe someone who understands could consolidate startup info across many posts.  
 
Standard Home Assistant user can do anything with the OmniPro panel variables.  I use the variables to trigger Alexa TTS events.
 

sjht

Active Member
Thanks for the start!  So, don't need Mosquito Broker anymore?  Just OLB?  It is connecting fine and shows lots of activity in the Log (Temp changes, motion detectors, etc.).  How do I get at a variable?  Maybe a simple example will get me going.  
 

pete_c

Guru
No.  The OmniBridgeLink application is dependent on running an MQTT broker.  Many of the additions to Home Assistant are dependent on MQTT.
 
Here is a snapshot picture of the garage variables.  I use these in a Home Assistant script to tell me when the exterior or interior garage door is open.
 
I do this already some in PCA automation scripts.  IE: when the garage door opens it turns on the garage interior lighting for 10 minutes and announces inside that the garage door is open.
 
Read about using Home Assistant.  The HA core functions the same for any plugin.
 
[sharedmedia=gallery:images:1511]
 
Top