[RELEASE] Home Assistant Device Bridge (HADB)

Can you post a screenshot of the device entries and which ones you’re missing? What your intended use for them is, would also be helpful.

1 Like

Device entries, as in the logs of the parent device? Or you mean the device page when in home assistant (they have yet to be a device in hubitat)

Here are the device entities.

Plus the device page so the values are shown for each

Immediately I'm hoping for the status of roborock.vaccum.a27 so I can determine if it has docked (trigger) which is a string value unfortunately. potentially I look into how to crate a dummy variable (whatever they are called in home assistant) certain strings to a certain value of integer? And the other I am immediately interested in is "roborock.vacuum.a27 Last Clean Area" which is a integer

Sorry I forgot to mention what I hope to do. Every time the roborock status goes from cleaning to docked I want to add the value of the last clean to a variable. Then when that accumulative cleaning area is greater than 300 I'll send the vacuum to a location on the map which is near the bin. Also every Saturday send it to another location so I can put the mop on.

So I hope to use hubitat to determine the status change to docked, grab the last clean area and assign it to a hub variable. Then do the if statement in hubitat, which then changes the state of a hubitat switch, which triggers an automation in home assistant (which I have working with the hubutat integration in home assistant already) to run the script to send the vacuum to a point (a home assistant script I have working already).

I just prefered to do most in hubitat rather than in home assistant. I like rule machine in hubitat and would prefer to maintain hubitat and keep minimal in home assistant except where hubutat can't do it

Where hubitat can't do things is beinf able to control the roborock/xiaomi robot vacuum as I don't have the xiaomi mi connector or hub for hubitat to control the roborock itself... Although perhaps that's another option but my installation is home assistant operating system so I guess to use mi connector I'd need to change to a different operating system on my virtual machine)

Unfortunately you're not going to be able to get the values by these means. You might need to turn to Node-RED to do what you want. but I'm not the person to ask about Node-RED. Visit the Node-RED thread and you can get that answer. If you can make a simple automation in HA so when it's docked it flips a switch, then you could publish a virtual switch from HE, and when that is turned on by one HA automation, the vacuum is undocked. When docked, another HA automation turns the switch off.

You might want to get control of the vacuum from Home Assistant, since it sounds like you don't have it? That seems odd. The Roborock entity has no controls? Anyway, if you don't have control, the Xiaomi MIoT integration might give it to you, and then you could control it from Hubitat by publishing virtual switches to HA and mapping them with simple HA automations. No YAML needed.

If you're a HomeKit/Homebridge user by chance, there is an integration there too. So you could share virtual switches from HE to HomeKit via Homebridge and then map them with HomeKit automations. This is actually what I did for my Ecovacs Deebot since the Home Assistant 4 Deebot integration has never successfully authenticated from HA for me, for whatever reason.

Still, another possibility is Amazon Alexa. Since you're dealing with the cloud for the vacuum anyway, not that big a deal to have one more cloud hop. You can publish a virtual switch with simple code on Hubitat that will also be seen as motion and/or contact sensors by Alexa. So you turn on the switch on Hubitat, and that activates a virtual motion sensor on Alexa, triggering a routine that silently says whatever Roborock needs said to start cleaning. I use this for my Debot, since the Homebridge plugin for some reason works perfectly to specify a single room, but for the entire house, it doesn't work. :man_shrugging: So for that I use an Alexa routine triggered by a virtual motion sensor as a switch. Alternatively, you can do this with Echo Speaks v4 too.

Again, these are all suggestions around control, not importing the values from Last Clean, etc.

1 Like

@SmartHomePrimer thabks a lot for that informative post.

I've heard a few fans talk highly of Node Red.. Just haven't been tempted to look too much.. Hmm maybe it's time.

Sorry maybe I wasn't clear. Control of the roborock is working well. At the moment I use virtual buttons in hubitat to trigger home assistant automations to start the clean, return to rock and also go to certain locations. That part works well.

