senorshaun / homebridge-radiora2

Lutron RadioRA2 plugin for homebridge
MIT License
10 stars 5 forks source link

Home App state not updated at initialization time #7

Closed scottrus closed 2 years ago

scottrus commented 3 years ago

Issue: Fans are running but not reflected in the Home App status. Only seen at startup of the plugin/homebridge

Steps:

  1. Configure a Fan and verify it works
  2. Turn off fan
  3. Turn off Homebridge
  4. Turn on fan to 100% at switch
  5. Turn on Homebridge
  6. Check Home App and see Fan device still shows OFF instead of 100%

Note, that at startup, fan states are properly detected. Just state is not reflected in the Home App. After toggling in the Home App state is maintained as expected.

scottrus commented 3 years ago

Debug log showing fan states at start up. Unfortunately this is not reflected to Home App on iPhone. My working theory is that the percentages are not exactly multiples of 25 as expected.

Starting to advertise 'homebridge-radiora2 6104' using ciao backend!
[8/3/2021, 11:59:18 AM] Homebridge v1.3.4 (homebridge-radiora2) is running on port 39018.
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Connected to Lutron!
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded fan 'Porch Fan'
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded fan 'Scott's Fan'
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded fan 'Sean's Fan'
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded fan 'Sammy's Fan'
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded fan 'Guest Fan'
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded fan 'Bedroom Fan'
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded fan 'Bonus Room Fan'
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded 7 fan(s)
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded 0 light(s)
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded 0 occupancy sensor(s)
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded 0 keypad(s)
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded 0 visor control receiver(s)
[8/3/2021, 11:59:18 AM] [homebridge-radiora2] Loaded 0 HVAC controller(s)
[8/3/2021, 11:59:19 AM] [homebridge-radiora2] Accessory 'Porch Fan' turned OFF
[8/3/2021, 11:59:20 AM] [homebridge-radiora2] Accessory 'Scott's Fan' rotation speed set to 100.00%
[8/3/2021, 11:59:20 AM] [homebridge-radiora2] Accessory 'Sean's Fan' rotation speed set to 50.59%
[8/3/2021, 11:59:21 AM] [homebridge-radiora2] Accessory 'Sammy's Fan' rotation speed set to 100.00%
[8/3/2021, 11:59:21 AM] [homebridge-radiora2] Accessory 'Guest Fan' rotation speed set to 74.90%
[8/3/2021, 11:59:22 AM] [homebridge-radiora2] Accessory 'Bedroom Fan' turned OFF
[8/3/2021, 11:59:23 AM] [homebridge-radiora2] Accessory 'Bonus Room Fan' turned OFF
senorshaun commented 2 years ago

Found the simple fix. When polling an already running, I wasn't getting an 'on' packet, because it just reports fan speed. Updated the fan rotation code to make sure the status of the accessory is on. This will push in the next bug update (working on that now)