Skip to content
This repository has been archived by the owner on Dec 23, 2020. It is now read-only.

Buttons don't work unless Home app is running #28

Open
llamafilm opened this issue Feb 23, 2020 · 1 comment
Open

Buttons don't work unless Home app is running #28

llamafilm opened this issue Feb 23, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@llamafilm
Copy link

llamafilm commented Feb 23, 2020

Node.js version:
v12.14.1

Plugin version:
[email protected]

I'm using a 5 button Pico remote with Caseta Bridge Pro. When I first launch homebridge, it doesn't register the buttons until I open Home.app (or control center). About 2 minutes after closing the Home app, it unregisters the buttons and they no longer work. After this, pressing buttons doesn't even write anything to the log. It works fine as long as I leave Home.app running on any iPhone or Mac. I can see in Telnet the buttons are always sending their signal to the Lutron hub, but the signal is not making it to Homebridge.

I think the unregistering behavior may be normal for iOS devices because I tried a switch from homebridge-dummy and it does the same thing. But I can't figure out why the lutron buttons stop working when they are unregistered.

HomePod with iOS 13.3.1. Homebridge 0.4.501 running on a Raspberry Pi Zero.
In this log, the .107 IP is the iPhone where I opened Home.app

21:02:04 EventedHTTPServer [::ffff:192.168.3.107] HTTP request: /characteristics
21:02:04 HAPServer [CB:22:3D:E2:CE:31] HAP Request: PUT /characteristics
21:02:04 Accessory [Homebridge] Processing characteristic set: [{"aid":2,"iid":10,"ev":true},{"aid":2,"iid":13,"ev":true},{"aid":2,"iid":16,"ev":true},{"aid":2,"iid":19,"ev":true},{"aid":2,"iid":22,"ev":true}]
21:02:04 Accessory [Homebridge] Registering Characteristic "Programmable Switch Event" for events
21:02:04 Accessory [Homebridge] Registering Characteristic "Programmable Switch Event" for events
21:02:04 Accessory [Homebridge] Registering Characteristic "Programmable Switch Event" for events
21:02:04 Accessory [Homebridge] Registering Characteristic "Programmable Switch Event" for events
21:02:04 Accessory [Homebridge] Registering Characteristic "Programmable Switch Event" for events
21:02:04 EventedHTTPServer [::ffff:192.168.3.107] HTTP Response is finished
......
21:03:30 EventedHTTPServer [::ffff:192.168.3.107] HTTP request: /characteristics
21:03:30 HAPServer [CB:22:3D:E2:CE:31] HAP Request: PUT /characteristics
21:03:30 Accessory [Homebridge] Processing characteristic set: [{"aid":2,"iid":10,"ev":false},{"aid":2,"iid":13,"ev":false},{"aid":2,"iid":16,"ev":false},{"aid":2,"iid":19,"ev":false},{"aid":2,"iid":22,"ev":false}]
21:03:30 Accessory [Homebridge] Unregistering Characteristic "Programmable Switch Event" for events
21:03:30 Accessory [Homebridge] Unregistering Characteristic "Programmable Switch Event" for events
21:03:30 Accessory [Homebridge] Unregistering Characteristic "Programmable Switch Event" for events
21:03:30 Accessory [Homebridge] Unregistering Characteristic "Programmable Switch Event" for events
21:03:31 Accessory [Homebridge] Unregistering Characteristic "Programmable Switch Event" for events
21:03:31 EventedHTTPServer [::ffff:192.168.3.107] HTTP Response is finished
21:03:31 EventedHTTPServer [::ffff:192.168.3.107] HTTP request: /characteristics
21:03:31 HAPServer [CB:22:3D:E2:CE:31] HAP Request: PUT /characteristics
21:03:31 Accessory [Homebridge] Processing characteristic set: [{"aid":1,"iid":9,"ev":false},{"aid":1,"iid":10,"ev":false},{"aid":1,"iid":11,"ev":false}]
21:03:31 Accessory [Homebridge] Unregistering Characteristic "State" for events
21:03:31 Accessory [Homebridge] Unregistering Characteristic "Version" for events
21:03:31 Accessory [Homebridge] Unregistering Characteristic "Control Point" for events
21:03:31 EventedHTTPServer [::ffff:192.168.3.107] HTTP Response is finished
@llamafilm llamafilm added the bug Something isn't working label Feb 23, 2020
@llamafilm
Copy link
Author

I added some console.log statements for debugging, and found that the plugin does recognize every button press. It gets as far as executing accessory._dispatchMonitorMessage() but the difference is characteristic.subscriptions = 1 when Home app is running, but it equals zero when Home app is not running. After this, it executes characteristic.setValue(0) and then it seems like that's the end of the plugin. So I'm not sure where to go from here.

Characteristic {
  displayName: 'Programmable Switch Event',
  UUID: '00000073-0000-1000-8000-0026BB765291',
  iid: 10,
  value: 0,
  status: null,
  eventOnlyCharacteristic: true,
  props: {
    format: 'uint8',
    unit: null,
    minValue: 0,
    maxValue: 2,
    minStep: null,
    perms: [ 'pr', 'ev' ],
    validValues: [ 0, 1, 2 ]
  },
  subscriptions: 0,
  _events: [Object: null prototype] { change: [Function: bound ] },
  _eventsCount: 1
}

@smockle smockle removed their assignment Sep 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants