[RELEASE] Home Assistant Device Bridge (HADB)

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.

Gentlemen,

Let’s please try to keep the conversation on topic. There are plenty of MQTT threads where you’ll probably get more like-minded folks engaged.

Thank you.

5 Likes

Hi all, I have been using Home Assistant Device Bridge to bring the devices from Lutron (and from other SH devices) to HE (no Lutron Pro bridge at the moment). I was able to get all the devices except Lutron Casetta Fan Control.
I have enabled debug log for Home Assistant Device Bridge (App) and Driver. I see following error in HE logs when the fan control state changes in Home Assistant.

dev:742022-06-22 02:21:06.498 pm errorParsing error: java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object

dev:742022-06-22 02:21:01.353 pm errorParsing error: java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object

Any help please?

Is there a print earlier than that which shows the raw message? It should start with parse: domain: ...

Hi @tomw, I tried multiple times, it only creates the following entry each time when the switch is flipped:

dev:742022-06-23 09:35:42.084 am errorParsing error: java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object

dev:742022-06-23 09:35:34.828 am errorParsing error: java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object

dev:742022-06-23 09:35:33.660 am errorParsing error: java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object

dev:742022-06-23 09:35:32.285 am errorParsing error: java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object

dev:742022-06-23 09:33:45.199 am errorParsing error: java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object

dev:742022-06-23 09:33:39.751 am errorParsing error: java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object

Which device is dev:74? On that device, you need to update the setting called "Enable debug logging" and Save Device. There should be multiple debug prints prior to it failing at toLowerCase().

Got it, I had debug enabled in Home Assistant Device App, not on the device it looks. Here are the parse messages:

dev:742022-06-23 10:03:52.168 am errorParsing error: java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object
dev:742022-06-23 10:03:52.165 am debugparse: domain: fan, device_class: null, entity: fan.master_bedroom_ceiling_fan, newVals: [off], friendly: Master Bedroom Ceiling Fan
dev:742022-06-23 10:03:52.162 am debugparse(): description = {"id":1,"type":"event","event":{"event_type":"state_changed","data":{"entity_id":"fan.master_bedroom_ceiling_fan","old_state":{"entity_id":"fan.master_bedroom_ceiling_fan","state":"on","attributes":{"preset_modes":null,"percentage":50,"percentage_step":25.0,"preset_mode":null,"device_id":"31","zone_id":"18","friendly_name":"Master Bedroom Ceiling Fan","supported_features":1},"last_changed":"2022-06-23T14:03:51.503460+00:00","last_updated":"2022-06-23T14:03:51.503460+00:00","context":{"id":"01G68E0PRCX6ZMXDFDACY496JN","parent_id":null,"user_id":"caffe4c8a1074391bf13f9d05445d2e0"}},"new_state":{"entity_id":"fan.master_bedroom_ceiling_fan","state":"off","attributes":{"preset_modes":null,"percentage":0,"percentage_step":25.0,"preset_mode":null,"device_id":"31","zone_id":"18","friendly_name":"Master Bedroom Ceiling Fan","supported_features":1},"last_changed":"2022-06-23T14:03:53.870919+00:00","last_updated":"2022-06-23T14:03:53.870919+00:00","context":{"id":"01G68E0S2HCG8GX2B51V3FA7DA","parent_id":null,"user_id":"caffe4c8a1074391bf13f9d05445d2e0"}}},"origin":"LOCAL","time_fired":"2022-06-23T14:03:53.870919+00:00","context":{"id":"01G68E0S2HCG8GX2B51V3FA7DA","parent_id":null,"user_id":"caffe4c8a1074391bf13f9d05445d2e0"}}}
dev:742022-06-23 10:03:49.816 am errorParsing error: java.lang.NullPointerException: Cannot invoke method toLowerCase() on null object
dev:742022-06-23 10:03:49.813 am debugparse: domain: fan, device_class: null, entity: fan.master_bedroom_ceiling_fan, newVals: [on], friendly: Master Bedroom Ceiling Fan
dev:742022-06-23 10:03:49.810 am debugparse(): description = {"id":1,"type":"event","event":{"event_type":"state_changed","data":{"entity_id":"fan.master_bedroom_ceiling_fan","old_state":{"entity_id":"fan.master_bedroom_ceiling_fan","state":"off","attributes":{"preset_modes":null,"percentage":0,"percentage_step":25.0,"preset_mode":null,"device_id":"31","zone_id":"18","friendly_name":"Master Bedroom Ceiling Fan","supported_features":1},"last_changed":"2022-06-23T13:58:15.990877+00:00","last_updated":"2022-06-23T13:58:15.990877+00:00","context":{"id":"01G68DPF3XJNG12J668BE9MVWX","parent_id":null,"user_id":"caffe4c8a1074391bf13f9d05445d2e0"}},"new_state":{"entity_id":"fan.master_bedroom_ceiling_fan","state":"on","attributes":{"preset_modes":null,"percentage":50,"percentage_step":25.0,"preset_mode":null,"device_id":"31","zone_id":"18","friendly_name":"Master Bedroom Ceiling Fan","supported_features":1},"last_changed":"2022-06-23T14:03:51.503460+00:00","last_updated":"2022-06-23T14:03:51.503460+00:00","context":{"id":"01G68E0PRCX6ZMXDFDACY496JN","parent_id":null,"user_id":"caffe4c8a1074391bf13f9d05445d2e0"}}},"origin":"LOCAL","time_fired":"2022-06-23T14:03:51.503460+00:00","context":{"id":"01G68E0PRCX6ZMXDFDACY496JN","parent_id":null,"user_id":"caffe4c8a1074391bf13f9d05445d2e0"}}}

I have added following line that resolved the issue. Not sure if this is efficient, will wait to hear from you. thnx!

if (response?.event?.data?.new_state?.attributes?.speed != null) def speed = response?.event?.data?.new_state?.attributes?.speed.toLowerCase()

Thanks! Here's a groovier way:

def speed = response?.event?.data?.new_state?.attributes?.speed?.toLowerCase()

Both versions end up putting a null value in for speed. Does your change cause anything else weird or bad to happen, either in settings for the device or in the attributes that show up?

2 Likes

Perfect! Thank you.

Everything is working as it should be with that change. Fan added under HA device bridge, fan controls (level, speed, switch) are reflecting the correct values when changed.

2 Likes

Perfect -- I'll include that change in the next version of the driver.

1 Like

I've just added several Aqara contact sensors to HA/ConbeeII via ZHA.

I can bring them into HE, but they only come in w/contact info, no battery status.

In HA:

In HE:

What do I need to do to get battery status included in HE? Ideally having battery status for each sensor on the same child device page that shows open/close status, if that's possible. Thanks.

Will you please send a log that shows how the info comes in from HA? Just enable logging on the parent device in HE.

I have typically seen the battery info come across as a separate entity, which will just work with HADB but will show up as a separate battery virtual device.