Mira: Hubitat to SmartThings hub integration Edge driver

What is it?

  • Mira is a SmartThings Edge driver that allows devices on a local Hubitat Elevation hub to be “mirrored” back to SmartThings.
  • Communication between the two hubs is completely local, the cloud is not used.
  • Mira will create a virtual device in SmartThings for each Hubitat device “mirrored” to it. These virtual devices can be operated on just like real devices and will sync bidirectionally in real time.

Device types supported

  • Switch
  • Dimmer Switch
  • Thermostat
  • eTRV
  • Button
  • Lock
  • Smart Bulb
  • Shade/Blind

And Sensors:

  • Motion Sensor
  • Motion / Illuminance Sensor
  • Motion / Temperature / Humidity / Illuminance Sensor (4 in 1)
  • Leak Sensor
  • Leak / Temperature Sensor
  • Temperature Sensor
  • Temperature / Humidity Sensor
  • Contact Sensor
  • Contact / Temperature Sensor
  • Carbon Dioxide Sensor
  • CO2 / Temperature Sensor
  • CO2 / Temperature / Humidity Sensor
  • Smoke Detector
  • CO Detector
  • CO Detector with Temperature and Humidity
  • Illuminance Sensor
  • Presence Sensor

NOT (YET) SUPPORTED:

  • Fan Controller
  • Garage Door Controller
  • Sound Sensor
  • Power/energy monitoring for outlets
  • RGB Color for Smart Bulbs

Use cases:

  • Migrating between SmartThings and Hubitat, allows HE devices to be mirrored back during the transition.
  • Use the SmartThings app as a dashboard for your Hubitat devices.
  • Combine the best of both SmartThings and Hubitat’s worlds

Installing the Mira driver on SmartThings

To setup Hubitat:

  • I suggest creating a separate instance of the Maker API to use with Mira. From the main screen: Apps → Add Built In App → Maker API
  • Label this Maker API instance whatever you’d like. I chose “Maker API for SmartThings Mira”
  • Select devices you wish to mirror. Only supported device types will be created on the ST side. Try to just do one or two devices to start with. You can always add more later.
    image
  • Click DONE to save the new instance of the Maker API.
  • Go back into the instance you just created, your URL and your access token are needed from this screen. Scroll down to the LOCAL URL section.
  • Make a note of your URL prefix (yellow) and access token (green), you’ll need those to enter into the Mira driver.

To setup SmartThings/Mira:

  • After you’ve installed the driver, do a “+” → Add device → Scan for nearby devices. The UI should show Hubitat Mira created after a few seconds. It will be created in the same room as your main ST Hub is in.

  • Go to your new Hubitat Mira device, click it to view its details. It will display “Not Connected” and offline.

  • Select the 3 dot menu, Settings.

  • In the “Hubitat Maker API URL” field, input your URL displayed by Hubitat. Example is shown in yellow above. Pattern should be http://xxx.xxx.xxx.xxx/apps/api/zzz where xxx is your IP address and zzz is a numeric instance of the Maker API.

  • In the “Hubitat Maker API Access Token” field, input your access token displayed by Hubitat. Example is shown in green above. Fill in using hyphens as shown. I’m not sure if its case sensitive, for now make it match what Hubitat displayed.

  • Exit from Settings. The status should change to “Connected” and any supported devices you mirrored will be created.

To use:

  • Refreshing the mirrored devices (swipe down on the virtual device detail page) will fetch the current values from Hubitat.
  • Refreshing the Hubitat Mira device (swipe down on detail page) will refresh the current devices the Maker API instance has mirrored, updating or creating new ones as needed. Use this if you add devices to Hubitat later.
  • You should be able to create routines and logic similar as you would with any other virtual device.
  • Updates to the mirrored device will sync to Hubitat. When Hubitat completes the update it will notify Mira of the new state.

Some notes:

  • Error handling is good but not perfect yet.
  • It’s possible that some devices you try to mirror won’t be picked up correctly or will be missing attributes.
  • If you change a device type in Hubitat after its been mirrored, Mira will try and convert it to the new type. Note that the name won’t change. You’ll need to update the name manually. Any routines that relied on the old attributes will be removed.
  • If this driver was useful to you, maybe you’d like to buy me a coffee.. Thanks!

Please let me know any questions or issues.

19 Likes

Nice work! :sunglasses:

1 Like

nice! I believe there is now both directions covered by separate Edge drivers? ST → Hubitat by another driver and Hubitat → ST this driver.

1 Like

Yep. You can find these and other integration options, such as MQTT, by going to the quick browse list in the community-created wiki and looking on the list for “edge services.“ Most do require that you have an additional server device running, which is different than the old architecture, but then most will run locally, which is very cool, and an improvement over the old architecture. :sunglasses:

https://thingsthataresmart.wiki/index.php?title=Quick_Browse_Lists_for_Edge_Drivers

1 Like

I followed the instructions (ignoring any settings that weren’t explicitly called out). However, my “Mira - Hubitat Hub” still shows “Not Connected” in SmartThings. Any ideas or tips?

Edit: Nvm… I forgot my SmartThings hub was on the IoT subnet. I moved it and it worked!

2 Likes
  1. Hubitat hub has to be on the same subnet as your SmartThings hub.
  2. PM a screenshot of your Settings page and I can verify that the format is okay.
1 Like

Quick question: What’s the best way to sync the location mode (Home, Away, Sleep) between the two hubs?

Mira can’t do it, as mode isn’t changeable by a device.

You could likely do it with HubiThings Replica though.

2 Likes

Hello.
First of all, big thanks to you for your freat driver.
I think this is awesome.

