Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Unable to disable Adaptive Lighting #987

Open
1 task done
burmistrzak opened this issue Jan 4, 2025 · 6 comments
Open
1 task done

[Bug] Unable to disable Adaptive Lighting #987

burmistrzak opened this issue Jan 4, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@burmistrzak
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I tried disabling Adaptive Lighting for some of our RGBW+CT lights, to hopefully work around some weird UX bug in Home app.
Unfortunately, that didn’t work…

The issue seemingly affects all AL-capable lights, with or without color mode.
Per device settings like e.g.:

{
    "id": "0x000",
    "exclude": false,
    "converters": {
        "light": {
            "adaptive_lighting": false
        }
    }
}

are being ignored, and Adaptive Lighting is still available.
Setting "adaptive_lighting": false for the light converter globally, doesn’t work either.

I also checked the Homebridge accessory cache, and all lights do indeed have the additional AL-related characteristics.

Related devices

No response

Related Devices

No response

Steps To Reproduce

  1. Ensure Adaptive Lighting is disabled by default
  2. Selectively enable Adaptive Lighting for a CT light
  3. Disable Adaptive Lighting for any other light (RGBW and/or CT)

Expected behavior

Only the single, explicitly enabled light supports Adaptive Lighting in Home app, all other lights do not.

Device entry

No response

Status update

No response

Messages from this plugin

No response

This plugin

1.11.0-beta.6

Homebridge

1.8.5

Zigbee2MQTT

1.41.0-dev

Homebridge Config UI X (if applicable)

No response

@burmistrzak burmistrzak added the bug Something isn't working label Jan 4, 2025
@itavero
Copy link
Owner

itavero commented Jan 4, 2025

I vaguely recall someone mentioning something similar in #590.
Not sure if they found a solution.

@itavero
Copy link
Owner

itavero commented Jan 4, 2025

Have you power cycled your Apple home hub(s) as well?
I recall that they tend to cache stuff.

Or do you actually see something in the (debug) logs that indicates that it's on?

@burmistrzak
Copy link
Contributor Author

burmistrzak commented Jan 5, 2025

@itavero Here's what the Homebridge accessory cache file looks like:

RGBW+CT light fixture with Adaptive Lighting explicitly disabled:

                {
                    "id": "0xaaa",
                    "exclude": false,
                    "converters": {
                        "light": {
                            "adaptive_lighting": false
                        }
                    }
                }