Originally I shied away as I thought I needed a xiaomi hub and a RPi.. Buy I have since seen that to control a roborock or xiaomi vacuum it's only the rpi part.. But now I'm running a vm with home assistant operating system.. So may need to consider a more typical Linux op system for that.

No I'm not a homekit user

I've set myself up with Google home rather than Alexa. I did look at Alexa instead for a more silent/ninja control before I went the home assistant path on vm, plus voice commands work fine with Google home.

Im after automation, rather than just control. For control I use the xiaomi app no problems, and for the trigger side it's google home, or the virtual button in hubitat to trigger home assistant.

I have started successfully to start vacuum when we leave the home and its been 2 days or longer since the last time hubitat asked it to run. Just would be nice to go further and use cleaned area to automate going to the bin (I am yet to jump at the 1k dock and get the auto emptying and mop cleaning dock for the s7 maxv), detect when the vacuum has been run outside hubitat (which is reflected in home assistant), detect when the mop is connected and automatically start a mop (again, I haven't got the auto cleaning mop dock so I'm still somewhat manual on this)...

So it seems that potentially I have node red, or create these other rules in home assistant itself as my main options to expand on my automations.

It really seems you’ve identified a case to stay in HA for this. It appears you’re making the whole thing much more complex and that will mean more error prone too by involving RM. Right tool for the job and such…

You could implement some control in RM that sets virtual flags/vars in HA that your main automation there reacts too.

3 Likes

In HA (after realising here it had challenges to handle in RM) I've implemented the when back to the dock, check the clean area and if greater than 50 square metres then switch a virtual switch (created in hubitat and synced through the maker api to home assistant) which then let's hubitat know its cleaned that day outside of rule machine.

So yes, I'm thinking that the accumulative cleaning area and mop detection is best done in home assistant now. Now the fun part of getting back into yaml code of which I haven't done much of.

And like I have done, and also suggested by a few of you, usage of switches is the link between the two at the moment...

2 Likes

Summary (warning ramble follows): Using templates in HA can convert the entities that weren't transferring over the hubitat, such as numerical entities changed to pressure sensors to bring them into hubitat using this tool.

Ok so after much confusion trying to work out yaml file editing in home assistant as automations and scripts etc can't do what I wanted... I realised the learning curve I had ahead of me to go back to basics and read a lot to understand before I jumped in..

I've now gone and done I said I wouldn't do = hypocrite and also likely a told you so moment when all this falls apart because I'm all over the place with multiple systems here... I do hear you all.. And will likely redo all this properly when it falls apart and I have more time to learn.. But it's working how I intend at the moment so that's a good start.

I stumbled across templates in home assistant and after only a few hours of frustration realising HA ain't as simple as RM to get my head around, I looked at converting a value of an entity for roborock vac into a pressure sensor in HA. Now hubitat sees the value as a pressure sensor, but it gives the resolution and range I need to monitor the last clean area so I don't care too much for the units. I'm sure I could use virtual devices in hubitat to change the unit.. But hey let's not get even more messy hey.

So I am monitoring for state changes of the vaccum in HA, and using Helpers of value 1 or 0 (I should look at boolean) to transfer the state change to hubitat which includes if the cleaner was started by the xiaomi app or the physical buttons. I'm dealing with the control of the roborock in HA, plus some basic automation which is mainly just changing the helpers that hubitat sees based on state changes of entities and status. And the new development that I am now converting entities that aren't included in the drivers that this home assistant device bridge uses, into pressure if they are numeric values as hubitat happily sees them...

I am using virtual switches/buttons in hubitat to trigger scripts in HA to start the cleaner, send to the dock etc. With the rules relating to "when to clean next" based on presence and days since last clean, all done in RM that changes the switch/button states. All using the maker api to HA with the hubitat integration.

I'd like to thank many people here for encourage me to think creatively to get this working for now. Also like to thank those that have also made me realise this is not the right way and that I should over time transition this all to the right tools rather than all over the place.

3 Likes

