Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device State Changes made in Hubitat not being reflected in HomeKit #123

Closed
2 tasks done
basilbabaa opened this issue Oct 25, 2021 · 20 comments
Closed
2 tasks done
Assignees
Labels
bug Something isn't working no-issue-activity

Comments

@basilbabaa
Copy link

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • That OAuth is Enabled for the Hubitat App under the Homebridge v2 App under App Code.
  • The Hubitat App and Homebridge Plugin are updated to the latest code available.

About Your Setup

  • How many devices are detected?: Everything selected is detected just fine.
  • Hubitat App Version: 2.5.12
  • Hoobs Version: 4.0.110 (running on my own Ubuntu 20.04.3 LTS installation / Intel® Core™ i7 @ 3GHz × 4 w/ 8GB Mem)
  • Homebridge Plugin Version: 2.5.12
  • Homebridge Version: 1.3.5
  • NodeJS Version: 14.18.1

Expected Behavior

Changing device state from HomeKit updates device state in Hubitat and vice versa.

Current Behavior

Changing device state in HomeKit updates device state in Hubitat; but changing device state in Hubitat DOES NOT change device state in HomeKit.

Steps to Reproduce (for bugs)

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. Added 6 new Zigbee Smart Plugs to Hubitat (Sonoff S31 Lite zb)
  2. Tested & confirmed operating in Hubitat
  3. Added Homebridge Plugin On Hoobs and Hubitat
  4. Selected, updated devices in the Hubitat Hombridge v2 App
  5. Restarted Hubitat Bridge T7 on Hoobs
  6. Turned on & off plugs from HomeKit & confirmed that device states were updated in Hubitat
  7. Turned on & off plugs from Hubitat & confirmed that device states were NOT being updated in Hubitat

MY STEPS TO REMEDY THE PROBLEM

  1. Removed and re-selected devices and restarted the Hubitat Bridge T7 on Hoobs a half dozen times, until they started updating the device state in HomeKit when turned on & off directly from within Hubitat
  2. Finally tested this confirmation by using Amazon Alexa to control the device states on the new Zigbee devices. Making a device state change by voice command using Amazon Alexa IS now successfully reflected in HomeKit.

Context

**How has this issue affected you? What are you trying to accomplish?
Providing context helps us come up with a solution that is most useful in the real world

  1. I almost went with the Homebridge-Hubitat Plugin by jvmahon, because it worked with these ZigBee devices flawlessly the very first time I installed it; i.e. never were device state changes made in Hubitat not reflected on the devices in HomeKit.

  2. But since yours is the Homebridge certified plugin I though I would send this report just to mention what I experienced and to possibly help out if you are able to reproduce the issue and better your Plugin.


Please include a copy of any relevant log output to assist in tracking down the bug

  • Just trust me that when device state changes made in Hubitat were not being reflected in HomeKit, the Hubitat Logs showed the device state change, where-as the Log on Hoobs showed no receipt of action. Once after managing to get the device state changes to properly register using the plugin, NOW, devices state changes register in the Logs on both Hubitat and in Hoobs as expected.
@basilbabaa basilbabaa added the bug Something isn't working label Oct 25, 2021
@tonesto7
Copy link
Owner

tonesto7 commented Oct 25, 2021

Thanks for reporting but I see no evidence that this is a bug.
The issue is likely that Hubitat could reach the plug-in instance for some reason.
Thousands of people use this plugin and when they have this issue it's often the configuration settings or a network/firewall issue on the host running the plugin.

@marsbars-marsbars
Copy link

I am having the same / similar issue. Homekit is not getting Hubitat z-wave status changes. I see no log issues in home bridge, all updates have been completed.

@basilbabaa
Copy link
Author

I am having the same / similar issue. Homekit is not getting Hubitat z-wave status changes. I see no log issues in home bridge, all updates have been completed.

Mine eventually started working as expected. I literally shut down everything. Waited a few min and restarted my entire system. Starting with Uni Edge Switch, then Gateway Modem, then Eero network, then HomeKit Hubs, then Lutron Caseta and Hue Bridges, then Hoobs, then Hubitat, so unfortunately I am unsure what the exact issue was. But it believe will work for you as expected.

I chose to drop a bomb to see if I could save time in troubleshooting and it worked. But If you are able to surgcially isolate better than I was, It would be nice to know what you find.

@marsbars-marsbars
Copy link

I have some similar gear, so there might be a combo there which may be the issue. I will follow your plan and power everything down and then bring back up. Will advise on the results!

@marsbars-marsbars
Copy link

I just shutdown and powered everything back up. No change in status going to homekit... and I saw this in the log, but its 100% correct data
[03/11/2021, 16:41:54] [Hubitat-v2] sendStartDirect Connection failure | Message: Request failed with status code 404

@basilbabaa
Copy link
Author

I originally noticed my problem because in certain places in my home/office I use Alexa do some things. She would turn on lights but HomeKit never saw them as having been turned on.

When I realized there was a problem I also stopped looking at Homekit or Alexa until the logs on hoobs and hubitat were in sync. I'd turn a switch on in hoobs and see if hubitat logged it. Then I'd turn that switch off in hubitat and see if hoobs logged it. Once they were in sync HomeKit started seeing the changes. And changes executed by Alexa were reflecting in HomeKit.