results in the following cache entry:

		"displayName": "RGBW-CT-light",
		"UUID": "xxx",
		"category": 1,
		"services": [
			{
				"displayName": "",
				"UUID": "0000003E-0000-1000-8000-0026BB765291",
				"constructorName": "AccessoryInformation",
				"hiddenService": false,
				"primaryService": false,
				"characteristics": [
					{
						"displayName": "Identify",
						"UUID": "00000014-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Identify",
						"value": false,
						"props": { "format": "bool", "perms": ["pw"] }
					},
					{
						"displayName": "Manufacturer",
						"UUID": "00000020-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Manufacturer",
						"value": "Philips",
						"props": { "format": "string", "perms": ["pr"], "maxLen": 64 }
					},
					{
						"displayName": "Model",
						"UUID": "00000021-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Model",
						"value": "9290024896",
						"props": { "format": "string", "perms": ["pr"], "maxLen": 64 }
					},
					{
						"displayName": "Name",
						"UUID": "00000023-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Name",
						"value": "RGBW-CT-light",
						"props": { "format": "string", "perms": ["pr"], "maxLen": 64 }
					},
					{
						"displayName": "Serial Number",
						"UUID": "00000030-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "SerialNumber",
						"value": "0xaaa",
						"props": { "format": "string", "perms": ["pr"], "maxLen": 64 }
					},
					{
						"displayName": "Firmware Revision",
						"UUID": "00000052-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "FirmwareRevision",
						"value": "1.116.3",
						"props": { "format": "string", "perms": ["pr"] }
					},
					{
						"displayName": "Hardware Revision",
						"UUID": "00000053-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "HardwareRevision",
						"value": "20240329",
						"props": { "format": "string", "perms": ["pr"] }
					}
				],
				"optionalCharacteristics": [
					{
						"displayName": "Accessory Flags",
						"UUID": "000000A6-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "AccessoryFlags",
						"value": 0,
						"props": { "format": "uint32", "perms": ["ev", "pr"] }
					},
					{
						"displayName": "App Matching Identifier",
						"UUID": "000000A4-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "AppMatchingIdentifier",
						"value": "",
						"props": { "format": "tlv8", "perms": ["pr"] }
					},
					{
						"displayName": "Configured Name",
						"UUID": "000000E3-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "ConfiguredName",
						"value": "",
						"props": { "format": "string", "perms": ["ev", "pr", "pw"] }
					},
					{
						"displayName": "Hardware Finish",
						"UUID": "0000026C-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "HardwareFinish",
						"value": "",
						"props": { "format": "tlv8", "perms": ["pr"] }
					},
					{
						"displayName": "Hardware Revision",
						"UUID": "00000053-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "HardwareRevision",
						"value": "",
						"props": { "format": "string", "perms": ["pr"] }
					},
					{
						"displayName": "Product Data",
						"UUID": "00000220-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "ProductData",
						"value": "",
						"props": { "format": "data", "perms": ["pr"] }
					},
					{
						"displayName": "Software Revision",
						"UUID": "00000054-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "SoftwareRevision",
						"value": "",
						"props": { "format": "string", "perms": ["pr"] }
					}
				]
			},
			{
				"displayName": "RGBW-CT-light",
				"UUID": "00000043-0000-1000-8000-0026BB765291",
				"constructorName": "Lightbulb",
				"hiddenService": false,
				"primaryService": false,
				"characteristics": [
					{
						"displayName": "Name",
						"UUID": "00000023-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Name",
						"value": "RGBW-CT-light",
						"props": { "format": "string", "perms": ["pr"], "maxLen": 64 }
					},
					{
						"displayName": "On",
						"UUID": "00000025-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "On",
						"value": true,
						"props": { "format": "bool", "perms": ["ev", "pr", "pw"] }
					},
					{
						"displayName": "Brightness",
						"UUID": "00000008-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Brightness",
						"value": 86,
						"props": {
							"format": "int",
							"perms": ["ev", "pr", "pw"],
							"unit": "percentage",
							"minValue": 0,
							"maxValue": 100,
							"minStep": 1
						}
					},
					{
						"displayName": "Hue",
						"UUID": "00000013-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Hue",
						"value": 39,
						"props": {
							"format": "float",
							"perms": ["ev", "pr", "pw"],
							"unit": "arcdegrees",
							"minValue": 0,
							"maxValue": 360,
							"minStep": 1
						}
					},
					{
						"displayName": "Saturation",
						"UUID": "0000002F-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Saturation",
						"value": 54,
						"props": {
							"format": "float",
							"perms": ["ev", "pr", "pw"],
							"unit": "percentage",
							"minValue": 0,
							"maxValue": 100,
							"minStep": 1
						}
					},
					{
						"displayName": "Color Temperature",
						"UUID": "000000CE-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "ColorTemperature",
						"value": 370,
						"props": {
							"format": "int",
							"perms": ["ev", "pr", "pw"],
							"minValue": 153,
							"maxValue": 500,
							"minStep": 1
						}
					},
					{
						"displayName": "Supported Characteristic Value Transition Configuration",
						"UUID": "00000144-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "SupportedCharacteristicValueTransitionConfiguration",
						"value": "AQYBAQwCAQEAAAEGAQEPAgEC",
						"props": { "format": "tlv8", "perms": ["pr"] }
					},
					{
						"displayName": "Characteristic Value Transition Control",
						"UUID": "00000143-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "CharacteristicValueTransitionControl",
						"value": "",
						"props": { "format": "tlv8", "perms": ["pr", "pw", "wr"] }
					},
					{
						"displayName": "Characteristic Value Active Transition Count",
						"UUID": "0000024B-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "CharacteristicValueActiveTransitionCount",
						"value": 0,
						"props": { "format": "uint8", "perms": ["ev", "pr"] }
					}
				],
				"optionalCharacteristics": [
					{
						"displayName": "Brightness",
						"UUID": "00000008-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Brightness",
						"value": 0,
						"props": {
							"format": "int",
							"perms": ["ev", "pr", "pw"],
							"unit": "percentage",
							"minValue": 0,
							"maxValue": 100,
							"minStep": 1
						}
					},
					{
						"displayName": "Characteristic Value Active Transition Count",
						"UUID": "0000024B-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "CharacteristicValueActiveTransitionCount",
						"value": 0,
						"props": { "format": "uint8", "perms": ["ev", "pr"] }
					},
					{
						"displayName": "Characteristic Value Transition Control",
						"UUID": "00000143-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "CharacteristicValueTransitionControl",
						"value": "",
						"props": { "format": "tlv8", "perms": ["pr", "pw", "wr"] }
					},
					{
						"displayName": "Color Temperature",
						"UUID": "000000CE-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "ColorTemperature",
						"value": 140,
						"props": {
							"format": "int",
							"perms": ["ev", "pr", "pw"],
							"minValue": 140,
							"maxValue": 500,
							"minStep": 1
						}
					},
					{
						"displayName": "Hue",
						"UUID": "00000013-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Hue",
						"value": 0,
						"props": {
							"format": "float",
							"perms": ["ev", "pr", "pw"],
							"unit": "arcdegrees",
							"minValue": 0,
							"maxValue": 360,
							"minStep": 1
						}
					},
					{
						"displayName": "Name",
						"UUID": "00000023-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Name",
						"value": "",
						"props": { "format": "string", "perms": ["pr"], "maxLen": 64 }
					},
					{
						"displayName": "Saturation",
						"UUID": "0000002F-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "Saturation",
						"value": 0,
						"props": {
							"format": "float",
							"perms": ["ev", "pr", "pw"],
							"unit": "percentage",
							"minValue": 0,
							"maxValue": 100,
							"minStep": 1
						}
					},
					{
						"displayName": "Supported Characteristic Value Transition Configuration",
						"UUID": "00000144-0000-1000-8000-0026BB765291",
						"eventOnlyCharacteristic": false,
						"constructorName": "SupportedCharacteristicValueTransitionConfiguration",
						"value": "",
						"props": { "format": "tlv8", "perms": ["pr"] }
					}
				]
			}
		],
		"controllers": [
			{
				"type": "characteristic-transition-00000043-0000-1000-8000-0026BB765291",
				"services": {}
			}
		]

