Hi there,
I really do not know where to start this, I think there is something not working as expected, I know there have been some changes to stuff involved recently, but writing a bug report seems inappropriate at this point because I can’t pin it to a specific integration.
So just let me describe my problem.
I recently bought an RGBWW light controlled with a MiLight controller. I didn’t want to get a remote because I wanted to control it with HA and Homekit and I already knew of the “esp8266_milight_hub” project.
So I set this up and worked great, configured for auto discovery with HA and there you go.
Here my card config and a screenshot of the detailed card:
type: button
tap_action:
action: toggle
entity: light.buro
This is based on the auto config via MQTT by the milight hub, the message the hub send looks like this:
{
"schema": "json",
"name": "Büro",
"command_topic": "milight/0x721/rgb_cct/1",
"state_topic": "milight/states/0x721/rgb_cct/1",
"uniq_id": "136029-Büro",
"device": {
"manufacturer": "esp8266_milight_hub",
"sw_version": "1.10.7",
"identifiers": [
1269801,
1825,
"rgb_cct",
1
]
},
"availability_topic": "milight/client_status",
"payload_available": "connected",
"payload_not_available": "disconnected",
"brightness": true,
"effect": true,
"effect_list": [
"night_mode",
"white_mode",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8"
],
"rgb": true,
"color_temp": true
}
So as far as I know and regarding to the docs of HA this is not fully correct anymore. There is an open issue in the milight hub project that HA changed something but obviously it still works.
Now we get to my real issues. I also use Homekit and the light is published to Homekit. And because it can color and color temperature I can set that too there. Color works but color temperature does not as expected. Instead of setting color temp value it changes the color.
I monitored the MQTT messages sent when I change the color and color temp with HA and Homekit and obviously they are different:
changing color temp with HA:
{
"state": "ON",
"color_temp": 186
}
changing color temp with Homekit:
{
"state": "ON",
"color": {
"r": 255,
"g": 167,
"b": 79
}
}
As said before Homekit has two seperate controls for color and temperature but both just generate color change messages. So this seems to be an issue with the Homekit integration I assume.
But things get strange, to track this down I tried to create a dummy light with a manual MQTT light. But I am not able to create a light behaving like the one from auto dicovery. Here is my code:
light:
- platform: mqtt
schema: json
name: mqtt_json_light_1
command_topic: 'home/rgb1/light/switch'
state_topic: 'home/rgb1/light/status'
unique_id: mqtt_json_light_1
availability_topic: 'home/rgb1/client_status'
payload_available: 'connected'
payload_not_available: 'disconnected'
brightness: true
effect: true
effect_list:
- 'night_mode'
rgb: true
color_temp: true
I tried to convert all what the auto discovery gets from the message above but this is what I get as a detailed card in lovelace:
The color and color temp configuration is missing. But “Supported color modes” are there so why are the controls missing?
I also tried to set it up as it is now in the docs, “rgb” and “color_temp” and “brightness” do not exists there anymore, there is “color_mode” now and “supported_color_modes” but no success. I am not able to configure a manual MQTT light to show the card in lovelace like the one for the auto discovered entity.
Any ideas?
~Alexander