NorthernMan54 / homebridge-alexa

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

Motion sensor triggers 10 seconds too late because the plugin sends unnecessary messages to Alexa - I think #465

Closed HolgerAusB closed 2 years ago

HolgerAusB commented 2 years ago

I have already read the Issues #458 and #461 . But I think, I may have discovered a new aspect, did I?

Although I have set in HB-Alexa that only 1 motion sensor (from the DelaySwitch plugin, 1 ms) should be transmitted to Alexa, according to the log also other sensor data are transmitted to Alexa. This leads in my case to the delay of 10 seconds

My doorbell signals via mqtt when someone presses it. I have created a motion sensor in HB-mqttthing that reacts to this. When I send this sensor to Alexa, everything works fine!

However, as I want to add further restrictions, a DelaySwitch of 1ms is switched on via Home+ automation when all conditions are met. The motion sensor belonging to this DelaySwitch ('Ax Prime Hoftor Trigger') is now the only one that is to be transmitted to Alexa.

Unfortunately it seems, the plug-in also transmits the mqtt-sensor-event to Alexa, even though Alexa does not even know the sensor.

But when the right sensor is triggered, the 10-second time-out is already running :-(

I am using plugin v0.5.47-beta. My homebridge config:

...
"routines": true,
"blind": false,
"door": false,
"debug": true,
"refresh": 900,
"deviceListHandling": "allow",
"deviceList": [
   "Ax Prime Hoftor Trigger"
],
"platform": "Alexa" ...

Log example:

15.9.2021, 17:21:43] [Hoftor Klingel] Received MQTT: rtl_433/sensors/0/1/Hoftor_Klingel/motion = true
2021-09-15T15:21:43.887Z hapNodeJSClient Events [{"host":"127.0.0.1","port":51899,"deviceID":"0E:xxx:2B","aid":16,"iid":13,"value":1,"status":true}]
2021-09-15T15:21:43.887Z alexaActions Events [{"host":"127.0.0.1","port":51899,"deviceID":"0E:xxx:2B","aid":16,"iid":13,"value":1,"status":true}]
2021-09-15T15:21:43.893Z alexaLocal Sending message {"context":{},"event":{"header":{"messageId":"xxx","namespace":"Alexa","name":"ChangeReport","payloadVersion":"3"},"endpoint":{"endpointId":"xxx"},"payload":{"change":{"cause":{"type":"PHYSICAL_INTERACTION"},"properties":[{"namespace":"Alexa.MotionSensor","name":"detectionState","value":"DETECTED","timeOfSample":"2021-09-15T15:21:43.888Z","uncertaintyInMilliseconds":500}]}}}}
[15.9.2021, 17:21:44] [Ax Prime Hoftor] Starting the Timer
[15.9.2021, 17:21:44] [Ax Prime Hoftor] Time is Up!
[15.9.2021, 17:21:44] [Ax Prime Hoftor] Triggering Motion Sensor
2021-09-15T15:21:44.151Z hapNodeJSClient Events [{"host":"127.0.0.1","port":51899,"deviceID":"0E:xxx:2B","aid":23,"iid":13,"value":1,"status":true}]
2021-09-15T15:21:44.151Z alexaActions Events [{"host":"127.0.0.1","port":51899,"deviceID":"0E:xxx:2B","aid":23,"iid":13,"value":1,"status":true}]
2021-09-15T15:21:47.151Z hapNodeJSClient Events [{"host":"127.0.0.1","port":51899,"deviceID":"xxx:2B","aid":23,"iid":13,"value":0,"status":true}]
2021-09-15T15:21:47.151Z alexaActions Events [{"host":"127.0.0.1","port":51899,"deviceID":"0E:xxx:2B","aid":23,"iid":13,"value":0,"status":true}]
2021-09-15T15:21:53.892Z hapNodeJSClient Events [{"host":"127.0.0.1","port":51899,"deviceID":"0E:xxx:2B","aid":16,"iid":13,"value":0,"status":true}]
2021-09-15T15:21:53.892Z alexaActions Events [{"host":"127.0.0.1","port":51899,"deviceID":"0E:xxx:2B","aid":16,"iid":13,"value":0,"status":true}]
2021-09-15T15:21:53.894Z alexaLocal Sending message {"context":{},"event":{"header":{"messageId":"xxx","namespace":"Alexa","name":"ChangeReport","payloadVersion":"3"},"endpoint":{"endpointId":"xxxx"},"payload":{"change":{"cause":{"type":"PHYSICAL_INTERACTION"},"properties":[{"namespace":"Alexa.MotionSensor","name":"detectionState","value":"DETECTED","timeOfSample":"2021-09-15T15:21:44.152Z","uncertaintyInMilliseconds":500}]}}}}
NorthernMan54 commented 2 years ago

The underlying issue here is the same as #458, which is filters not applying to event sources

NorthernMan54 commented 2 years ago

Closing this as a duplicate of #458