ebaauw / homebridge-ws

Homebridege plugin for virtual weather station
Apache License 2.0
106 stars 4 forks source link

Automations don’t turn on #41

Closed FranciRoosters closed 2 years ago

FranciRoosters commented 2 years ago

Hello,

this morning in my town the temperature was below the value I had set for my automation to start. However, it never did. What could be the reason for this? Thank you.

ebaauw commented 2 years ago

HomeKit automations and button actions run on your home hub. Most likely, it’s not connected to Homebridge. See https://github.com/ebaauw/homebridge-hue/wiki/FAQ#homekit for troubleshooting.

FranciRoosters commented 2 years ago

I don’t get any error though. Config file has no JSON errors and no errors reported in the logs. I can see the sensors in the Home app. It’s the temperature sensor that doesn’t trigger the automations for whatever reason.

ebaauw commented 2 years ago

I don’t get any error though.

You wouldn’t see any errors as Homebridge and Homebridge WS are working. You might see a status in Home that the home hub is offline, but not always.

It’s the temperature sensor that doesn’t trigger the automations for whatever reason.

No, it’s not. A sensor in HomeKit doesn’t trigger anything. It merely reports a new value to connected HAP clients. If a home hub is connected, it runs the automations for the new value.

FranciRoosters commented 2 years ago

I’m not sure I understand what I should do to fix this. I’m pretty new to HomeBridge and most of these terms are very new to me. I’d just like for my AC unit to turn on once temperature drops below or rises above a pre-set value. Isn’t this possible with this plugin? Thank you.

On 12 Nov 2021, at 09:07, Erik Baauw @.***> wrote:

 I don’t get any error though.

You wouldn’t see any errors as Homebridge and Homebridge WS are working. You might see a status in Home that the home hub is offline, but not always.

It’s the temperature sensor that doesn’t trigger the automations for whatever reason.

No, it’s not. A sensor in HomeKit doesn’t trigger anything. It merely reports a new value to connected HAP clients. If a home hub is connected, it runs the automations for the new value.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ebaauw commented 2 years ago

I’m not sure I understand what I should do to fix this

See the troubleshooting steps from the link above to confirm that the issue is with (the connection between) your home hub (and Homebridge), or simply restart or power cycle your home hub.

I’m pretty new to HomeBridge and most of these terms are very new to me.

See https://support.apple.com/en-us/HT207057 for explanation of home hub.

I’d just like for my AC unit to turn on once temperature drops below or rises above a pre-set value. Isn’t this possible with this plugin?

Yes, you can use this plugin to expose an accessory whose state is used in a HomeKit automation to trigger an action to turn on your AC.

No, by itself this plugin cannot do that. It doesn't know anything about AC units, let alone how to control these. And this plugin, nor any other Homebridge plugin, nor Homebridge itself, doesn't know anything about HomeKit automations. You need a home hub for that.

FranciRoosters commented 2 years ago

I know what home hubs are. I have three home hubs, two HomePod mini and one iPad. Any other Homebridge plugin communicates with my home hubs without any problems, I’m not sure why this one isn’t. Or rather, it does communicate with my hubs and the Home app because I can see the temperature and humidity values of my city in the Home app. It’s just the automations that don’t work. So, still don’t know how to fix this or if there’s a workaround to achieve what I want. Thank you.

On 12 Nov 2021, at 10:44, Erik Baauw @.***> wrote:

 I’m not sure I understand what I should do to fix this

See the troubleshooting steps from the link above to confirm that the issue is with (the connection between) your home hub (and Homebridge), or simply restart or power cycle your home hub.

I’m pretty new to HomeBridge and most of these terms are very new to me.

See https://support.apple.com/en-us/HT207057 for explanation of home hub.

I’d just like for my AC unit to turn on once temperature drops below or rises above a pre-set value. Isn’t this possible with this plugin?

Yes, you can use this plugin to expose an accessory whose state is used in a HomeKit automation to trigger an action to turn on your AC.

No, by itself this plugin cannot do that. It doesn't know anything about AC units, let alone how to control these. And this plugin, nor any other Homebridge plugin, nor Homebridge itself, doesn't know anything about HomeKit automations. You need a home hub for that.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ebaauw commented 2 years ago

Any other Homebridge plugin communicates with my home hubs without any problems

Plugins don't communicate with home hubs; home hubs connect to Homebridge; plugins don't know about this. Are you running the other plugin in the same Homebridge instance, or in a separate (child bridge) instance?

it does communicate with my hubs and the Home app because I can see the temperature and humidity values of my city in the Home app.

Your home hub plays no role in showing values in the Home app. The HomeKit runtime on your iPhone or Mac connects to Homebridge, just like the home hub and independently from them.

So, still don’t know how to fix this or if there’s a workaround to achieve what I want.