Would you plz update some issues as below?

  1. aqara temperature and humidity sensor.
  • original smartthings device icon : device icon shows both temp and humidity
  • Mirrored icon via Mira : Mirrored device icon only shows temp.
  1. aqara FP1 human presence sensor
  • Can you sync device icon in smartthings and mirrored one?

Looking forward to hearing good news from you.

Mira bases what it capabiltiies it has based on what the driver in use on the HE side reports. What I would guess is that your HE driver is only reporting Temperature Measurement and not Relative Humidity Measurement. What driver are you using? You can also query the device manually with your Maker API urls and see what Mira sees.

Same deal, depends on what the HE side driver capabilities and attributes are being reported. We’ll need to do the same checks to see what it supports.

I did use [Zigbee - Xiaomi/Aqara Temperature & Humidity Sensor] by Markus Liljergren.
and it seems like that it reports RelativeHumidiyMeasurement.
I did query the device manully with Maker API urls as below.

[{“capabilities”:[“RelativeHumidityMeasurement”,{“attributes”:[{“name”:“humidity”,“currentValue”:“54.54”,“dataType”:“NUMBER”,“values”:null}]},“Refresh”,“Battery”,{“attributes”:[{“name”:“battery”,“currentValue”:null,“dataType”:“NUMBER”,“values”:null}]},“PressureMeasurement”,{“attributes”:[{“name”:“pressure”,“currentValue”:“102.8”,“dataType”:“NUMBER”,“values”:null}]},“Initialize”,“TemperatureMeasurement”,{“attributes”:[{“name”:“temperature”,“currentValue”:“18.96”,“dataType”:“NUMBER”,“values”:null}]},“Sensor”,“PresenceSensor”,{“attributes”:[{“name”:“presence”,“currentValue”:“present”,“dataType”:“ENUM”,“values”:[“present”,“not present”]}]}]}]

and I tried to change driver to another one which is [Xiaomi Aqara Temperature and Humidity Sensor WSDCGQ11LM] by BirdsLikeWires.
and it seems to report RelativeHumidiyMeasurement either as below.

[{“capabilities”:[“RelativeHumidityMeasurement”,{“attributes”:[{“name”:“humidity”,“currentValue”:“54.54”,“dataType”:“NUMBER”,“values”:null}]},“Configuration”,“VoltageMeasurement”,{“attributes”:[{“name”:“voltage”,“currentValue”:null,“dataType”:“NUMBER”,“values”:null},{“name”:“frequency”,“currentValue”:null,“dataType”:“NUMBER”,“values”:null}]},“Battery”,{“attributes”:[{“name”:“battery”,“currentValue”:null,“dataType”:“NUMBER”,“values”:null}]},“PressureMeasurement”,{“attributes”:[{“name”:“pressure”,“currentValue”:“102.8”,“dataType”:“NUMBER”,“values”:null}]},“TemperatureMeasurement”,{“attributes”:[{“name”:“temperature”,“currentValue”:“18.96”,“dataType”:“NUMBER”,“values”:null}]},“Sensor”,“PushableButton”,{“attributes”:[{“name”:“numberOfButtons”,“currentValue”:“1”,“dataType”:“NUMBER”,“values”:null},{“name”:“pushed”,“currentValue”:null,“dataType”:“NUMBER”,“values”:null}]},“PresenceSensor”,{“attributes”:[{“name”:“presence”,“currentValue”:“present”,“dataType”:“ENUM”,“values”:[“present”,“not present”]}]}]}]

I would expect that both temp and humidity would be shown given that driver’s capabilities.

EDIT: Oh I think I see what you’re saying. On the summary tile, only temperature is displayed. Temperature and Humidity are both likely shown on the detail view.

I’ll look into seeing why my virtual is only showing temperature on the tile, even when humidity is available.

I think you may have a small problem calling your app Mira. The same name as a well known company in th UK who manufacture showers. Just a heads up.

1 Like

It’s the spanish word for sight. A company cannot own the use of a word.

Try telling that to Sky…

They would have a trademark on their logo. Lots of other apps on appstores use the word Sky, which are nothing to do with Sky TV. For example SkyVPN.

I don’t see the ST->Hubitat. What is it called?

The custom drivers can be found on the “edge services” list in the quick browse lists in the community-created wiki.

As of this writing there are 3 alternatives each with somewhat different features:

Mira (mirror devices from Hubitat to ST, bidirectional status synchronization, local)
HubiThings (bidirectional, cloud)
And an MQTT project (bidirectional, local, but limited device classes)

https://thingsthataresmart.wiki/index.php?title=Quick_Browse_Lists_for_Edge_Drivers

2 Likes

I don’t think I would categorize Mira as one way. It’s bidirectional for updates (changes on either side are reflected on the other). It is however limited by only allowing HE devices to be cloned to virtuals on ST, and not real ST devices back to HE.

I’m not sure if Hubithings has the same limitation (but in reverse.)

3 Likes

International law allows for the same word to be used by multiple companies, particularly if they are a different type of business. It’s the logos that have to be unique.

The most famous example is probably Delta airlines and Delta faucets, but there are also delta elevator parts, delta fans, and delta8 thc. All unrelated businesses, all trademarked logos.

There are lots of other examples. Peter Pan is used by a peanut butter company, a trucking company, a horse racing enterprise, the Disney products associated with their animated film, and a company that sells tinned salmon.

not every use of a similar or even identical name is a trademark infringement; and not every brand name needs to be unique

Again, though, the logos are unique, and the businesses are different enough that the regulatory agencies believe there will not be consumer confusion.

So I don’t think there’s any problem with the name Mira in this instance. :sunglasses:

2 Likes