I'm even presenting virtual buttons in Hubitat that I created to run some rules in the rule machine to HomeKit through this Plugin. Maybe you can compare?

In my troubleshooting, I also tried the Homebridge Hubitat Plugin by jvmahon and it worked okay and was easy to setup. But I was curious why this one which was certified and appeared to have more options did not work for me. So I do also recall having to install this several times and fighting with it. Maybe somewhere in the process I had something in the config wrong and that was the actually issue and not the reboot.

Here' is how mine is setup.

In Hubitat I labeled my App Hoobs on T7 Bridge

This is my current Hubitat Bridge config in Hoobs:

{
"platform": "Hubitat-v2",
"name": "Hubitat-v2",
"direct_port": 8000,
"adaptive_lighting_offset": 0,
"temperature_unit": "F",
"round_levels": true,
"adaptive_lighting": true,
"consider_fan_by_name": true,
"consider_light_by_name": true,
"validateTokenId": false,
"logConfig": {
"showChanges": true
},
"use_cloud": false,
"app_url_local": "http://192.168.X.1/apps/api/",
"app_url_cloud": "https://cloud.hubitat.com/api/###your number here###/apps/",
"access_token": "###your access token here###",
"app_id": 652
}

@fluffylizard
Copy link

fluffylizard commented Nov 23, 2021

Have the same issue: Temp/Humidity sensor state changes never get to the Homebridge pi. A separate switch works fine though: if I physically flip the switch the new state gets to the Homebridge and HomeKit app just fine, and is reflected in the Hubitat logs:

app:682021-11-22 07:31:05.726 pm info Homebridge (v2.5.12) | Sending DEVICE Event (Basement Outlet | SWITCH: on)  to Homebridge at (192.168.0.208:8000)
dev:12021-11-22 07:31:05.693 pm infoBasement Outlet was turned on [physical]

The sensor event never gets the Sending DEVICE Event log statement after the Hubitat logs the values change:

dev:22021-11-22 07:36:34.807 pm infoSonoff Temperature & Humidity Sensor is 50%RH
dev:22021-11-22 07:32:03.967 pm infoSonoff Temperature & Humidity Sensor temperature is 73.71°F

This is 100% consistent, the sensor updates never get sent out after Hubitat fires the event. The switch state is sent out every time. The switch and sensor state changes are mere minutes away (the logs above show it too).

I only have two devices setup, a sensor and a switch, both Zigbee, they seem to work perfectly ok with Hubitat alone. Hubitat and Homebridge Pi are wired to the the same ethernet switch.

@fluffylizard
Copy link

fluffylizard commented Nov 23, 2021

SOLVED: see the bottom paragraph.

I noticed that the app was not subscribing to receive events from the problem Sensor. I verified that in the Event Subscription table in the Hubitat GUI. I tried rebooting, powering off, you name it, nothing would make it subscribe to the sensor device's events.

I then renamed the sensor to drop the '&', you know because of interpolated strings of groovy, who knows. Also, removed the sensor from the config, and then added it again. And what do you know, the app subscribed to the events, and I started getting updates in the Hombridge plugin.

I know the '&' in the name should not have mattered, so I put it back in, and removed and added the device in app's config again, and I was still getting updates. So it is definitely not the '&' in the name. So I kept digging.

HERE IS THE BUG: When you add devices by going through the App's config, select the device in the section, click "Update", then click "Done" at the very bottom, and, importantly, then just leave the screen. The device even though is getting added to the app's config, will not be subscribing to get events, even if you reboot the hub. So, the solution? You must complete the asinine sequence of the config screens, because clicking "Done" does not really mean done, no! After clicking the "Done" once in the config and after the screen refreshes, you must scroll down again, and boom!, there is now a "Next" button, which you must click, which brings you to the "Please Donate" screen, where you must click "Done" again. And that will make device behave as expected. Now, this here is the best example of the worst UIX ever.

@j-wang
Copy link

j-wang commented Dec 1, 2021

I had the exact same issues as everyone else here, also debugged quite extensively. I basically noticed that the state was updated in Hubitat for (in my case, motion) sensors, but it was never reflected in Homebridge or HomeKit. It was never even sent within the event queue in the Homebridge V2 App.

My solution was actually @tonesto7’s: I reread the readme and realized my server that was hosting Homebridge didn’t have port 8000 open, which is what the app in Hubitat uses to update Homebridge.

After opening the port on the server from Hubitat’s IP (in my case, using ufw for Ubuntu), everything worked correctly.

@DerekSeaman
Copy link

@fluffylizard Thanks for the workaround! I was seeing the exact same issue where Hubitat status was not being reflected in Home kit. There was probably an easier way, but I had to delete the Bridge in HOOBS and basically start all over with the plug-in configuration. But by following your guide I now have 2-way sync. The plug-in UX certainly needs work.

@tonesto7
Copy link
Owner

tonesto7 commented Dec 5, 2021

What kind of work are you referring to?
The plugin UX is very limited and is generated via a config file.
I'm open to suggestions!

