[RELEASE] Home Assistant Device Bridge (HADB)

@ymerj, finally got around to testing this for you (er, for us?). I assume it's a driver not an app, correct? Either way, I get an error when I try to save it:

expecting '(', found 'speed' @ line 227, column 20.

Sorry not a dev, so not sure how to proceed. But I'm totally willing to be your beta wonk.

Turns out my water heater on HA uses climate and sensor entities, so HADB was able to successfully pass these entities to HE as a thermostat device. Thrilled. I was surprised, however, that the thermostat mode didn't come through to the device. For now I'm using a helper to fake it. I've read your many references in this thread to the challenges associated with thermostats, so no judgment intended. I'm actually wondering if I somehow screwed it up -- any thoughts as to why mode wouldn't be part of the thermostat device in HE when the setpoint exists in HA? Or maybe this relates to the version of the code you asked me to take for a spin?

Thanks for your willingness to test.

At the time, that link was for testing the thermostat fan modes. Since then, this was fixed in version 2.5. We are currently at version 2.6 .

Now the link refer to the development version to support event entity and for fan not reporting percentage. Anyway you catched an oversight which is fixed now.

I would need to see some logs to check on that. You can PM them to me if you want.

1 Like

Happy to share them, but I think I figured it out. My modes (because it's a water heater) are things like Off, Eco Mode, Heat Pump, etc. rather than typical HVAC modes. I assume there is no concept of setting or activating supportedThermostatModes through HADB, correct?

If so, I'll workaround with helpers.

It kind of does... but only the ones supported by Hubitat (["auto", "off", "heat", "emergency heat", "cool"])

That explains it. Thanks

If you want to try the latest modified development version, it let modes through as is.

Same link as the one you tried yesterday.

2 Likes

I tried it and I can verify it does work. At least technically. Note caveat (*) at the bottom of this note.

For my use-case, however, it doesn't work pragmatically. It seems that the way a water heater thermostat is implemented in HA is that the thermostat mode is just [Auto, Off] and then there is a different concept of a Preset that is where the real modes are defined. I'm using Maker API and HE-based actuators to do what I want, but it's not bidirectional -- it works, just not as elegant as HADB.

This picture should help:


  • caveat about the thermostat handling: in HA, the supported thermostat modes are Auto and Off; that's it. From Hubitat, I can see and control Auto and Off just fine. But I can also see and select Heat, Emergency Heat, and Cool as modes that don't exist in this entity in HA. FWIW in case it matters to you. No biggie to me.

These are internally added by the Hubitat thermostat capability and cannot be modify. All thermostat in hubitat show these modes regardless of them being present or not.

As for the presets, it might be possible to add them. I would need to see a log output from your device to make sure.

Appreciate that. Do you mean log output from the HA device, or the log outpout from HADB when I try to add it to HE?

Enable debug loging on HADB, then change the water heater mode (preset). Post or PM me the relevant logs.

PM'd you

I just set this up yesterday (got some blinds that integrate with home assistant but not Hubitat, and don't know enough about programming to write an app/driver, but they were nice enough to send all sorts of information If I wanted/could write one) . If anyone cares to try and tackle this let me know and I'll gladly forward the information Fenetex sent me on their P-Box (DD7006 B Connector bridge which is used by a bunch of brands each with their own branding)

my issue is I can see the 2 blinds in Hubitat and they get status updates from home assistant but I am unable to control them from Hubitat. I am able to control them from Home assistant or from their direct app (the app is called connector and it's integration in Home Assistant is though Motionblinds). I have looked through the logs and I am not seeing where commands are being sent, Below is the log I clicked close at the bottom is where it gets the status from home assistant (showing that it's at least partially communicating) Any Ideas on insight would be appreciated. Is it possible I miss something when setting this up or is there another component needed to control the devices?

Log

2024-07-26 09:13:01.688 AMinfoLeft screen is online

dev:47002024-07-26 09:13:01.686 AMinfoLeft screen tilt was set to unknown [physical]

dev:47002024-07-26 09:13:01.684 AMinfoLeft screen position was set to 100 [physical]

dev:47002024-07-26 09:13:01.682 AMinfoLeft screen was turned open [physical]

dev:47002024-07-26 09:12:56.618 AMinfoLeft screen is online

dev:47002024-07-26 09:12:56.616 AMinfoLeft screen tilt was set to unknown [physical]

dev:47002024-07-26 09:12:56.614 AMinfoLeft screen position was set to 95 [physical]

dev:47002024-07-26 09:12:56.612 AMinfoLeft screen was turned open [physical]

dev:47002024-07-26 09:12:29.025 AMwarndescription logging is: true

dev:47002024-07-26 09:12:29.024 AMinfoUpdated...

dev:47002024-07-26 09:11:50.812 AMinfoLeft screen position was set to 83 [physical]

dev:47002024-07-26 09:08:55.334 AMinfoLeft screen is online

dev:47002024-07-26 09:08:55.332 AMinfoLeft screen tilt was set to unknown [physical]

dev:47002024-07-26 09:08:55.330 AMinfoLeft screen position was set to 100 [physical]

dev:47002024-07-26 09:08:55.328 AMinfoLeft screen was turned open [physical]

dev:47002024-07-26 09:08:38.031 AMinfoLeft screen is online

dev:47002024-07-26 09:08:38.026 AMinfoLeft screen tilt was set to unknown [physical]

dev:47002024-07-26 09:08:38.022 AMinfoLeft screen position was set to 82 [physical]

dev:47002024-07-26 09:08:38.015 AMinfoLeft screen was turned open [physical]

dev:47002024-07-26 09:08:32.949 AMinfoLeft screen is online

dev:47002024-07-26 09:08:32.947 AMinfoLeft screen tilt was set to unknown [physical]

dev:47002024-07-26 09:08:32.945 AMinfoLeft screen position was set to 83 [physical]

dev:47002024-07-26 09:08:32.943 AMinfoLeft screen was turned open [physical]

dev:47002024-07-26 09:07:11.994 AMinfoLeft screen is online

dev:47002024-07-26 09:07:11.992 AMinfoLeft screen tilt was set to unknown [physical]

dev:47002024-07-26 09:07:11.990 AMinfoLeft screen position was set to 100 [physical]

dev:47002024-07-26 09:07:11.988 AMinfoLeft screen was turned open [physical]

dev:47002024-07-26 09:06:26.121 AMinfoLeft screen is offline

Enable debug loging on HADB, then change the blind position in HA and in HE. Post or PM me the relevant HADB logs (not the blind logs).

Lets try this one *Edited to add the log from activating from Home assistant)

log

dev:46992024-07-26 10:42:11.748 AMdebugparse: domain: cover, device_class: shutter, entity: cover.rollershutter_0001, newVals: [open], friendly: Left screen

dev:46992024-07-26 10:42:11.740 AMdebugparse(): description = {"id":1,"type":"event","event":{"variables":{"trigger":{"id":"0","idx":"0","alias":null,"platform":"state","entity_id":"cover.rollershutter_0001","from_state":{"entity_id":"cover.rollershutter_0001","state":"open","attributes":{"current_position":89,"device_class":"shutter","friendly_name":"Left screen","supported_features":15},"last_changed":"2024-07-26T13:07:12.682090+00:00","last_reported":"2024-07-26T14:42:07.458829+00:00","last_updated":"2024-07-26T14:42:07.458829+00:00","context":{"id":"01J3QQVWZ24E1TZB6EBB2G18H6","parent_id":null,"user_id":null}},"to_state":{"entity_id":"cover.rollershutter_0001","state":"open","attributes":{"current_position":100,"device_class":"shutter","friendly_name":"Left screen","supported_features":15},"last_changed":"2024-07-26T13:07:12.682090+00:00","last_reported":"2024-07-26T14:42:12.552189+00:00","last_updated":"2024-07-26T14:42:12.552189+00:00","context":{"id":"01J3QQW1Y8KPW9RKC517249SHR","parent_id":null,"user_id":null}},"for":null,"attribute":null,"description":"state of cover.rollershutter_0001"}},"context":{"id":"01J3QQW1Y8KPW9RKC517249SHR","parent_id":null,"user_id":null}}}

dev:46992024-07-26 10:42:06.698 AMdebugparse: domain: cover, device_class: shutter, entity: cover.rollershutter_0001, newVals: [open], friendly: Left screen

dev:46992024-07-26 10:42:06.647 AMdebugparse(): description = {"id":1,"type":"event","event":{"variables":{"trigger":{"id":"0","idx":"0","alias":null,"platform":"state","entity_id":"cover.rollershutter_0001","from_state":{"entity_id":"cover.rollershutter_0001","state":"open","attributes":{"current_position":69,"device_class":"shutter","friendly_name":"Left screen","supported_features":15},"last_changed":"2024-07-26T13:07:12.682090+00:00","last_reported":"2024-07-26T14:28:56.709029+00:00","last_updated":"2024-07-26T14:28:56.709029+00:00","context":{"id":"01J3QQ3RR55B3ZKWFWHPJ6A65A","parent_id":null,"user_id":null}},"to_state":{"entity_id":"cover.rollershutter_0001","state":"open","attributes":{"current_position":89,"device_class":"shutter","friendly_name":"Left screen","supported_features":15},"last_changed":"2024-07-26T13:07:12.682090+00:00","last_reported":"2024-07-26T14:42:07.458829+00:00","last_updated":"2024-07-26T14:42:07.458829+00:00","context":{"id":"01J3QQVWZ24E1TZB6EBB2G18H6","parent_id":null,"user_id":null}},"for":null,"attribute":null,"description":"state of cover.rollershutter_0001"}},"context":{"id":"01J3QQVWZ24E1TZB6EBB2G18H6","parent_id":null,"user_id":null}}}

dev:46992024-07-26 10:38:59.923 AMdebugparse(): description = {"id":3,"type":"result","success":false,"error":{"code":"invalid_format","message":"Entity ID Left Screen is an invalid entity ID for dictionary value @ data['entity_id']"}}

dev:46992024-07-26 10:38:59.810 AMdebugmessUpd = {"id":3,"type":"call_service","domain":"homeassistant","service":"update_entity","service_data":{"entity_id":"Left Screen"}}

dev:46992024-07-26 10:38:59.808 AMinforeceived refresh request from Left screen

dev:46992024-07-26 10:38:11.615 AMdebugparse(): description = {"id":2,"type":"result","success":false,"error":{"code":"home_assistant_error","message":"Service left screen.open_cover called service Left Screen.open_cover which was not found.","translation_key":"child_service_not_found","translation_placeholders":{"domain":"left screen","service":"open_cover","child_domain":"Left Screen","child_service":"open_cover"},"translation_domain":"websocket_api"}}

dev:46992024-07-26 10:38:11.567 AMdebugmessUpdStr = {"id":2,"type":"call_service","domain":"Left Screen","service":"open_cover","service_data":{"entity_id":"Left Screen"}}

dev:46992024-07-26 10:38:11.564 AMinforeceived open request from Left screen

dev:46992024-07-26 10:38:02.164 AMdebugparse(): description = {"id":1,"type":"result","success":true,"result":null}

dev:46992024-07-26 10:38:02.159 AMdebugparse(): description = {"type":"auth_ok","ha_version":"2024.7.3"}

dev:46992024-07-26 10:38:02.152 AMdebugparse(): description = {"type":"auth_required","ha_version":"2024.7.3"}

dev:46992024-07-26 10:38:01.141 AMinfowebsocket is open

dev:46992024-07-26 10:38:01.140 AMdebugwebSocket status: open

dev:46992024-07-26 10:38:01.077 AMdebugwebSocket status: closing

dev:46992024-07-26 10:38:00.928 AMdebugClosing connection...

dev:46992024-07-26 10:38:00.927 AMinfoinitializing...

dev:46992024-07-26 10:38:00.892 AMwarndescription logging is: true

dev:46992024-07-26 10:38:00.891 AMwarndebug logging is: true

dev:46992024-07-26 10:38:00.890 AMinfoupdated...

dev:46992024-07-26 10:38:00.249 AMdebugparse(): description = {"id":1,"type":"result","success":true,"result":null}

dev:46992024-07-26 10:38:00.239 AMdebugparse(): description = {"type":"auth_ok","ha_version":"2024.7.3"}

dev:46992024-07-26 10:38:00.230 AMdebugparse(): description = {"type":"auth_required","ha_version":"2024.7.3"}

dev:46992024-07-26 10:37:59.217 AMinfowebsocket is open

dev:46992024-07-26 10:37:59.216 AMdebugwebSocket status: open

dev:46992024-07-26 10:37:59.142 AMdebugwebSocket status: closing

dev:46992024-07-26 10:37:58.994 AMdebugClosing connection...

dev:46992024-07-26 10:37:58.993 AMinfoinitializing...

dev:46992024-07-26 10:37:58.954 AMwarndescription logging is: true

dev:46992024-07-26 10:37:58.953 AMwarndebug logging is: true

I believe I may have figured it out, I changed the device name instead of the Device Label in Hubitat and that seems to be working now

2 Likes

Hi all. I'm not able to "discover and select devices" anymore from HADB app's page. It just spins the green hubitat circle in the hubitat page and nothing ever happens.

Log says:

Then I refresh app's page and it says:

And after that one more error line:

App version is 2.6:

  • Version Control:
    .
    .
    ..
  • 2.3 2024-03-26 Yves Mercier Add support for buttons
  • 2.5 2024-05-08 Yves Mercier Add support for valves
    *** 2.6 2024-05-31 Yves Mercier Add support for humidifier**
    */

I'm unable to reproduce.

Perhaps your App code was corrupted somehow. Try to do a repair.

1 Like

Removed app and installed it again. Now I'm able to discover devices.
My original problem did not yet disappear though.

Why do I get these log lines:
image

"Websocket error, reconnecting". ?

HA is connected to LAN and connection is steady. There is no packet loss and running ping all day long shows:

According to these logs, it looks like after a few failed attempt the driver was able to connect and stay connected for 2+ hours until it was manually updated.

Yeah it did that daily until yesteday when I removed app and installed it again. Something was bad and now it seems to be working normally.