I do and told you twice already.

FranciRoosters commented 2 years ago

Im sorry, but I’d appreciate it if you could dumb it down for me. I still don’t get what your proposed workaround is and how I get it to work step by step. Thank you.

On 12 Nov 2021, at 11:19, Erik Baauw @.***> wrote:

 Any other Homebridge plugin communicates with my home hubs without any problems

Plugins don't communicate with home hubs; home hubs connect to Homebridge; plugins don't know about this. Are you running the other plugin in the same Homebridge instance, or in a separate (child bridge) instance?

it does communicate with my hubs and the Home app because I can see the temperature and humidity values of my city in the Home app.

Your home hub plays no role in showing values in the Home app. The HomeKit runtime on your iPhone or Mac connects to Homebridge, just like the home hub and independently from them.

So, still don’t know how to fix this or if there’s a workaround to achieve what I want.

I do and told you twice already.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ebaauw commented 2 years ago

Power cycle your home hubs.

Check with netstat on the server running Homebridge that the home hub has made a connection to Homebridge. Lookup the port that Homebridge instance or the child bridge is using in config.json (in my case: 51837) and issue

$ sudo netstat | grep 51837

You should see a list of HomeKit clients that connected to Homebridge:

tcp6       0      0 pi3.stdnkd:51837        atv-living.stdnkd:49598 ESTABLISHED
tcp6       0      0 pi3.stdnkd:51837        homepod.stdnkd:49833    ESTABLISHED
tcp6       0      0 pi3.stdnkd:51837        iphone-erik.stdnk:55356 ESTABLISHED
tcp6       0      0 pi3.stdnkd:51837        macmini.stdnkd:57794    ESTABLISHED

If you don't have reverse DNS setup, you'll see IP addresses instead, and need to match the IP addresses of your home hubs:

tcp6       0      0 x.x.x.103:51837    x.x.x.21:49598     ESTABLISHED
tcp6       0      0 x.x.x.103:51837    x.x.x.51:62307     ESTABLISHED

Double-check that your home hubs are in that list and power cycle the missing home hubs.

FranciRoosters commented 2 years ago

Thank you. However, I don’t really see why this is necessary since all other automations triggered by the plugins I’ve installed on Homebridge work just fine.

On 12 Nov 2021, at 11:36, Erik Baauw @.***> wrote:

 Power cycle your home hubs.

Check with netstat on the server running Homebridge that the home hub has made a connection to Homebridge. Lookup the port that Homebridge instance or the child bridge is using in config.json (in my case: 51837) and issue

$ sudo netstat | grep 51837 You should see a list of HomeKit clients that connected to Homebridge:

tcp6 0 0 pi3.stdnkd:51837 atv-living.stdnkd:49598 ESTABLISHED tcp6 0 0 pi3.stdnkd:51837 homepod.stdnkd:49833 ESTABLISHED tcp6 0 0 pi3.stdnkd:51837 iphone-erik.stdnk:55356 ESTABLISHED tcp6 0 0 pi3.stdnkd:51837 macmini.stdnkd:57794 ESTABLISHED If you don't have reverse DNS setup, you'll see IP addresses instead, and need to match the IP addresses of your home hubs:

tcp6 0 0 x.x.x.103:51837 x.x.x.21:49598 ESTABLISHED tcp6 0 0 x.x.x.103:51837 x.x.x.51:62307 ESTABLISHED Double-check that your home hubs are in that list and power cycle the missing home hubs.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ebaauw commented 2 years ago

I told you before, if you see the updated values in Home, Homebridge WS and Homebridge are working and the issue with the automation not triggering is not related to the plugin.

As I've asked you before: Are you running the other plugin in the same Homebridge instance, or in a separate (child bridge) instance?

FranciRoosters commented 2 years ago

By the way, all hubs are here. Nothing missing.

On 12 Nov 2021, at 11:36, Erik Baauw @.***> wrote:

$ sudo netstat | grep 51837

FranciRoosters commented 2 years ago

Same Homebridge instance.

On 12 Nov 2021, at 11:44, Erik Baauw @.***> wrote:

 I told you before, if you see the updated values in Home, Homebridge WS and Homebridge are working and the issue with the automation not triggering is not related to the plugin.

As I've asked you before: Are you running the other plugin in the same Homebridge instance, or in a separate (child bridge) instance?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ebaauw commented 2 years ago

By the way, all hubs are here. Nothing missing. Same Homebridge instance.

Ok, that's good.

Lees likely, but also possible is that the automation definition failed to sync over iCloud from Home app to the home hubs. Unfortunately, there's no way to check whether the automations have been synced to the home hubs. What usually works is:

FranciRoosters commented 2 years ago