Edit: Deleted the light in question from cache and it was recreated with Adaptive Lighting characteristics, despite being disabled:

[1/5/2025, 2:29:26 AM] [homebridge-z2m] New accessory: RGBW-CT-light
[1/5/2025, 2:29:26 AM] [homebridge-z2m] Config for accessory RGBW-CT-light : {"exclude":false,"ignore_availability":false,"ignore_z2m_online":false,"excluded_keys":["linkquality","occupied_cooling_setpoint","co2","vibration","power_on_behavior","color_xy"],"values":[{"property":"system_mode","exclude":["cool","auto"]}],"converters":{"switch":{"type":"outlet"},"occupancy":{"type":"motion"},"light":{"adaptive_lighting":false}},"id":"0xaaa"}
[1/5/2025, 2:29:26 AM] [homebridge-z2m] Configuring Light for RGBW-CT-light
[1/5/2025, 2:29:26 AM] [homebridge-z2m] Updating service names for RGBW-CT-light (from RGBW-CT-light)
[1/5/2025, 2:29:26 AM] [homebridge-z2m] Pending get: state, color_temp, color
[1/5/2025, 2:29:26 AM] [homebridge-z2m] Availability feature for RGBW-CT-light is now disabled
[1/5/2025, 2:29:26 AM] [homebridge-z2m] availability (DIS): RGBW-CT-light: change status of characteristics to 0

@burmistrzak
Copy link
Contributor Author

@itavero Alright, so the only way I can disable Adaptive Lighting for a single accessory is to exclude color_temp for that lightbulb.
It seems like the first check here doesn’t quite work as expected:

// Adaptive lighting is not enabled
if (!this.adaptiveLightingEnabled) {
return;
}
// Need at least brightness and color temperature to add Adaptive Lighting
if (this.brightnessExpose === undefined || this.colorTempExpose === undefined) {
return;
}

I might have to add in a console.log to get the actual value of this.adaptiveLightingEnabled used… 🤔

@burmistrzak
Copy link
Contributor Author

Huh, that’s interesting…

this.adaptiveLightingEnabled is seemingly always set to true, despite being explicitly disabled!

@burmistrzak
Copy link
Contributor Author

@itavero This seems to be the culprit…

private get adaptiveLightingEnabled(): boolean {
return this.adaptiveLightingConfig !== undefined;
}

Setting { adaptive_lighting: false } for a specific device will cause this.adaptiveLightingEnabled to return true… 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants