Mira: Hubitat to SmartThings hub integration Edge driver

Great. And thank you!

thanks very much for this.
I started out many years ago with SmartThings, moved to hubitat at the start of 2021 but I kept my smartthings for a small number of features that are nicer and easier to use in SmartThings such as setting up schedules for sockets and lights. Schedules that I would be likely to modify regularly and using one of the rules apps in hubitat isn’t as nice.
Also the hubitat app isn’t as nice to use.

After Hub Link broke I wasn’t sure where to go next.
I installed this today and it worked out of the box. With this I’ll likely end up moving most if not all my devices to Hubitat now that I can still view the ones I want within SmartThings. And the nice thing about it is that it’s local. Although I’m wondering is using the SmartThings app always though the cloud or when I’m connected on the same wifi network will it work wihtout internet access?

During my short test I’ve been very happy, but I did find 2 limitations that are documented in the first post. Are there any plans to bring in power/energy monitoring for outlets?

I have sockets paired with smartthings and I automate things based on the power level. I’d like to connect them to hubitat and have the same automations controlled from smartthings. (I basically power down the outlet after the device has finished charging, so basically when a power level therhold is reached for a certain amount of time the outlet turns off).

Also any plans to support RGB bulbs? The mobile hubitat app only has on/off control, using the maker API I can set the RGB colours. I think the smartThings RGB control would be very nice to use. I seem to recall using it a few years ago and it was very intuitive

The Smartthings app is always through the cloud. They didn’t have to build it that way, but they did.


Thanks very much for the fast answer. I see your name all over the forums always being helpful so thank you very much


Also, we’ve just been discussing a similar use case in a different thread, a situation where a smart plug doesn’t report power levels through its integration to Smartthings, but does report them through Tuya smartlife or Apple HomeKit.

One option when you want a ST routine to be triggered by a threshold, as you described, is to use another device, even a virtual switch, as a proxy for reaching that threshold. So maybe you have hubitat turn on a virtual switch whenever the threshold is reached, and then you have smartthings react to that virtual switch coming on. Or you could even use a physical proxy device which is recognized by both platforms if that’s easier.

I’m not sure that approach works with this specific project, but it’s a workaround that might help one way or another, so I just wanted to mention it. :thinking:

1 Like

Also any plans to support RGB bulbs? The mobile hubitat app only has on/off control, using the maker API I can set the RGB colours. I think the smartThings RGB control would be very nice to use. I seem to recall using it a few years ago and it was very intuitive

I’m very interested in this as well. Currently these RGBW bulbs are my hang-up. My existing setup makes it easy for the family to modify the colors so if I could keep them in the SmartThings app that will make life better (especially with the limited app controls in Hubitat).

It’s interesting that I can control the color temperature but not the rest of the color using the mira driver. Is this project open source so I could look into what might be required to add the additional functionality?

Anyone else have the issue of if wifi + power to both Smartthings & Hubitat hubs goes out temporarily, the only way to get Mira Hubitat Hub to show up as connected again is to delete it from Smartthings and completely re-add it?

There’s a bit of a chicken and egg problem where if one comes up before the other, they don’t know how to communicate. Mira needs to register its IP/port with Hubitat once it starts, but if Hubitat hasn’t finished starting then there’s no one listening. I believe I added a retry but it only tries so long before it gives up. If its not yet connected you should be able to refresh (pull down while on the Mira device information in the app) and it will reconnect and register the IP/port with Hubitat if it hadn’t already. If this isn’t the case I can troubleshoot it more soon.

1 Like

It seems like the retry period is very short. It takes my ASUS RT-AC5300 router 2+ minutes to boot up and so if power is lost to both hubs I run into this issue consistently. Is there reason for such a short retry period? Any reason why you couldn’t stick registration into a do-while loop with an ample retry timeout period for each attempt?

From playing around it felt like Mira got hung up in a weird state when it was offline. I thought maybe it was a cache issue with Mira not trying to reconnect so I thought I could force it by modifying access token setting. After changing 1 character of access token, Mira status in ST changed to ‘401-unauthorized’ (expected). But then when I changed it back to the original value, Mira status stayed stuck at ‘401-unauthorized’. I then power cycled Smarthings hub but no change in Mira status. I’m pretty sure I then tried modifying Mira setting for Smarthings hub IP and got Mira status to change to ‘misconfigured’ (or maybe it said ‘needs configuration’???) , but when I changed IP address back to correct value, Mira status did not change.

It’s not a huge deal as I now know what I have to do in order to fix it so I wouldn’t waste much of your time on this.

Oh and thank you for developing this awesome driver.

I misspoke. Turns out it retries forever, attempting to connect every 30 seconds. I’m not sure why yours is not reconnecting once your router comes up.

I’ll test the 401-unauthorized back and forth test case and see what I get on this side.

Which IP address were you changing? The one in your Hubitat Maker API URL? Or the one labeled “SmartThings Hub domain/IP address”?

You shouldn’t need to set the latter one unless you want to use a domain name to pass to Hubitat or if for some reason you need a different IP address than the one SmartThings thinks it is.

I was changing SmartThings Hub domain/IP address to see if I could force state refresh.

Oh well perhaps my setup is an edge case. I appreciate you looking into it.

That one won’t trigger anything. It’s just there in case you want to tell Hubitat a different value than the IP address that the hub reports to it’s drivers.

I’ll look at your other case though.

Also I think if you change anything and it’s in the middle of a wait retry, it still waits to the end of that retry period to do anything.