If you would like to play with it and send me a pull request I will gladly implement if the change make sense

@DerekSeaman
Copy link

DerekSeaman commented Dec 5, 2021

What kind of work are you referring to? The plugin UX is very limited and is generated via a config file. I'm open to suggestions!

If you would like to play with it and send me a pull request I will gladly implement if the change make sense

I just started playing with HOOBS and your plug-in yesterday. So my first attempt at getting the plug-in working didn't go quite as planned. My first attempt resulted in a one-way working bridge (Homekit to Hubitat), and on the Hubitat side somehow "Homebridge v2" wasn't showing up in the app list. I guess I didn't properly go through all the "Update" and "Done" button press steps? I'm not sure. But @fluffylizard directions above cured both the bi-directional comms issue and now the Homebridge v2 app is listed in the Apps list in Hubitat.

I don't know what UI improvements can be made given the platform constraints...I'm not a coder. But making the config experience more 'idiot proof' in terms of all the update/done buttons could lead to fewer frustrated users.

@danhido
Copy link

danhido commented Jan 14, 2022

SOLVED: see the bottom paragraph.

I noticed that the app was not subscribing to receive events from the problem Sensor. I verified that in the Event Subscription table in the Hubitat GUI. I tried rebooting, powering off, you name it, nothing would make it subscribe to the sensor device's events.

I then renamed the sensor to drop the '&', you know because of interpolated strings of groovy, who knows. Also, removed the sensor from the config, and then added it again. And what do you know, the app subscribed to the events, and I started getting updates in the Hombridge plugin.

I know the '&' in the name should not have mattered, so I put it back in, and removed and added the device in app's config again, and I was still getting updates. So it is definitely not the '&' in the name. So I kept digging.

HERE IS THE BUG: When you add devices by going through the App's config, select the device in the section, click "Update", then click "Done" at the very bottom, and, importantly, then just leave the screen. The device even though is getting added to the app's config, will not be subscribing to get events, even if you reboot the hub. So, the solution? You must complete the asinine sequence of the config screens, because clicking "Done" does not really mean done, no! After clicking the "Done" once in the config and after the screen refreshes, you must scroll down again, and boom!, there is now a "Next" button, which you must click, which brings you to the "Please Donate" screen, where you must click "Done" again. And that will make device behave as expected. Now, this here is the best example of the worst UIX ever.

You're a lifesaver, thanks for that!

@rwswan84
Copy link

rwswan84 commented Feb 3, 2022

Hey All - I'm experiencing this same issue:

I have several GE Enbrighten z-wave dimmers around my house all connected to a Hubitat. The Hubitat is then connected to HomeBridge (on my synology nas), and then to Homekit.

The problem I'm having is that HomeKit does not reflect the correct state (on/off) of the dimmers when the buttons are physically pressed. Hubitat shows the correct state, but for some reason this state is not making it down the line to HomeKit.

Example: I physically turn on the dimmer at the wall, lights turn on, Hubitat recognizes this state, but HomeKit still shows the lights as being off. I've even tried manually clicking "Refresh" in Hubitat to see if this somehow triggers the state to be sent to HomeKit, but nothing happens.

Hubitat, Homebridge, and all apps/plugins are up-to-date

@Mfoil
Copy link

Mfoil commented Feb 15, 2022

I am having the same issues. i have removed the app and all the devices from homebridge. Reinstalled it, clicked on all the done/update/next buttons i could and still having same issues.

@rwswan84
Copy link

Turned out it was a "simple" user error in the Homebridgev2 app on Hubitat. When you add a device, you must go down to the bottom of the screen and click Next. Then it takes you to another Confirmation Page where you must click Done. It seems like you can add devices (they show up on the list), but unless you complete these next steps then they don't properly sync over to HomeBridge, and thus won't show up on HomeKit.

@Mfoil
Copy link

Mfoil commented Feb 21, 2022

I have done this and they show up in homekit, the problem is that they are not getting updated on homekit.

@rwswan84
Copy link

rwswan84 commented Feb 21, 2022

Try deleting all devices from HomebridgeV2, then delete HomeKit from your phone. Reinstall the devices on HomebridgeV2 (on the Hubitat), and then re-install HomeKit on your phone. It's kind of a pain as it will go through adding all devices wizard. Luckily I only had about 15 devices. Once I did that they all synced up.

It also could be related to not being true bi-directional communication between Hubitat - HomeBridge - Homekit. I remember some posts on Reddit(?) about testing this to see where the breakdown is.

@github-actions
Copy link

This issue has been marked stale automatically after no activity for the last 60 days.

@fnkh
Copy link

fnkh commented Jun 7, 2022

I am having the same issue. It is one way communication from homekit -> homebridge -> hubitat, but the link other way is broken somewhere

I am having issues with even the 'Hubitat Safety Monitor'. Pretty sure I am sifting through all the pages and tabs, so thats not the problem.

Here is an additional message in my homebridge log - perhaps a clue to whats going on

[homebridge-hubitat-tonesto7] This plugin generated a warning from the characteristic 'Security System Target State': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity
Projects
None yet
Development

No branches or pull requests

10 participants