[RELEASE] HubConnect - Share Devices across Multiple Hubs (even SmartThings!)

community_app

#546

Not a huge deal, but SYNC doesn't really seem to do anything anymore on the drivers. Before it would fetch all of the attributes right away, on 1.3 I click it and nothing populates, and no entries in the logs on either side.


#547

On custom drivers? On stock drivers it's working fine. FYI, it doesn't refresh the values, only grabs the last reported values.


#548

I only tried it on my custom driver.

For the sync code, though, it is the same as the stock thermostat driver:

def sync()
{
// The server will respond with updated status and details
parent.syncDevice(device.deviceNetworkId, "thermostat")
sendEvent([name: "version", value: "v${driverVersion.major}.${driverVersion.minor}.${driverVersion.build}"])
}

I'll go delete the devices and re-add them and see if it does something different.

EDIT: No change. I confirmed SYNC does work on stock drivers, but it does not seem to work on my user driver.


#549

Thanks. I'll see if I can track that down.


#550

No worries - like I said not a huge deal.

Just FYI - I also tried copying the stock thermostat driver, changing the name, adding as a user driver - sync did not work.


#551

Also, the new MODE and VERSION reports are pretty cool. Nice job!


#552

Yeah something is breaking sync for custom devices. Damn. Gotta get some food in me first.

Thanks!! Appreciate the feedback.


#553

Any plans for adding a universal driver for fans sometime soon? I can share my fans (Hampton Bay Zigbee) but only as on/off switches. It would be nice to have Off, Auto, Low, Medium, Medium High and High or temporarily have them share as a dimmer.

Now that I can connect to Homebridge I'd love to use that feature but I can't until fans are an option.


#554

Just comitted an update that should fix that. Stupid typo on my part that broke it. Also made a small tweak to the selector too. Give it a try when you get a chance.

I don't see why not. I'm trying to cover as many of the popular device types as possible.


#555

Updated earlier today and all working well for me on 1.3--thanks!

Still getting the groovy.lang.MissingMethodException: No signature of method: zenZigbeeThermostat.fahrenheitToCelsius() is applicable for argument types: (java.lang.String) values: [55.0] (setHeatingSetpoint) error on my real thermostat (which lives on my remote hub) when I change it from SmartThings (remote) > coordinator (server) > "real" thermostat hub (remote). I think HubConnect is maybe trying to pass the "real" thermostat a string value for what should really be a float, but it could just be something weird with my thermostat (a Zen, which shouldn't support non-integer values for °F anyway but reports and takes them sometimes anyway). As before, this only happens if all three of the above passes are made, since modifyng the HubConnet thermostat on the "middle"/server hub does successfully manipulate the "real" thermostat on the "remote" HE hub where the real thermostat lives (just when I add ST to the beginning of this chain as a different remote hub).

I've discovered I can work around it by modifying the Remote Client source on the hub where the real thermostat lives to do a string-to-float conversion in remoteDeviceCommand when params.deviceCommand == "setHeatingSetpoint" || params.deviceCommand == "setCoolingSetpoint", which I'm sure is a terrible way for me to do it, but it does work. While doing this, I also noticed that once in a while it actually did get an integer instead of a string/float, and thus my attempted conversion to a float from string failed, but the Remote app successfully manipulated the real thermostat (which lived on that hub) anyway since that part wasn't necessary.

I suppose my float vs. int hypothesis could be tested by a virtual thermostat in centigrade mode where non-integer setpoints are (I assume) allowed. (Unless all the other thermostat drivers besides the Zen automatically do conversion from string when "needed.") Maybe tomorrow. :slight_smile:


#556

Love the updates!! Thanks for all the effort on this fantastic app :+1:


#557

This is awesome! thanks @srwhite and @dan.t for your hard work.

I now have all my sensors in homebridge and native per room dashboard on my ios devices. I will say, that was a huge pain in the butt importing and manually specifying the room for all those. It would be nice to be able to specify the room in homebridge or somewhere more efficient.

also, I’ve noticed some odd behavior when setting color/color temperature from homekit. It seems to drift from the color selected. Watching the logs, it will set the correct hue/saturation, then immediately change them. Pressing multiple time eventually gets it to set correctly.

thanks again


#558

Sync still not working on user drivers.

I updated the 3 apps, removed the device sync/deleted the device, and re-added it. Still nothing happens when clicking sync. Nothing in either side's log either.

Thanks for looking into it though!


#559

HubConnect is only passing values and not doing any string to int conversion. I sampled several SmartThings thermostat drivers and all of the ones I looked at perform the string to big decimal conversion prior to performing any actions within the driver itself. It appears that driver is not doing that.

Here’s an example from one of the public drivers in Samsungs repo..

// Get stored temperature from currentState in current local scale
def getTempInLocalScale(state) {
def temp = device.currentState(state)
if (temp && temp.value && temp.unit) {
return getTempInLocalScale(temp.value.toBigDecimal(), temp.unit)
}
return 0
}

I suggest seeing if you can modify the driver being used to make sure the conversion gets put into the proper place first. I’ll definitely see if there is anything I can do to fix this without having to modify the remote client.


#560

@dan.t

Hi - Got everything setup with Homebridge I think. I think the app_url is no longer required - anyway it seems to be working without.

I just wanted to ask is it possible to access other devices that are available within Homebridge - through other plugins and synch/control them back to the Hubitat server ?

K


#561

Hey Kevin,

Thanks for the feedback. No, each plugin is contained to its own devices and it doesn’t have access to the other devices of other plugins.


#562

OK - I'm not overly familiar with HomeKit but I guess then I could create a virtual device in Hubitat that is exposed via Homebridge. Then I create an automation in HomeKit that links some other HomeKit device back to the virtual device and hence back to Hubitat. Not sure what sort of states I'd be able to synch. but I'll take a look.

Thanks for this work on the Homebridge plugin - it's working well so far.


#563

You can put the ST hub in a metal box and ground the metal box.


#564

It's a good idea, but I disconnected it from the power and it's working fine with the cloud stuff and HubConnect.


#565

if its any help, this shows up in my homebridge logs when bulbs come on or adjust color temp:

[4/13/2019, 11:15:26 AM] [Hubitat] Attribute not found for device: { device: '173',
  attribute: 'colorTemperature',
  value: '5200',
  unit: '°K',
  date: 2019-04-13T15:15:26.964Z }

also, humidity works for one of my z-wave sensors, but not for my iris V3 motion sensors.