ebaauw / homebridge-hue

Homebridge plugin for Philips Hue
Apache License 2.0
898 stars 91 forks source link

Sync problems between hue app and homebridge #1075

Closed agido-freudenreich closed 2 years ago

agido-freudenreich commented 2 years ago

Issue

I've synchronization problems between the homebridge/homekit state and the state in the hue app. The problem is not always reproducible, seems to be a timing issue.

It seems that the external state (hue) is overwritten by the homebridge/homekit state.

Log Messages

[9.1.2022, 14:42:18] [Hue] Esszimmer: group xy changed from [0.4633,0.3604] to [0.3972,0.388]
[9.1.2022, 14:42:18] [Hue] Esszimmer: set homekit hue from 53˚ to 42˚
[9.1.2022, 14:42:18] [Hue] Esszimmer: set homekit saturation from 11% to 33%
[9.1.2022, 14:42:18] [Hue] Wohnbereich: group all_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Wohnbereich: group any_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Wohnbereich: set homekit any on from true to false
[9.1.2022, 14:42:18] [Hue] Wohnbereich: group xy changed by ct from [0.3966,0.3863] to [0.3972,0.388]
[9.1.2022, 14:42:18] [Hue] Wohnbereich: set homekit color temperature from 197 mired to 273 mired
[9.1.2022, 14:42:18] [Hue] Group 1: group all_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Group 1: set homekit on from true to false
[9.1.2022, 14:42:18] [Hue] Group 1: group any_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Group 1: set homekit any on from true to false
[9.1.2022, 14:42:18] [Hue] Group 1: group xy changed from [0.4633,0.3604] to [0.3972,0.388]
[9.1.2022, 14:42:18] [Hue] Group 1: set homekit hue from 53˚ to 42˚
[9.1.2022, 14:42:18] [Hue] Group 1: set homekit saturation from 11% to 33%
[9.1.2022, 14:42:18] [Hue] Group 2: group all_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Group 2: set homekit on from true to false
[9.1.2022, 14:42:18] [Hue] Group 2: group any_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Group 2: set homekit any on from true to false
[9.1.2022, 14:42:18] [Hue] Group 2: group xy changed from [0.6021,0.3781] to [0.3972,0.388]
[9.1.2022, 14:42:18] [Hue] Group 2: set homekit hue from 53˚ to 42˚
[9.1.2022, 14:42:18] [Hue] Group 2: set homekit saturation from 11% to 33%
[9.1.2022, 14:42:18] [Hue] Küche: group all_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Küche: group any_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Küche: set homekit any on from true to false
[9.1.2022, 14:42:18] [Hue] Küche: group xy changed from [0.2913,0.2215] to [0.3972,0.388]
[9.1.2022, 14:42:18] [Hue] Küche: set homekit hue from 53˚ to 42˚
[9.1.2022, 14:42:18] [Hue] Küche: set homekit saturation from 11% to 33%
[9.1.2022, 14:42:18] [Hue] Couch: group all_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Couch: group any_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Couch: set homekit any on from true to false
[9.1.2022, 14:42:18] [Hue] Couch: group xy changed from [0.2913,0.2215] to [0.3972,0.388]
[9.1.2022, 14:42:18] [Hue] Couch: set homekit hue from 15˚ to 42˚
[9.1.2022, 14:42:18] [Hue] Couch: set homekit saturation from 85% to 33%
[9.1.2022, 14:42:18] [Hue] Sideboard: group all_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Sideboard: group any_on changed from true to false
[9.1.2022, 14:42:18] [Hue] Sideboard: set homekit any on from true to false
[9.1.2022, 14:42:18] [Hue] Sideboard: group xy changed from [0.4633,0.3604] to [0.3972,0.388]
[9.1.2022, 14:42:18] [Hue] Sideboard: set homekit hue from 53˚ to 42˚
[9.1.2022, 14:42:18] [Hue] Sideboard: set homekit saturation from 11% to 33%
[9.1.2022, 14:42:23] [Hue] Philips hue: request 185: GET /groups
[9.1.2022, 14:42:23] [Hue] Philips hue: request 185: 200 OK
[9.1.2022, 14:42:23] [Hue] Wohnzimmer: group ct changed from 197 to 273
[9.1.2022, 14:42:23] [Hue] Wohnzimmer: set homekit color temperature from 197 mired to 273 mired
[9.1.2022, 14:42:23] [Hue] Esszimmer: group ct changed from 197 to 273
[9.1.2022, 14:42:23] [Hue] Esszimmer: set homekit color temperature from 197 mired to 273 mired
[9.1.2022, 14:42:23] [Hue] Group 1: group ct changed from 197 to 273
[9.1.2022, 14:42:23] [Hue] Group 1: set homekit color temperature from 197 mired to 273 mired
[9.1.2022, 14:42:23] [Hue] Group 2: group ct changed from 197 to 273
[9.1.2022, 14:42:23] [Hue] Group 2: set homekit color temperature from 197 mired to 273 mired
[9.1.2022, 14:42:23] [Hue] Küche: group ct changed from 197 to 273
[9.1.2022, 14:42:23] [Hue] Küche: set homekit color temperature from 197 mired to 273 mired
[9.1.2022, 14:42:23] [Hue] Couch: group ct changed from 197 to 273
[9.1.2022, 14:42:23] [Hue] Couch: set homekit color temperature from 197 mired to 273 mired
[9.1.2022, 14:42:23] [Hue] Sideboard: group ct changed from 197 to 273
[9.1.2022, 14:42:23] [Hue] Sideboard: set homekit color temperature from 197 mired to 273 mired