I’ve disabled and even deleted the automation multiple times, but it would never work after. Are you sure the issue is on my end? Thank you.

On 12 Nov 2021, at 11:51, Erik Baauw @.***> wrote:

By the way, all hubs are here. Nothing missing. Same Homebridge instance.

Ok, that's good.

Lees likely, but also possible is that the automation definition failed to sync over iCloud from Home app to the home hubs. Unfortunately, there's no way to check whether the automations have been synced to the home hubs. What usually works is:

Disable the automation from the Home app; Wait a couple of minutes for the change to be synced to your other devices. If you have another iOS device, you should see the status being updated on that device automatically; Re-enable the automation; Again, wait a couple of minutes for the change to be synced to your other devices. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ebaauw/homebridge-ws/issues/41#issuecomment-967006860, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATQII4OZDKJ3NTZV2UGXIHDULTWUPANCNFSM5H4BSWWQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

FranciRoosters commented 2 years ago

Could running the plugin as a child bridge help?

On 12 Nov 2021, at 11:57, Francesco Galli @.***> wrote:

I’ve disabled and even deleted the automation multiple times, but it would never work after. Are you sure the issue is on my end? Thank you.

On 12 Nov 2021, at 11:51, Erik Baauw @. @.>> wrote:

By the way, all hubs are here. Nothing missing. Same Homebridge instance.

Ok, that's good.

Lees likely, but also possible is that the automation definition failed to sync over iCloud from Home app to the home hubs. Unfortunately, there's no way to check whether the automations have been synced to the home hubs. What usually works is:

Disable the automation from the Home app; Wait a couple of minutes for the change to be synced to your other devices. If you have another iOS device, you should see the status being updated on that device automatically; Re-enable the automation; Again, wait a couple of minutes for the change to be synced to your other devices. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ebaauw/homebridge-ws/issues/41#issuecomment-967006860, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATQII4OZDKJ3NTZV2UGXIHDULTWUPANCNFSM5H4BSWWQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

FranciRoosters commented 2 years ago

I just wanted to add that the plugin doesn’t work with other HomeKit devices such as bulbs either. I’m starting to think it’s a problem with your plugin honestly.

On 12 Nov 2021, at 11:52, Erik Baauw @.***> wrote:

 By the way, all hubs are here. Nothing missing. Same Homebridge instance.

Ok, that's good.

Lees likely, but also possible is that the automation definition failed to sync over iCloud from Home app to the home hubs. Unfortunately, there's no way to check whether the automations have been synced to the home hubs. What usually works is:

Disable the automation from the Home app; Wait a couple of minutes for the change to be synced to your other devices. If you have another iOS device, you should see the status being updated on that device automatically; Re-enable the automation; Again, wait a couple of minutes for the change to be synced to your other devices. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ebaauw commented 2 years ago

While I’m perfectly capable of I creating bugs in my plugins, I don’t see how it’s technically possible for a plugin to cause the automation not triggering, when the value in Home is updated. To debug that, could you please provide:

CubGeek commented 2 years ago

I just wanted to add that the plugin doesn’t work with other HomeKit devices such as bulbs either. I’m starting to think it’s a problem with your plugin honestly.

Keep in mind that this plug-in simply reports data to Homebridge. Homebridge then passes that information on to HomeKit. in your own statements above, the plug-in is correctly reporting the data to Homebridge, which is then passing it to HomeKit correctly. You said:

Or rather, it does communicate with my hubs and the Home app because I can see the temperature and humidity values of my city in the Home app.

that, right there, indicates that you have set up the plug-in correctly, it is reporting temperature/humidity information to homebridge, and homebridge is making that available to your home app in HomeKit. So far, everything is working correctly, by your own admission. The plug-in gets the data, gives it to Homebridge, which then makes it available to HomeKit. With me so far?

What you have described is that the automation you have created are not acting upon the data that HomeKit is displaying.

Remember, sensors, like light sensors, humidity sensors, temperature sensors, sound sensors, etc., are not able to trigger anything in and of themselves. They simply report the data. It’s up to the automation that you create in HomeKit to read that data, and then evaluate if action needs to be taken. You need to think of “sensors“ as simply sources of data. And you need to think of “automations“ as ways of evaluating and interpreting that data to perform certain actions.

In your example, you have created a WS set of sensors for temperature and humidity. They are showing up correctly in HomeKit, by your own statement. The issue is coming when the automation that you created in HomeKit is not activating your AC based upon the data that the sensor is providing. Since you have already stated that the sensor is providing accurate data, that, right there, indicates that the issue is NOT with the sensor (and, in other words, not an issue with the plug-in, or Homebridge).

The issue, from everything that you have described, seems to be somewhere in the automation that you have created in HomeKit to read the sensor data and then perform an action based upon that data.