[RELEASE] Home Assistant Device Bridge (HADB)

The device is just a basic low voltage binary input sensor which gets triggered by a momentary switch. I'm using HA because I interface with the device through MQTT which is manually defined in the YAML config file. I'm not very familiar with HA so maybe you can help me out in how to define it in HA. The MQTT configuration for the sensor is not very different than a switch which has been working great with the HA Device Bridge. The difference I noticed in the configuration is only that the the switch has a command topic whereas the sensor only has a state topic.

I keep getting timeouts when searching for new devices.. I think this may be to do with the number of entities I have in HA.

Is it possible to add the device manually knowing the entity id? Or do I need to add via the app?

Sadly, I am also not that familiar with HA. :wink:

But where your declare your entity for this sensor, you should be able to assign it a device_class like opening and then it will just work with HADB.

I was wondering, why not integrate directly to Hubitat with one of the few MQTT app available instead of going through HA?

2 Likes

I tried looking but didn't find anything that worked. Hubitat can't host a MQTT server but does have the built-in capability to be a client, though no built in app to configure it. So I need HA just to host the Mosquito MQTT server, the question was just how to get devices into HE. I would have preferred a direct integration to MQTT but I didn't find any community supported app that worked. HA Device Bridge was super simple to setup and I didn't need to do any configuration to get the devices imported. (Getting the MQTT devices setup in HA was more difficult since these devices don't support auto discovery and needed to be defined in the configuration.yaml, all 118 of them.) If you know of something that would work for some simple dimmers, relays, and binary sensors please point me in the right direction.

FWIW, if you are unaware, there are several community-developed MQTT clients that work pretty well. Here are a couple:

1 Like

@aaiyar I looked at both of those. YAMA publishes local devices to MQTT. I'm looking to import and control MQTT devices in HE. I tried the app from xAPPO and I couldn't get it to work with my MQTT devices. I tried enabling statestream so the devices could be discovered but it didn't work. And I was not about to create 118 devices manually.

If you’re talking about 118 devices, I can see the dilemma. If you’re talking only a few binary devices, then I would simply use the HE > HA integration from @jason0x43 to expose virtual switches to HA, and then create very simple automations in HA that change the state of the virtual switch when the device state changes. I use this method when a device’s state is not supported by Home Assistant Device Bridge.

1 Like

I did something similar. I exposed the devices I wanted to control to HA and programmed the automation in HA. This way should cut down a bit on the latency which is a bit too long already for my application.

@SmartHomePrimer - I’m having an issue refreshing the device list using the app - it typically times out. I suspect its to do with the number of entities I have in HA.

You mention that the app is optional - how would I go about adding a HA device without the app?

Thanks in advance!

You only need the app if you want to ignore some devices and only let the ones you select pass through. If you don't install the app, the parent driver passes everything through.

The problem is that once your start using the app, you have to keep using it. I should probably add an option to ignore the filtering settings OR to add a new device directly by ID like you suggested.

Which improvement out of those two would be more useful to you?

1 Like

One more question -- when you say that it typically times out, do you mean intermittent or always? Seems like an HA issue, regardless. It should always work. We could also try extending the timeout in that HADB app as a workaround.

Funny I used to do it this way when I was testing the initial version. There is still a remnant of it in the code as a comment out command.

I guess removing both instance of the app and driver and install anew would do the trick

1 Like

Yes, that would do it for sure. But you would have to migrate any usages of the child devices in RM or other apps (since they would be recreated), so if we could migrate them instead I think that would be preferable to a user.

Having the option to go from one way to the other would be a nice addition. As for the adding by device ID, how usefull would that be if the timeout is cause by a large number of devices?

I agree with you. I think the disable filtering option in the app would be most useful (and easier to implement).

Definitely would be great to just manually provide the entity id I want to add. I find scrolling through a long list of entities can take a while to locate the one I want to select and bring in to HA anyway. It’s not really practical for larger set ups.

I noticed that when scanning for new devices the circular busy animation runs in the top right hand corner - but it never progresses. Sometimes I let this run for a few minutes and then refresh the page and have added an option to skip the scanning for new devices - I select this and its picked up the new entry - sometimes it takes a few attempts of this. I’m convinced its something to do with the number of entities ~1410

Typically my use case is I just want to bring in a single new entity and I know what this entity id is - being able to just specify this would be a great addition.

Also, perhaps some way to limit the scanning for new entities in some way eg.g by name or type may help.

This integration with HA has been hugely beneficial for me - thanks for the work on this!

1 Like

I don’t recall your username but there have been a few.. did you. contact me re this issue? What version number did you try ? Statestream is pretty dependable for normal type devices.

In beta 3e there is a new feature for HA style protocol discovery into HE and there is now an add on available in HA that populates the MQTT discovery topic for most internal HA devices. That isn’t written by me btw. So theoretically this bit can be accomplished two different ways now and without manually creating 118 devices. Should work OK for the more common device types.

If you are only using MQTT to facilitate this device linkage with HA one of the other solutions would be the easier way to go. Due to a multitude of family issues my support availability is rather limited for the foreseeable future

Hi @kevin, I did contact you about the getting the 3e beta and that is the version I tried. I tried the other HA discovery as well and I couldn't get it to work. It probably is a problem on my end. The devices I have don't support MQTT auto discovery and are defined in the config file manually using the template schema. They only show up in HA as entities not devices (another struggle I'm having).

What is this add on that you are referring to that populates MQTT discovery with internal devices? Would the discovered devices have their original MQTT topic or a new topic that is bridged to the real device topic?

If you can’t get something working do chat with me - that is what the beta 3e release is hoping to help with. This should work fine so PM me if needed on any 3e issues.

The integration in HA that publishes discovery topics that beta 3e should be able to discover is here. Please note I can only discover the devices that this plugin publishes. Others would have to use the original statestream import.