Clever solution. It's a Rube Goldberg machine after my own heart. I too have eaten my share of crow. Yes, your solution might be held together with rubber bands, but if they don't break, you will consistently get what you need. I know that some have trouble with HA and some have trouble with HE. Over the years I've learned what works consistently, what breaks occasionally (and most important, how to fix it easily), versus what is just inherently unstable and should be avoided.

For me, the way I use HA and HE, they are both very stable (this is in part due to developer efforts, and in part due to my own resolve to not introduce instability). I have had many teachers, hard lessons, and an occasionally disgruntled spouse. In the end, there is no more important lesson than to backup your work before and after you get things setup the way you need.

2 Likes

I rate how fast all this integration is between the two systems though. Both ways. Sensor value changes from HA to Hubitat are really fast, and Hubitat button presses to trigger HA automations are near instant.

4 Likes

Hi Guys,

My devices from HA are not showing up, and the dashboard can no longer find any authorised devices.

I have two Aqara curtain motors and an Aqara rocker switch that I have set up in HA. They appear and are selectable in the list of devices to import from HA in the list in the Homeassistant device bridge app. I noticed that if I changed the name of a device in HA, the name change was imediately visible in the list in Hubitat. So everything seems to be in place.
I read that the devices will not show up until they are activated in HA. So I went into HA and activated them by starting and stopping them and so on. But they didn't appear in Hubitat after that. So far none of the devices have showed up in Hubitat. Any suggestions?

A bonus. After installing the HA device bridge app and importing the devices (pressed done after selecting them), I created a new dashboard in Hubitat to accomodate buttons for the curtain motors to use when setting them up. I added a tile and noticed that no devices were available and that there is a red text stating 'No Devices Authorised'. It is a while since I did a dashboard but I haven't noticed this before and have had no trouble creating dashboardss before. Could this be related to the HA bridge device install?

All suggestions and ideas welcome

Cheers

Not all Home Assistant device/entity types are supported. See the first post for a liost of supported HA device/entity types. Please try something simply, like a switch or a dimmer and then see if those show up in Hubitat once they are toggled in HA.

If those work, then the issue is probably that this integration does not have support for the HA device/entity types you're trying to add.

2 Likes

Hi,

I think it should be supported.

Fair enough... Have you tried using HADB with just a simple on/off switch to see if that will work with your current configuration? Just trying to to see if we can identify exactly where the communications breakdown might be occurring.

2 Likes

Good point. I have one rocker switch (Aqara Wireless Remote Switch) among the three devices I have started with, which hasn't worked so far. But I will try some other device tomorrow and se if I can get any device to work. Thanks.

2 Likes

This is different from the HADB issue you're experiencing. In HE dashboards, you have to go into the dashboard app and select the devices to share (e.g. "Authorize") for use with the dashboard you create. See the Dashboard docs for help with this particular issue.

Keep in mind that devices must create entities in HA to be imported. Curtain is supported by "Generic Component Window Shade" in HE, but I don't know this is the same for that device. I don't own one of these. Perhaps @philtor can assist.

One way to get things working that are not directly supported by HADB is to instead trigger them via an HA automation by sharing a Hubitat Virtual Switch with HA. Set the virtual switch to turn off after 500ms. This is then configured in HA as the trigger for the HA automation, which then controls the device on HA. For this particular use case, you need to use the HE->HA integration created by @jason0x43.

[Edit] Just looked back at @philtor 's post and this is how he mentioned he is controlling his.

2 Likes

Interesting development this morning. The temperature sensor on the aqara curtain motor has presented it self in Hubitat and now appears as child devices to a HADB device. So maybe it is working? I would have assumed that the other functionality would have appeared after I used them in HA, but perhaps they just need further use to appear?

Skärmbild 2022-08-15 111348
Skärmbild 2022-08-15 111405

Did you install the Generic Component Window Shade?

If so, please read the Troubleshooting section in the first post so we can see if we can assist you.

3 Likes