NorthernMan54 / homebridge-alexa

Expose your homebridge controlled devices to Amazon Alexa.
https://www.homebridge.ca
446 stars 77 forks source link

Contact Sensor not Triggering Routine #454

Closed NexGen-3D-Printing closed 2 years ago

NexGen-3D-Printing commented 3 years ago

I have the Dummy Switch/Contact sensor plugin setup, everything works, I can can active switch it in Homekit and Homebride along with Alexa will show the switch on and the contact sensor open, functions as expected.

The issue is the dummy contact senor wont activate a routine, the sensor will open and close just fine, but the routine will not run, I can run the routine manually and it works just fine.

Pretty clueless on why this wont work, I have Xiaomi contact sensors and they will trigger routines just fine, its like the Homebridge dummy contact sensors have been intentionally blocked?

NorthernMan54 commented 3 years ago

Did you enable routines in the config?

NexGen-3D-Printing commented 3 years ago

Hi bud, yes I have enable the feature, everything seems to be working, as far as the dummy switch and contact sensor showing and toggling as it they should, just the routine will not trigger.

The only error message I can see in the logs is due to duplicate names:

[7/10/2021, 10:35:51 PM] [Alexa] WARNING: Duplicate device name Front Door Doorbell Trigger [7/10/2021, 10:35:51 PM] [Alexa] WARNING: Duplicate device name Test light 1

Both of those are dummy switches with partner dummy contact switches, both function but I don't see anywhere I can name the switch and contact separately, so they will always have identical names, the "Test light 1" is the one I created with your dummy contact plugin, the other is from the Camera plugin.

This is a new install and I only have the Alexa and dummy contact plugin's setup in this instance, everything else is setup under separate Homekit instances.

I have been using your Alexa plugin for many years now, its been fantastic, probably one of the best and most useful plugins available, but being able to trigger routines would take it to the next level for me, I just find it so weird, the contact is showing in the Alexa app, if I trigger the switch in Homekit, both the switch and contact activate in both Homebridge and Alexa, the contact clearly goes to open, but the routine, no matter how simple I make it, will just not trigger.

NorthernMan54 commented 3 years ago

If you turn on the debug logging feature it will log more details when you trigger the contact sensor. The routine trigger is a different api than what you see in the app, and the debug log will show the events.

also routines are a rate limited api, so if a lot of events are sent they will be delayed

That warning can be ignored in your use case, duplicate names just cause Alexa to say can’t determine what device it is.