-
Notifications
You must be signed in to change notification settings - Fork 223
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
Domoticz 2024.7 fails with v1.13 #854
Comments
Hello! The backend changes in 1.13 are pretty limited and shouldn't cause any issues like this. Can you try downgrading to 1.12 and see if it still works? State output shouldn't be any different as long as your config hasn't changed. I don't use domoticz, so hard for me be super helpful here. Happy to fix anything that's broken, but might need a hand isolating the issue. |
Thanks for the reply. "brightness": true,
"rgb": true, {
"dev_cla": "light",
"schema": "json",
"name": "Lampje Spare",
"cmd_t": "milight/commands/0xAX2D/rgbw/4",
"stat_t": "milight/state/0xAX2D/rgbw/4",
"uniq_id": "CC8789-Lampje Spare",
"dev": {
"name": "milight-hub",
"sw": "esp8266_milight_hub v1.13.0",
"mf": "espressif",
"mdl": "d1_mini",
"identifiers": "13404041",
"cu": "http://192.168.xx.yy"
},
"avty_t": "milight/client_status",
"pl_avail": "connected",
"pl_not_avail": "disconnected",
"effect": true,
"fx_list": [
"night_mode",
"white_mode",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8"
],
"sup_clrm": [
"rgb"
]
} |
Ah, this was actually a change in 1.12. Unfortunately it was necessary to fix compatibility issues with HomeAssistant. Does Domoticz keep this up to date? |
Depends on definition of 'keeps this up 2 date' I guess. Hence why ' deprecated ' was shown in HA ? I raised: domoticz/domoticz#6214, however I do not have the knowledge to explain what needs to be changed. |
Yeah, it's documented reasonably well. It's just not really a standard -- just something HomeAssistant came up with. https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery It's probably best that I follow HomeAssistant's changes, but would happily add more specific support for other automation platforms. |
Interesting. According to: https://wiki.domoticz.com/MQTT#Add_hardware_%22MQTT_Auto_Discovery_Client_Gateway%22 It states "From Stable 2022.1 Domoticz MQTT supports Home assistant MQTT Discovery". With the new FW Homeassistant works indeed with the HUB and the Milights.. That basically sums up the issue ;-) So basically with the new FW the devices are recognized as regular switch (ON/OFF) If Domoticz as stated "supports Home assistant MQTT Discovery" it is necessary to update that code. However as the auto-discovery is a generic module (also supporting zigbee2mqtt, zwave-js-ui e.g.) I don't know if that is possible. As I am using Domoticz & Homeassistant to play with the lights I do not see how adjusting the hub code would be able to support both. (but then again. I am not a developer...) What are your thoughts?? |
Yeah, if their intention is to be compatible with HomeAssistant's discovery protocol, they're out of date. Fine if they want to treat it as a fork, but probably better to think of it as its own thing at that point. The issue here isn't with state fields, it's with the discovery client. State fields control which fields are filled out when the hub sends updates about a bulb. The discovery client is what advertises which bulbs exist and what functionality they have. The syntax is different and is hard-coded to fit the HomeAssistant spec. I think the right thing here -- assuming Domoticz can't update -- is to just copy/paste the HomeAssistant discovery client and make the changes necessary to keep it compatible with Domoticz. Would also need a config to enable. |
If the light supports W or WW, this should be reported in the 'supported_color_modes' like rgbw, rgbww, currently it is advertised as RGB, hence the RGB type creation. |
That's great! He's probably already found it, but here's a full list of supported shortcodes. I normally wouldn't have bothered with these, but the discovery payload was getting quite large and using shortcodes helped quite a bit. The semantics of A light with RGB and adjustable color temp will have something like If it's at all helpful, here's the code that fills out the discovery payload: https://github.com/sidoh/esp8266_milight_hub/blob/master/lib/MQTT/HomeAssistantDiscoveryClient.cpp#L123
As reasonable as this would be, I don't think it's correct. RGBW and RGBWW lights have different behaviors. These are lights where you can adjust the RGB, WW and CW parameters simultaneously. What I described above is how you specify devices like milight where RGB and WW are separate modes. |
Tnx @sidoh for clarifying. I just came home, tested the new code. We are moving forward on the Domoticz side.. I'll keep you informed. @gizmocuz I can control the Mi-Lights using the API (control means select a color or white, brightness not working): Via the Domoticz interface selecting the color works. The vertical slider has no effect on the light. Dimmer has no effect on the light it jumps around if I click 80 it goes to 20 for example Blue On button does not work |
Yeah, the You can enable the group state field |
I think we'd already figured out what's going on here, right? Domoticz is expecting a 0-100 scale, but the If it's possible to use the |
@sidoh , This has been corrected in the latest version, using the default brightness scale (255) now. But... it is not advertised that this light supports the brightness field... not as a boolean, or color_mode. brightness boolean (Optional, default: false) supported_color_modes list (Optional) |
I do set // should only have brightness in this list if there are no other color modes
// https://www.home-assistant.io/integrations/light.mqtt/#supported_color_modes
if (colorModes.size() == 0) {
colorModes.add(F("brightness"));
} I removed the f320677#diff-ef719a88e000cdc47d752427894614c2c86fd22c257a0da936e5d8c30a6682b6L87 but it's possible that was a mistake. It does seem like that should be set to true, but it has not caused issues with HomeAssistant. I can try changing it back and check if it has any effect on HomeAssistant. |
It seems Team Domoticz @gizmocuz & Team Milight-Hub @sidoh are figuring it out. ;-) I just found a 1.10.7 (nodemcuv2) Milight-Hub in my cold storage. Running both hubs in Parallel to spot the changes in MQTT Explorer. |
It seems sending a blue value of 128 vs 255 does not make any difference. If this is the case (probably duo internal color format), we really have to send the brightness separately. @sidoh , is it possible to make a version with the added brightness support indication? config[GroupStateFieldNames::BRIGHTNESS] = true; This should also work in HASS, maybe you could test this before making a new firmware public? |
Ok I'll need to wait for @sidoh before I can continue testing. |
@sidoh , the following can be used in the milight hub without error messages in my HA logfile. {
"dev_cla": "light",
"schema": "json",
"name": "Hal Voordeur",
"cmd_t": "milight/commands/0xXXX/rgbw/1",
"stat_t": "milight/state/0xXXX/rgbw/1",
"uniq_id": "CC8789-Hal Voordeur",
"dev": {
"name": "milight-hub",
"sw": "esp8266_milight_hub v1.13.0",
"mf": "espressif",
"mdl": "d1_mini",
"identifiers": "13404041",
"cu": "http://192.XXX.XX.XX"
},
"avty_t": "milight/client_status",
"pl_avail": "connected",
"pl_not_avail": "disconnected",
"effect": true,
"brightness": true,
"fx_list": [
"night_mode",
"white_mode",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8"
],
"sup_clrm": [
"rgb"
]
} If both entries are here: "brightness": true,
"rgb": true, The RGB on this location will cause an issue in Homeassistant. if you republish the config without the 'rgb' but including 'brightness' : Instantly it becomes available. |
Adjusting the Brighness no error in HA debug log.
Adjusting Color, no error in HA debug log
|
@sidoh , bumb the issue ;-0 any chance that I can assist somewhere to solve this. Now the lights do not work as expected ;-) I am however a bit lucky as Domoticz allows me to have multiple autodisovery topics so per hardware type. So not everything needs to be in Homeassistant. So as a temporary workaround I can have 2 separate autodiscovery profiles fro milight.. 1 compatible with Domoticz and 1 forwarded to Homeassistant. However it is a workaround. A fix for the bug would be preferred ;-) |
Apologies for the radio silence. It sounds like all we need to do is set the If you want to open a PR with the change I can merge it. |
No problem. Appreciate your help. Hope it meets the expected result. |
For reference, here is what the supported discovery configs are: https://www.home-assistant.io/integrations/light.mqtt/#json-schema---configuration
So that should indeed be set to true.
This should not have brightness in it. |
Ok. If I understand it correctly The proposed pull request #859 should be enough to get things back up and running with the latest Domoticz beta. |
Should be live in this release: https://github.com/sidoh/esp8266_milight_hub/releases/tag/1.13.1-beta2 |
Ok Installed 1.13.1-beta2 @sidoh , and started testing with @gizmocuz with Domoticz 2024.7 (build 16350) Removed all previous hardware and RETAINED MQTT Topics. {
"dev_cla": "light",
"schema": "json",
"name": "Lampje Spare",
"cmd_t": "milight/commands/0xXXXX/rgbw/4",
"stat_t": "milight/state/0xXXXX/rgbw/4",
"uniq_id": "CC8789-Lampje Spare",
"dev": {
"name": "milight-hub",
"sw": "esp8266_milight_hub v1.13.1-beta2",
"mf": "espressif",
"mdl": "d1_mini",
"identifiers": "13404041",
"cu": "http://192.xx.xx.xx"
},
"avty_t": "milight/client_status",
"pl_avail": "connected",
"pl_not_avail": "disconnected",
"brightness": true,
"effect": true,
"fx_list": [
"night_mode",
"white_mode",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8"
],
"sup_clrm": [
"rgb"
]
} So I can see the brightness is now in the main topic. Let's start testing. |
I started testing with the Milight Webinterface: (works color . dimmer white) White {
"state": "ON",
"brightness": 143,
"color": {
"r": 255,
"g": 255,
"b": 255
},
"color_mode": "brightness"
} Color {
"state": "ON",
"brightness": 255,
"color": {
"r": 42,
"g": 255,
"b": 0
},
"color_mode": "rgb"
} Domoticz Notices the changes: |
@sincze The state topic is one-way and only shows the current state. You want to use the command topic to control the lights. |
djeez it is so late i make mistakes. thanks for clarifying |
Testing With Domoticz @gizmocuz : Command: {"state":"OFF"} Command: 4 = {"brightness":255} Command: 4 = {"brightness":255,"state":"ON"} Command: 4 = {"brightness":128,"state":"ON"} Light becomes white Selected blue color. Selected Red Color MQTT Explorer So I guess something is wrong In Domoticz as it seems not updating the command.. |
The only problem left is the ON command, Domoticz only sends { "state": "ON" } |
@gizmocuz ok switched the light to FULL brightness and switched color to GREEN. Switched off (using the physical 220v switch). So now Domoticz does not know the light is turned On however that seems logical regarding the protocol in use. While clicking the ON button in domoticz I noticed:
@sidoh , If I use the milight-hub to toggle ON the light. It does not produce anything in MQTT topic milight/commands/0xXXX/rgbw/4
So could it be this is not correctly implemented in Miligh-Hub you think? We would or should expect a command topic if the milight hub is used to swich on/off a lamp? |
Describe the bug
Domoticz Mi-Lights discovered via auto discovery do not respond correctly anymore.
Colors can not be changed / brightness does not respond
Steps to reproduce
Install latest version of the bridge software.
Expected behavior
Domoticz should be able to control the lights as with pre FW versions.
Setup information
Firmware version
1.13
Output of http://milight-hub.local/about
Output of http://milight-hub.local/settings
Additional context
I noticed the commands seems to have changed a bit:
from:
To:
{"state":"ON","color":{"r":255,"g":255,"b":255}}
The text was updated successfully, but these errors were encountered: