Mira: Hubitat to SmartThings hub integration Edge driver

The ST icon never updates and lights up. The physical light or switch turns ON, but as I said that spinning thing on the ST’s device icon will just spin for a while and then stop. Once it stops the ST icon is still dark as if the switch is OFF. Clicking OFF again does not turn the light OFF. I am assuming because the ST app is not setting the state to ON, it cannot turn it OFF - Not working as described at least for me. I even removed everything from maker api, then all device from ST’s, then I set maker api up again with a different instance, configured Mira and all my devices came over, but the same thing happened. Any device that is ON when Mira syncs and brings them over to ST’s shows as ON in ST’s and any device that is OFF shows as OFF. However, none of the devices that are ON will turn OFF using ST’s but I can turn ON the devices (switches/Lights etc) that are OFF, but then they do not turn OFF. It does not matter how long I wait, If I turn that device OFF some other way, then use the ST app gain to turn it ON, it still works. I have 123 devices, could that be the issue? Mira cannot handle that many devices?

There isn’t any obvious reason as far as why that behaviour is happening. There is NO difference from a ON message to an OFF message.

I’ve not tested with that many, but I guess its possible there are limitations. You could try testing the whole thing with a new instance of Maker API with 10-20 devices in it.

Here’s the message flow to help debug this.

When you request a change to the device in ST app:

  1. The ST app sends change request to the cloud.
  2. ST cloud relays change to hub, dispatching to the Mira driver.
  3. Mira driver running on ST hub opens socket with local HE hub to the Maker API driver listening, with the device to change and the new state (on or off, doesn’t matter).
  4. HE Maker API driver will then make the change to the physical device.
  5. When the device change is updated in the device history, Maker API is listening for those changes and will trigger an update.
  6. Maker API driver on the HE hub then makes a local connection back to Mira listening on its local socket (using the IP address and port as registered on the Maker API page).
  7. Mira triggers an event change for that virtual device with the new state as reported back by MakerAPI.
  8. ST Hub forwards that event to the cloud for history and processing.
  9. ST Cloud forwards event changes/state to the app.

The app will NOT reflect the change in state until after #9 is completed. Mira doesn’t change the local state of the virtual device when making the initial request. It goes thru the entire chain and waits for HE to tell it that the state has now changed. If something is being lost along the way, then you’ll get spinning and no reflection of the current state in the app.

Hi. Here is what I did, again, must just be some random glitches. When in doubt start over. I removed my maker api instance, then manually deleted all devices in ST’s. Then removed the Mira device from ST’s, went to the driver site and unistalled the edge driver, then unenrolled from the channel. Then for good measure rebooted my android Galaxy S20 phone and then deleted the cache partition just in case something in there was the problem. Then I started over. I added one device to start with. Everything worked, then last night I added a few more and finally today I have 28 added. So far everything once again works as it should. I plan to add 4 or 5 devices at a time until I get all 120 or so that I need mirrored. I will let you know if I have any glitches. Thanks again. Today so far all looks good!

Make a note/screenshot of the IP address/port registered by Mira in the Maker API app page. If things break again, check your ST hub’s IP in the IDE.

Hi Nice work, I have it all set up but seem to be having an issue with the refresh to see any changes say with an sensor going from closed to open I have to manually refresh the sensor icon in SmartThings to see the change.
Jon

Change the state on the Hubitat side. Does the state change in ST?

When I open the sensor it shows in hubitat right away but not in St I have to refresh the sensor to show the change in st

Oh its a sensor. I was thinking it was a switch or something you had control of in the app.

Do this
1- go to the Mira Hub device tile on ST app, and click to view details.
2- Should just say connected. Swipe down on the screen to refresh Mira.
3. wait a few seconds while it resyncs.
4. Go back to your sensor’s tile in ST.
5. now change your sensor state and see if it reflects the change.

Yes same issue it’s fine in Hubitat but nothing in ST until I refresh that sensor icon in ST. when I refresh it changes right away.

I just Uninstalled everything and re installed and set it up again still with the same issue.

Is it all devices? Or just this sensor?

I just set up a switch for the fan and it does the same as the sensors

Not sure. I’ll need more information/logging. Others aren’t having this issue on all devices.

What is your network topology? Are the two hubs on the same subnet? Is one wired and the other wireless and your router is isolating one from the other?

My guess is that the HE hub can’t open sockets and send data to the ST hub. When you do a refresh in ST it’s communicating with HE but the reverse isn’t true.

Hello, I’ve been able to successfully install Mira as well as a first batch of devices to test that it’s working. However, when I tried to go in Maker API for Mira and add more devices they aren’t getting reflected in Smartthings. Is there something I should do to trigger the update? Mira still shows as connected and the devices that I included in the initial batch are bidirectionally responsive but just not sure why I am unable to add more devices.

After you change devices in the Maker API control panel, you need to refresh the Mira side. It has no way of knowing you changed anything.

Go to your Mira device tile in the ST app and pull down to refresh. I’m pretty sure this sequence is documented btw.

Yes, that worked. Thank you.

1 Like

Great job, works as expected so far. thank you @csstup

2 Likes

Loving this setup! Only annoyance is that my temp and humidity sensors (switchbot) aren’t being updated automatically. I have to go into the device details and refresh.

Is there anyway around this? Something where they update every 5 mins or something like that?

Thanks!

Edit: I went ahead and used “Device Mirror Plus” in HPM and made temp sensors for all the devices. They now seem to be updating automagically

2 Likes

If you want to debug it, we can look to see what makerapi is reporting for the switchbot devices. My guess is they are not updating correctly if the refresh works.