[RELEASE] Home Assistant Device Bridge (HADB)

Thanks for the link - I missed that in my search.

I'm somewhat anti-cloud in general and only (rarely) use Alexa as an ancillary control system.

Interestingly Sengled bulbs paired directly with HE work as expected via Alexa, and CT does actually work through the component driver property page so it seems like it might be a driver/alexa interaction - my bet is Alexa not supplying the additional info.

Will see about the logs..

Thank you very much for a very good app/driver.. I recently got into HA, since I got emporia energy home monitoring and flashed it to work with ESPHome.. and used this to move that data into Hubitat for doing automations and notifications etc..

after having it run for a few weeks now.. it is working great, except for couple of things
(1) I am getting my HE hub being loaded upto 55-60% ( it used to be 5-8%) loaded prior to HADB
(2) Getting the following errors
[dev:2887] (http://192.168.xxx.xxx/logs#) 2022-10-19 11:08:38.483 AM error com.hubitat.app.exception.LimitExceededException: Device 2887 generates excessive hub load on line 152 (method webSocketStatus)

[dev:2887] (http://192.168.xxx.xxx/logs#) 2022-10-19 11:08:33.469 AM errorcom.hubitat.app.exception.LimitExceededException: Device 2887 generates excessive hub load on line 143 (method webSocketStatus)

@SmartHomePrimer Would it be possible to take a look to see if anything can be done to resolve these excessive loading issues ?
Thanks

Looks like your instance of HADB is constantly closing and opening the connection with HA. That should not be happening. Can you turn on logging and show us the result?

This was working for a few weeks, but recently, it gave issues. It started when the list for devices in the app was empty. The existing devices would also not receive events, but the controls still worked. In an effort to fix this, I uninstalled the app, first removing the child devices through the app. Rebooted HE & HA. It didnt help. Now devices wont show up. Some error logs:

This was of the app

This was of the hadb device, & it clearly was receiving some events from HA.

PS: I am running hubitat firmware 2.3.3.135 and HA supervised 2022.10.4

Hello I was trying to do a Swap Apps Device in Hubitat settings but unfortunately it looks like HADB devices are not available for swap. I do see other web socket devices like Logitech Harmony are available in the drop down so I was wondering if HADB devices can also be supported for this feature.

This would allow me to quickly update my HE apps and automations with devices I've brought in from Home Assistant. Thanks!

@alexcapone Unfortunately, HADB uses an app AND chid devices, both of which hubitat system does not support for such a move. Unfortunately, the dev can do nothing about this without changing the entire code & starting from scratch. You fould do what I do, which is create a virtual switch, move the automations there manually, and use Switch Bindings (more reliable than built in mirror me) to connect the 2 switches. Swapping devices is as easy as changing this one mirror me rule.

1 Like

The error seems to point towards a problem on HA side. Since it occurs in the app, @tomw may have a better idea of what might be happening.

1 Like

Do you intend to filter down from the devices in HA and only allow a subset to pass through and be handled in HE? If so, you don't need the app at all. You can just create the parent device manually yourself.

It looks like some comms error between the HADB app and HA for some reason. I find it odd that this ever worked and now is failing. Did you change anything else in the meantime on HE, HA, or your network setup (IP addresses and that sort of thing)?

In the app there is an advanced configuration options page. Go there and de-select the option that is labeled Only pass through user-selected and manually-added entities?. Do the child devices start to be created and updated again?

1 Like

Hmm, thats interesting.
@tomw
Previously, I tried adding some entities manually via the selector, then changing their state in HA. Didnt work. I do not want all devices to come into hubitat, only a select few. When i disabled the setting to only pass through user-selected devices, some frequently-updated temp sensors immediately showed up, along with some switches that I turned on or off. Then, I turned the only pass through switch back on, added the devices I wanted to use manually to the entity list (the drop down still didn't work), and after turning on/off the devices, it showed up!

Well, I'm glad it is working, though it is still curious why the query that populates the drop down isn't working. I'll keep an eye on it to see if anyone else runs in to the same issue. Thanks for the update and detailed testing notes.

1 Like

Hello,
Sorry for the late reply.. got busy with other things.. anyways.. Luckily, since this was just starting point for me.. I wasn't using the devices in any of the apps/RMs etc.. so rather than having anyone waste any time for troubleshooting...for now I uninstalled the HADB app.. and re-installed..
Will test it again for a few days.. and if the high loading starts happening again.. will post the debug logs.
Thanks

Hello,
just for kicks, I turned the debug logging to ON, But now it is NOT turning OFF !
another thing that I observed is that during the debug logging.. even the devices that I had not selected, I was getting a literally a ton of messages like this one
**
[dev:2959] (http://192.168.xxx.xxx/logs#) 2022-10-22 09:01:55.278 PMdebugparse(): description = {"id":1,"type":"event","event":{"event_type":"state_changed"," "

**
looking at it closely.. I realized that.. I have added emporia energy integration in HA... where emporia energy sends all these electricity measurements to HA..
and all those are showing up in hubitat hub.. for parsing...
is that expected behaviour.. if yes, then it might be that HADB will bog down my hubitat trying to keep up with the parsing of literally thousands of data per second...

I dont know ... is it possible to "subscribe" to only the events related to the selected devices ?
or maybe filter those out on HA side ? I am just throwing it out there ..

Since my HA-hub has lots of devices, but I only need maybe 40 of those devices to send info to hubitat.. all the rest I dont care in hubitat...

Thanks for your help

The way HADB works is that it subscribes to HA event stream. Meaning ALL events occurring in HA are sent to HE regardless of what is being selected in the app. The app just flag witch ones are ignored and witch are going to be processed.

I'm not familiar with Emporia but does it really has to send thousands of data per second?

4 Likes

HADB is intended for those who wants to use HE as their main system and supplement it with a few services imported from HA. Keeping in mind the Emporia load, if you are still set on importing these 40 devices into HE, I would look into putting them on a secondary instance of HA (witch can be linked to your primary one) and would only report event from said devices.

2 Likes

Hello,
I was looking at the HA event stream docs..
Here

And there are two functions

async_track_state_change Track specific state changes
async_track_state_change_event Track specific state change events indexed by entity_id

Would it be possible for you to take a look at those docs and functions?..

The second one seems extremely promising..
In that, once a limited set of list of specific Entities that have been selected in HE ..are the ones whose state change is tracked .. then it would work perfectly.. and it would also reduce the parsing/processing that needs to be done on HE considerably.. ( especially if the selected entities percentage is small compared to total entities).

i have not taken a look at your code in terms of which functions are used... If i get time.. i will also take a look ..But, it would take me a while to understand it.. i would highly appreciate it..if you could.. thank you!!

This is related to integration to be developed on HA side. HADB does not rely on any integration installed on that platform. It would require the developement of new programs on two distinct platforms.

1 Like

I agree with @ymerj. HADB already subscribes to the minimal set of events to get updates from HA.

What you really need is a way for the HA integration for your device to send less events. That is a request/question for that integration developer, not something that HADB can help with unfortunately.

2 Likes

Ah.. I see..
Thanks for such a quick response..

obviously you guys are way more knowledgeable than me in this topic....
but it feels that subscribing to the event bus for all state changes, sends more events than needed.

so I am just throwing this out there...something I found

Under Entities Heading

"You can subscribe to the entities of Home Assistant. Your callback will be called when the entities are first loaded and on every change to the state of any of the entities after that. The callback will be called with a single object that contains the entities keyed by entity_id."

Thanks again for all your help.

HADB aims at being a user friendly integration so, therefore avoid the usage of man-in-the-middle that require extensive configuration and possibly an external device to run on to.

HADB try to be a solution for as many as possible but cannot answer all particular situations. I think you should look at other solutions or workarounds. We gave you alternative path to follow. Maybe going the MQTT route would be more appropriate in your case.

1 Like

yes, I understand..
thanks for our explanations. I agree, this app might not be a proper use case for me
thanks again