Debug Files

homebridge-hue (1).json.gz

ebaauw commented 2 years ago

This part of the log shows no brightness change, neither by Homebridge Hue, nor by the Hue app (or another Hue client). Do the lights change physically or does only the state in HomeKit change?

You're exposing groups to HomeKit, instead of individual lights. Are you also looking at the group in the Hue app, or at the individual lights? Except for all_on and any_on, the Hue bridge maintains no group state. The action mostly echoes the state of the last light changed, instead of the average group state.

agido-freudenreich commented 2 years ago

Next try:

[10.1.2022, 06:45:08] [Hue] Philips hue: 13 accessories
[10.1.2022, 06:45:08] [Hue] masked debug info dumped to C:\Users\xobit\.homebridge/homebridge-hue.json.gz
[10.1.2022, 06:45:08] Initializing platform accessory 'Philips hue'...
[10.1.2022, 06:45:08] [Hue] Philips hue: 2 services
[10.1.2022, 06:45:08] Initializing platform accessory 'Wohnzimmer'...
[10.1.2022, 06:45:08] Initializing platform accessory 'Terrasse'...
[10.1.2022, 06:45:08] Initializing platform accessory 'Eingangstür'...
[10.1.2022, 06:45:08] Initializing platform accessory 'Esszimmer'...
[10.1.2022, 06:45:08] Initializing platform accessory 'Wohnbereich'...
[10.1.2022, 06:45:08] Initializing platform accessory 'Group 1'...
[10.1.2022, 06:45:08] Initializing platform accessory 'Group 2'...
[10.1.2022, 06:45:08] Initializing platform accessory 'Arbeitszimmer'...
[10.1.2022, 06:45:08] Initializing platform accessory 'HWR'...
[10.1.2022, 06:45:08] Initializing platform accessory 'Küche'...
[10.1.2022, 06:45:08] Initializing platform accessory 'Couch'...
[10.1.2022, 06:45:08] Initializing platform accessory 'Sideboard'...
[10.1.2022, 06:45:08] Homebridge v1.3.9 (HAP v0.9.8) (Homebridge 689F) is running on port 51653.
[10.1.2022, 06:45:08] [Hue] Philips hue: event stream connected to https://192.168.1.14/eventstream/clip/v2
[10.1.2022, 06:45:09] [Hue] Wohnzimmer: set homekit supported transition configuration to {"configuration":[{"iid":12,"characteristic":1},{"iid":14,"characteristic":2}]}
[10.1.2022, 06:45:09] [Hue] Terrasse: set homekit supported transition configuration to {"configuration":[{"iid":12,"characteristic":1},{"iid":14,"characteristic":2}]}
[10.1.2022, 06:45:09] [Hue] Eingangstür: set homekit supported transition configuration to {"configuration":[{"iid":12,"characteristic":1},{"iid":14,"characteristic":2}]}
[10.1.2022, 06:45:09] [Hue] Esszimmer: set homekit supported transition configuration to {"configuration":[{"iid":12,"characteristic":1},{"iid":14,"characteristic":2}]}
[10.1.2022, 06:45:09] [Hue] Wohnbereich: set homekit supported transition configuration to {"configuration":[{"iid":12,"characteristic":1},{"iid":14,"characteristic":2}]}
[10.1.2022, 06:45:09] [Hue] Group 1: set homekit supported transition configuration to {"configuration":[{"iid":13,"characteristic":1},{"iid":15,"characteristic":2}]}
[10.1.2022, 06:45:09] [Hue] Group 2: set homekit supported transition configuration to {"configuration":[{"iid":13,"characteristic":1},{"iid":15,"characteristic":2}]}
[10.1.2022, 06:45:09] [Hue] Küche: set homekit supported transition configuration to {"configuration":[{"iid":12,"characteristic":1},{"iid":14,"characteristic":2}]}
[10.1.2022, 06:45:09] [Hue] Couch: set homekit supported transition configuration to {"configuration":[{"iid":12,"characteristic":1},{"iid":14,"characteristic":2}]}
[10.1.2022, 06:45:09] [Hue] Sideboard: set homekit supported transition configuration to {"configuration":[{"iid":12,"characteristic":1},{"iid":14,"characteristic":2}]}
[10.1.2022, 06:45:34] [Hue] Couch: homekit on changed from false to true
[10.1.2022, 06:45:35] [Hue] Wohnzimmer: set homekit on from false to true
[10.1.2022, 06:45:35] [Hue] Wohnbereich: set homekit on from false to true
[10.1.2022, 06:45:39] [Hue] Couch: homekit on changed from true to false
[10.1.2022, 06:45:39] [Hue] Wohnzimmer: set homekit on from true to false
[10.1.2022, 06:45:39] [Hue] Wohnzimmer: set homekit any on from false to true
[10.1.2022, 06:45:39] [Hue] Wohnbereich: set homekit on from true to false
[10.1.2022, 06:45:39] [Hue] Wohnbereich: set homekit any on from false to true
[10.1.2022, 06:45:44] [BuschJaegerSysAp] Updating accessory Raumtemperaturregler with uuid ABB7F5967846ch0000
[10.1.2022, 06:45:44] [Hue] Wohnzimmer: set homekit any on from true to false
[10.1.2022, 06:45:44] [Hue] Wohnbereich: set homekit any on from true to false
[10.1.2022, 06:45:46] [Hue] Wohnzimmer: set homekit on from false to true
[10.1.2022, 06:45:46] [Hue] Esszimmer: set homekit on from false to true
[10.1.2022, 06:45:46] [Hue] Wohnbereich: set homekit on from false to true
[10.1.2022, 06:45:46] [Hue] Küche: set homekit on from false to true
[10.1.2022, 06:45:46] [Hue] Couch: set homekit on from false to true
[10.1.2022, 06:45:46] [Hue] Sideboard: set homekit on from false to true
[10.1.2022, 06:45:47] [BuschJaegerSysAp] Updating accessory Raumtemperaturregler with uuid ABB7F4FB6A30ch0000
[10.1.2022, 06:45:49] [Hue] Wohnzimmer: set homekit any on from false to true
[10.1.2022, 06:45:49] [Hue] Wohnzimmer: set homekit brightness from 100% to 78%
[10.1.2022, 06:45:49] [Hue] Wohnzimmer: set homekit hue from 39˚ to 15˚
[10.1.2022, 06:45:49] [Hue] Wohnzimmer: set homekit saturation from 53% to 85%
[10.1.2022, 06:45:49] [Hue] Esszimmer: set homekit any on from false to true
[10.1.2022, 06:45:49] [Hue] Esszimmer: set homekit brightness from 100% to 78%
[10.1.2022, 06:45:49] [Hue] Wohnbereich: set homekit any on from false to true
[10.1.2022, 06:45:49] [Hue] Wohnbereich: set homekit brightness from 100% to 91%
[10.1.2022, 06:45:49] [Hue] Group 1: set homekit on from false to true
[10.1.2022, 06:45:49] [Hue] Group 1: set homekit any on from false to true
[10.1.2022, 06:45:49] [Hue] Group 1: set homekit brightness from 100% to 78%
[10.1.2022, 06:45:49] [Hue] Group 1: set homekit hue from 39˚ to 18˚
[10.1.2022, 06:45:49] [Hue] Group 1: set homekit saturation from 53% to 74%
[10.1.2022, 06:45:49] [Hue] Group 2: set homekit on from false to true
[10.1.2022, 06:45:49] [Hue] Group 2: set homekit any on from false to true
[10.1.2022, 06:45:49] [Hue] Group 2: set homekit brightness from 100% to 78%
[10.1.2022, 06:45:49] [Hue] Group 2: set homekit hue from 39˚ to 15˚
[10.1.2022, 06:45:49] [Hue] Group 2: set homekit saturation from 53% to 85%
[10.1.2022, 06:45:49] [Hue] Küche: set homekit any on from false to true
[10.1.2022, 06:45:49] [Hue] Küche: set homekit brightness from 100% to 78%
[10.1.2022, 06:45:49] [Hue] Couch: set homekit any on from false to true
[10.1.2022, 06:45:49] [Hue] Couch: set homekit brightness from 100% to 78%
[10.1.2022, 06:45:49] [Hue] Sideboard: set homekit any on from false to true
[10.1.2022, 06:45:49] [Hue] Sideboard: set homekit brightness from 100% to 78%
[10.1.2022, 06:45:49] [Hue] Sideboard: set homekit hue from 39˚ to 18˚
[10.1.2022, 06:45:49] [Hue] Sideboard: set homekit saturation from 53% to 74%
[10.1.2022, 06:45:58] [Hue] Wohnzimmer: set homekit on from true to false
[10.1.2022, 06:45:58] [Hue] Esszimmer: set homekit on from true to false
[10.1.2022, 06:45:58] [Hue] Wohnbereich: set homekit on from true to false
[10.1.2022, 06:45:58] [Hue] Küche: set homekit on from true to false
[10.1.2022, 06:45:58] [Hue] Couch: set homekit on from true to false
[10.1.2022, 06:45:58] [Hue] Sideboard: set homekit on from true to false
[10.1.2022, 06:45:59] [Hue] Wohnzimmer: set homekit any on from true to false
[10.1.2022, 06:45:59] [Hue] Esszimmer: set homekit any on from true to false
[10.1.2022, 06:45:59] [Hue] Wohnbereich: set homekit any on from true to false
[10.1.2022, 06:45:59] [Hue] Group 1: set homekit on from true to false
[10.1.2022, 06:45:59] [Hue] Group 1: set homekit any on from true to false
[10.1.2022, 06:45:59] [Hue] Group 2: set homekit on from true to false
[10.1.2022, 06:45:59] [Hue] Group 2: set homekit any on from true to false
[10.1.2022, 06:45:59] [Hue] Küche: set homekit any on from true to false
[10.1.2022, 06:45:59] [Hue] Couch: set homekit any on from true to false
[10.1.2022, 06:45:59] [Hue] Sideboard: set homekit any on from true to false
[10.1.2022, 06:46:02] [Hue] Couch: homekit on changed from false to true
[10.1.2022, 06:46:03] [Hue] Wohnzimmer: set homekit on from false to true
[10.1.2022, 06:46:03] [Hue] Wohnbereich: set homekit on from false to true
[10.1.2022, 06:46:04] [Hue] Wohnzimmer: set homekit on from true to false
[10.1.2022, 06:46:04] [Hue] Wohnzimmer: set homekit any on from false to true
[10.1.2022, 06:46:04] [Hue] Wohnbereich: set homekit on from true to false
[10.1.2022, 06:46:04] [Hue] Wohnbereich: set homekit any on from false to true
[10.1.2022, 06:46:04] [Hue] Couch: set homekit any on from false to true
[10.1.2022, 06:46:06] [Hue] Couch: homekit brightness changed from 78% to 98%
[10.1.2022, 06:46:07] [Hue] Couch: homekit brightness changed from 98% to 100%
[10.1.2022, 06:46:07] [BuschJaegerSysAp] Updating accessory Raumtemperaturregler with uuid ABB7F5967824ch0000
[10.1.2022, 06:46:08] [Hue] Couch: homekit hue changed from 15˚ to 251˚
[10.1.2022, 06:46:08] [Hue] Couch: homekit saturation changed from 85% to 5%
[10.1.2022, 06:46:10] [Hue] Couch: homekit transition control set to {"colorTemperature":{"iid":14,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2022-01-10T05:46:10.964Z","2.1.2.3":"73D8252359D93D1D"},"runtime":1,"curve":{"entries":[{"adjustmentFactor":-1.144444465637207,"mired":412.4444580078125,"offset":0},{"adjustmentFactor":-1.1333333253860474,"mired":407.3333435058594,"offset":830000},{"adjustmentFactor":-1.1888889074325562,"mired":395.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2999999523162842,"mired":385,"offset":1800000},{"adjustmentFactor":-1.4222222566604614,"mired":375.22222900390625,"offset":1800000},{"adjustmentFactor":-1.5333333015441895,"mired":367.3333435058594,"offset":1800000},{"adjustmentFactor":-1.600000023841858,"mired":360,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":352.77777099609375,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":350.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":349.77777099609375,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":350.5555419921875,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6111111640930176,"mired":352.1111145019531,"offset":1800000},{"adjustmentFactor":-1.5555555820465088,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.4666666984558105,"mired":358.6666564941406,"offset":1800000},{"adjustmentFactor":-1.3777778148651123,"mired":364.77777099609375,"offset":1800000},{"adjustmentFactor":-1.288888931274414,"mired":371.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2333333492279053,"mired":382.3333435058594,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":397.4444580078125,"offset":1800000},{"adjustmentFactor":-1.3111110925674438,"mired":416.1111145019531,"offset":1800000},{"adjustmentFactor":-1.4555555582046509,"mired":439.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6333333253860474,"mired":463.3333435058594,"offset":1800000},{"adjustmentFactor":-1.8333333730697632,"mired":487.3333435058594,"offset":1800000},{"adjustmentFactor":-2,"mired":508,"offset":1800000},{"adjustmentFactor":-2.0888888835906982,"mired":520.888916015625,"offset":1800000},{"adjustmentFactor":-2.0333333015441895,"mired":520.3333129882812,"offset":1800000},{"adjustmentFactor":-1.9777777194976807,"mired":519.7777709960938,"offset":1800000},{"adjustmentFactor":-1.8777778148651123,"mired":515.7777709960938,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":1800000},{"adjustmentFactor":-1.8111110925674438,"mired":512.111083984375,"offset":1800000,"duration":10800000},{"adjustmentFactor":-1.755555510520935,"mired":503.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6666666269302368,"mired":490.6666564941406,"offset":1800000},{"adjustmentFactor":-1.5777777433395386,"mired":476.77777099609375,"offset":1800000},{"adjustmentFactor":-1.4777777194976807,"mired":462.77777099609375,"offset":1800000},{"adjustmentFactor":-1.355555534362793,"mired":447.5555419921875,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":433.4444580078125,"offset":1800000},{"adjustmentFactor":-1.1555556058883667,"mired":419.5555419921875,"offset":1800000},{"adjustmentFactor":-1.144444465637207,"mired":412.4444580078125,"offset":970000}],"adjustmentIid":12,"adjustmentRange":{"min":10,"max":100}},"updateInterval":60000,"notifyIntervalThreshold":600000}}
[10.1.2022, 06:46:10] [Hue] Couch: set homekit transition control to {"colorTemperature":{"iid":14,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2022-01-10T05:46:10.964Z","2.1.2.3":"73D8252359D93D1D"},"runtime":1}}
[10.1.2022, 06:46:10] [Hue] Couch: set homekit active transition count to 1
[10.1.2022, 06:46:10] [Hue] Couch: homekit adaptive lighting color temperature changed from 367 mired to 298 mired
[10.1.2022, 06:46:10] [Hue] Couch: set homekit transition control to {"colorTemperature":{"iid":14,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2022-01-10T05:46:10.964Z","2.1.2.3":"73D8252359D93D1D"},"runtime":1}}
[10.1.2022, 06:46:11] [Hue] Couch: set homekit hue from 251˚ to 41˚
[10.1.2022, 06:46:11] [Hue] Couch: set homekit saturation from 5% to 38%
[10.1.2022, 06:46:11] [Hue] Couch: set homekit transition control to {"colorTemperature":{"iid":14,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2022-01-10T05:46:10.964Z","2.1.2.3":"73D8252359D93D1D"},"runtime":265}}
[10.1.2022, 06:46:16] [Hue] Couch: homekit on changed from true to false
[10.1.2022, 06:46:19] [Hue] Wohnzimmer: set homekit any on from true to false
[10.1.2022, 06:46:19] [Hue] Wohnbereich: set homekit any on from true to false
[10.1.2022, 06:46:19] [Hue] Couch: set homekit any on from true to false
[10.1.2022, 06:46:27] [Hue] Wohnzimmer: set homekit on from false to true
[10.1.2022, 06:46:27] [Hue] Wohnbereich: set homekit on from false to true
[10.1.2022, 06:46:27] [Hue] Couch: set homekit on from false to true
[10.1.2022, 06:46:29] [Hue] Wohnzimmer: set homekit on from true to false
[10.1.2022, 06:46:29] [Hue] Wohnzimmer: set homekit any on from false to true
[10.1.2022, 06:46:29] [Hue] Wohnbereich: set homekit on from true to false
[10.1.2022, 06:46:29] [Hue] Wohnbereich: set homekit any on from false to true
[10.1.2022, 06:46:29] [Hue] Couch: set homekit any on from false to true
[10.1.2022, 06:46:29] [Hue] Couch: set homekit brightness from 100% to 48%
[10.1.2022, 06:46:29] [Hue] Couch: homekit adaptive lighting color temperature changed from 298 mired to 357 mired
[10.1.2022, 06:46:29] [Hue] Couch: set homekit color temperature from 357 mired to 298 mired
[10.1.2022, 06:46:29] [Hue] Couch: set homekit hue from 41˚ to 39˚
[10.1.2022, 06:46:29] [Hue] Couch: set homekit saturation from 38% to 51%
[10.1.2022, 06:46:34] [Hue] Wohnzimmer: set homekit any on from true to false
[10.1.2022, 06:46:34] [Hue] Wohnbereich: set homekit any on from true to false
[10.1.2022, 06:46:34] [Hue] Couch: set homekit on from true to false
[10.1.2022, 06:46:34] [Hue] Couch: set homekit any on from true to false
[10.1.2022, 06:46:34] [Hue] Couch: set homekit color temperature from 298 mired to 357 mired

The lights change physically.

Now I can reproduce it reliably:

It seems that homekit always wins.

ebaauw commented 2 years ago

Next time, please attach a logfile.

You didn’t run Homebridge in DEBUG, so the API calls Homebridge Hue makes aren’t listed, but I think I see a hint of what’s going on. You have adaptive lighting enabled on the groups. So when the Hue bridge reports a change of the group, which is actually a change of the state of one of the lights in that group, Homebridge Hue adjusts the group accordingly.

agido-freudenreich commented 2 years ago

Sorry. Do you need more information or can I just disable adaptive lightning for groups somewhere? I only need homekit for automations like "Good morning" and "Good night" and use the Hue app for the rest.

ebaauw commented 2 years ago

Adaptive lighting can only be enabled from Home, by activating the corresponding scene (preset). It’s disabled by activating another scene in Home. It is disabled automatically by Homebridge Hue when the light’s colour has changed, but Homebridge Hue currently doesn’t do that for a manual change in colour temperature.

Basically, exposing Hue bridge groups to HomeKit only makes sense, when all lights in that group always should have the same state. I’m not sure even sure exposing adaptive lighting on groups was a good idea; tbh, I never tested this myself.

agido-freudenreich commented 2 years ago

In case of automations like "good morning" all lights of a group should have the same state (on, 100%). In case of hue scenes all lights of a group can have different states. Would it fix the problem if I would change the automations from group to specific lights and disable exposing groups at all?

ebaauw commented 2 years ago

I think it would. The problem is not so much exposing a group, as it is basing automations, or enabling adaptive lighting, on a group. Especially when those automations act on the same group, and you might want member lights to have different states.

A Zigbee group is basically write-only. Technically, it’s just a multicast address to which a light subscribes, rather than a virtual device that maintains state, as presented by the Hue or deCONZ API.
Likewise, a Zigbee scene is just an ID, under which each light stores its target state. That’s why it’s so damn efficient: the bridge/gateway only broadcasts (multicasts) the scene ID, rather than having to sending the target state for each individual light.

The deCONZ API treats the group action pretty much as write-only, just echoing the last values written to it. The Hue API, on the other hand, updates the group action with the most recently received changed (?)state of a member light. This causes issues if you base HomeKit automations on the group “state” when it doesn’t reflect the state of each light in the group. Especially when those automations subsequently update the group action, forcing the same state to all member lights. And this is exactly what adaptive lighting does: updating the ct on changed bri (and periodically as well).

ebaauw commented 2 years ago

Sorry, wrong button.

agido-freudenreich commented 2 years ago

Thanks for the detailed explanation. I removed the groups but still got the issue, also with single lights. After adjusting the scenes "good morning" and "good night" from adaptive lighting to "normal" on/off it works as expected and the hue state is not longer overwritten. If I'm honest I wasn't aware of adaptive lighting before. I just configured any bright color to get awake in the morning and I don't need adaptive lighting at all.

Thanks for the quick feedback and help, really appreciate it.