NorthernMan54 / homebridge-alexa

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

Virtual motion sensors not transmitted #421

Closed ucsbricks closed 3 years ago

ucsbricks commented 3 years ago

Homebridge v1.3.0 homebridge-alexa v0.5.26 homebridge-delay-switch v2.2.6 | homebridge-random-delay-switch v2.2.0

Alexa routines depending on virtual motion sensors created w/ one of the plugins listed above do not trigger. Alexa found the motion sensors provided by my Homebridge instance. And I can confirm the virtual motions sensors became active in Homebridge UI.

This is my plugin config:

{
    "name": "Alexa",
    "username": "XXXXX",
    "password": "XXXXX",
    "pin": "XXX-XX-XXX",
    "routines": true,
    "blind": false,
    "door": false,
    "debug": false,
    "deviceListHandling": "allow",
    "deviceList": [
        "Heizung",
        "Steckdose",
        "Trigger"
    ],
    "platform": "Alexa"
}

Homebridge terminal plugin debug output

2021-02-21T20:42:40.522Z hapNodeJSClient Ready
2021-02-21T20:42:40.524Z alexaActions alexaDiscovery
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - The following devices are allow => [ 'Heizung', 'Steckdose', 'Trigger' ]
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => Heizung 1
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => Heizung 2
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => Heizung 3
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => Heizung 4
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => Steckdose 1
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => Steckdose 1 Temperature
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => Steckdose 2 Temperature
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => Steckdose 2
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => NFC 1 Trigger
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => NFC 2 Trigger
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => NFC 3 Trigger
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => NFC 4 Trigger
[21/02/2021, 21:42:40] [Alexa] INFO: DeviceList - allow => NFC 5 Trigger
2021-02-21T20:42:40.648Z alexaActions Cookie Object:  887
2021-02-21T20:42:40.648Z alexaActions Cookie Object:  887
2021-02-21T20:42:40.648Z alexaActions Cookie Object:  887
2021-02-21T20:42:40.649Z alexaActions Cookie Object:  887
2021-02-21T20:42:40.649Z alexaActions Cookie Object:  283
2021-02-21T20:42:40.649Z alexaActions Cookie Object:  120
2021-02-21T20:42:40.650Z alexaActions Cookie Object:  120
2021-02-21T20:42:40.650Z alexaActions Cookie Object:  283
2021-02-21T20:42:40.650Z alexaActions Cookie Object:  116
2021-02-21T20:42:40.650Z alexaActions Cookie Object:  116
2021-02-21T20:42:40.650Z alexaActions Cookie Object:  116
2021-02-21T20:42:40.651Z alexaActions Cookie Object:  116
2021-02-21T20:42:40.651Z alexaActions Cookie Object:  116
[21/02/2021, 21:42:40] [Alexa] alexaDiscovery - returned 13 devices
2021-02-21T20:42:40.655Z alexaActions registerEvents [
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":81,"iid":41}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":81,"iid":44}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":81,"iid":50}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":81,"iid":53}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":81,"iid":56}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":82,"iid":38}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":82,"iid":41}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":82,"iid":50}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":82,"iid":53}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":82,"iid":56}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":82,"iid":59}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":90,"iid":38}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":90,"iid":41}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":90,"iid":50}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":90,"iid":53}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":90,"iid":56}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":90,"iid":59}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":117,"iid":10}': {
    '0': 'NOT_DETECTED',
    '1': 'DETECTED',
    endpointID: 'XXXXX',
    template: 'ContactSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":114,"iid":13}': {
    endpointID: 'XXXXX',
    true: 'DETECTED',
    false: 'NOT_DETECTED',
    template: 'MotionSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":115,"iid":13}': {
    endpointID: 'XXXXX',
    true: 'DETECTED',
    false: 'NOT_DETECTED',
    template: 'MotionSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":116,"iid":13}': {
    endpointID: 'XXXXX',
    true: 'DETECTED',
    false: 'NOT_DETECTED',
    template: 'MotionSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13}': {
    endpointID: 'XXXXX',
    true: 'DETECTED',
    false: 'NOT_DETECTED',
    template: 'MotionSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":119,"iid":15}': {
    endpointID: 'XXXXX',
    true: 'DETECTED',
    false: 'NOT_DETECTED',
    template: 'MotionSensor'
  },
  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":113,"iid":10}': {
    endpointID: 'XXXXX',
    true: 'DETECTED',
    false: 'NOT_DETECTED',
    template: 'MotionSensor'
  }
]
2021-02-21T20:42:40.665Z alexaActions Event Register XX:XX:XX:XX:XX:XX -> {
  characteristics: [
    { aid: 81, iid: 41, ev: true },
    { aid: 81, iid: 44, ev: true },
    { aid: 81, iid: 50, ev: true },
    { aid: 81, iid: 53, ev: true },
    { aid: 81, iid: 56, ev: true },
    { aid: 82, iid: 38, ev: true },
    { aid: 82, iid: 41, ev: true },
    { aid: 82, iid: 50, ev: true },
    { aid: 82, iid: 53, ev: true },
    { aid: 82, iid: 56, ev: true },
    { aid: 82, iid: 59, ev: true },
    { aid: 90, iid: 38, ev: true },
    { aid: 90, iid: 41, ev: true },
    { aid: 90, iid: 50, ev: true },
    { aid: 90, iid: 53, ev: true },
    { aid: 90, iid: 56, ev: true },
    { aid: 90, iid: 59, ev: true },
    { aid: 117, iid: 10, ev: true },
    { aid: 114, iid: 13, ev: true },
    { aid: 115, iid: 13, ev: true },
    { aid: 116, iid: 13, ev: true },
    { aid: 118, iid: 13, ev: true },
    { aid: 119, iid: 15, ev: true },
    { aid: 113, iid: 10, ev: true }
  ]
}
[21/02/2021, 21:50:41] [NFC 3] Starting the Timer
[21/02/2021, 21:50:42] [NFC 3] Time is Up!
[21/02/2021, 21:50:42] [NFC 3] Triggering Motion Sensor
2021-02-21T20:50:42.242Z hapNodeJSClient Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":1,"status":true}]
2021-02-21T20:50:42.243Z alexaActions Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":1,"status":true}]
2021-02-21T20:50:45.240Z hapNodeJSClient Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":0,"status":true}]
2021-02-21T20:50:45.240Z alexaActions Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":0,"status":true}]
NorthernMan54 commented 3 years ago

Can you update to v0.5.27, I fixed a minor issue with events that caused Alexa to stop announcing Door Bell events introduced with 1.3.0. I'm not sure if this is the same scenario as in my case my logs looked like this

hapNodeJSClient Events [{"host":"192.168.1.13","port":40807,"deviceID":"E3:B1:EB:AE:38:60","aid":1,"iid":10,"value":0,"status":true}] +31s
  alexaActions Events [{"host":"192.168.1.13","port":40807,"deviceID":"E3:B1:EB:AE:38:60","aid":1,"iid":10,"value":0,"status":true}] +31s
  alexaLocal Sending priority message {"context":{},"event":{"header":{"messageId":"8e54289c-d188-4217-852d-038a1710c0ab","namespace":"Alexa.DoorbellEventSource","name":"DoorbellPress","payloadVersion":"3"},"endpoint":{"endpointId":"RTM6QjE6RUI6QUU6Mzg6NjAtV3l6ZSBDYW0gVjIgRG9vcmJlbGwtY2FtZXJhLWZmbXBlZy1Gcm9udCBEb29yYmVsbC0wMDAwMDEyMS0wMDAwLTEwMDAtODAwMC0wMDI2QkI3NjUyOTE="},"payload":{"cause":{"type":"PHYSICAL_INTERACTION"},"timestamp":"2021-02-21T23:02:11.022Z"}}} 
ucsbricks commented 3 years ago

Updating to v0.5.27 did not solve the issue. Its completely unchanged. This is my current log

[22/02/2021, 00:14:41] [NFC 3] Starting the Timer
[22/02/2021, 00:14:42] [NFC 3] Time is Up!
[22/02/2021, 00:14:42] [NFC 3] Triggering Motion Sensor
2021-02-21T23:14:42.394Z hapNodeJSClient Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":1,"status":true}]
2021-02-21T23:14:42.395Z alexaActions Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":1,"status":true}]
2021-02-21T23:14:45.393Z hapNodeJSClient Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":0,"status":true}]
2021-02-21T23:14:45.393Z alexaActions Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":0,"status":true}]
NorthernMan54 commented 3 years ago

I added more debugging for the event message section, can you update to v0.5.28 and share the log

ucsbricks commented 3 years ago

I just updated to v0.5.28 but the log is still the same. No additional data… The last commit did nothing except increasing the version, or am I missing sth?

NorthernMan54 commented 3 years ago

Dugh, I did not hit save.....try 0.5.29

ucsbricks commented 3 years ago

HB does not recognize there’s an update to v0.5.29 so far…

ucsbricks commented 3 years ago
[22/02/2021, 00:47:53] [NFC 3] Starting the Timer
[22/02/2021, 00:47:53] [NFC 3] Time is Up!
[22/02/2021, 00:47:53] [NFC 3] Triggering Motion Sensor
2021-02-21T23:47:53.995Z hapNodeJSClient Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":1,"status":true}]
2021-02-21T23:47:53.995Z alexaActions Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":1,"status":true}]
2021-02-21T23:47:53.996Z alexaActions alexaEvent - event {
  host: '192.168.168.100',
  port: 51323,
  deviceID: 'XX:XX:XX:XX:XX:XX',
  aid: 118,
  iid: 13,
  value: 1,
  status: true
}
2021-02-21T23:47:53.998Z alexaActions alexaEvent - device {
  endpointID: 'XXXX',
  true: 'DETECTED',
  false: 'NOT_DETECTED',
  template: 'MotionSensor'
}
2021-02-21T23:47:54.001Z alexaActions alexaEvent - message {
  context: {},
  event: {
    header: {
      messageId: 'b53201e2-21cc-49d0-b892-021a9816d5a3',
      namespace: 'Alexa',
      name: 'ChangeReport',
      payloadVersion: '3'
    },
    endpoint: {
      endpointId: 'XXXX'
    },
    payload: { change: [Object] }
  }
}
2021-02-21T23:47:56.993Z hapNodeJSClient Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":0,"status":true}]
2021-02-21T23:47:56.993Z alexaActions Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":0,"status":true}]
2021-02-21T23:47:56.994Z alexaActions alexaEvent - event {
  host: '192.168.168.100',
  port: 51323,
  deviceID: 'XX:XX:XX:XX:XX:XX',
  aid: 118,
  iid: 13,
  value: 0,
  status: true
}
2021-02-21T23:47:56.996Z alexaActions alexaEvent - device {
  endpointID: 'XXXX',
  true: 'DETECTED',
  false: 'NOT_DETECTED',
  template: 'MotionSensor'
}
2021-02-21T23:47:56.996Z alexaActions alexaEvent - message {
  context: {},
  event: {
    header: {
      messageId: '11b40888-18dc-4e81-a899-6387ffe4a945',
      namespace: 'Alexa',
      name: 'ChangeReport',
      payloadVersion: '3'
    },
    endpoint: {
      endpointId: 'XXXX'
    },
    payload: { change: [Object] }
  }
}
NorthernMan54 commented 3 years ago

If your on discord, we can chat

ucsbricks commented 3 years ago

Unfortunately I am not… And I have to leave for today. It’s in the middle of the night here in Europe. Wake-up time is in about five hours :( Please let me know if I can help to further investigate the issue tomorrow.

NorthernMan54 commented 3 years ago

I see the issue

  '{"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13}': {
    endpointID: 'XXXXX',
    true: 'DETECTED',
    false: 'NOT_DETECTED',
    template: 'MotionSensor'
  },

versus

2021-02-21T23:47:56.993Z alexaActions Events [{"host":"192.168.168.100","port":51323,"deviceID":"XX:XX:XX:XX:XX:XX","aid":118,"iid":13,"value":0,"status":true}]

And have everything I need

NorthernMan54 commented 3 years ago

I just checked my own motion sensors as was able to confirm the issue and fix. If you update to v0.5.30 it should now be resolved

Before

hapNodeJSClient Events [{"host":"192.168.1.12","port":51829,"deviceID":"AC:22:3D:E3:CE:31","aid":2,"iid":10,"value":1,"status":true}] +11m
  alexaActions Events [{"host":"192.168.1.12","port":51829,"deviceID":"AC:22:3D:E3:CE:31","aid":2,"iid":10,"value":1,"status":true}] +11m

After

  hapNodeJSClient Events [{"host":"192.168.1.12","port":51829,"deviceID":"AC:22:3D:E3:CE:31","aid":2,"iid":10,"value":1,"status":true}] +45s
  alexaActions Events [{"host":"192.168.1.12","port":51829,"deviceID":"AC:22:3D:E3:CE:31","aid":2,"iid":10,"value":1,"status":true}] +45s
  alexaLocal Sending message {"context":{},"event":{"header":{"messageId":"875ffa55-5ee2-4cdd-8301-4eced9ed7315","namespace":"Alexa","name":"ChangeReport","payloadVersion":"3"},"endpoint":{"endpointId":"QUM6MjI6M0Q6RTM6Q0U6MzEtTGVvbmFyZC1BbWF6b24taG9tZWJyaWRnZS1ydGxfNDMzLUZyb250IFBvcmNoLTAwMDAwMDg1LTAwMDAtMTAwMC04MDAwLTAwMjZCQjc2NTI5MQ=="},"payload":{"change":{"cause":{"type":"PHYSICAL_INTERACTION"},"properties":[{"namespace":"Alexa.MotionSensor","name":"detectionState","value":"DETECTED","timeOfSample":"2021-02-22T00:01:32.284Z","uncertaintyInMilliseconds":500}]}}}}