-
Notifications
You must be signed in to change notification settings - Fork 218
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
MQTT state not sent after command topic #700
Comments
Removing the commented optimization below looks like a workaround in bool GroupState::setState(const MiLightStatus status) {
//if (!isNightMode() && isSetState() && getState() == status) {
// return false;
//}
setDirty();
... In this case the state topic is always sent, even when MiLight-Hub thinks there is no light change. Then both Homeassistant and MiLighthub becomes in sync about every light state and the light button does not flip back. Can someone review this proposal? Then I'm happy to create a pull request. |
Nice, noticed this bug also... not always. Only when reboot HA and my lights went on even when they where off in HA |
You can give it a try to open the Yesterday I noticed that Homeassistant also contains a Scene optimization that it won't send a light state when it thinks the light is already in a specific state. This also results in lights out of sync after a restart or missing packets. I'm not sure if this optimization can be disabled. Switching to another scene is only reliable when all lights are always refreshed. |
I really dont know how to do that. I will wait for a possible update. |
I was just trying to make an HA automation so when I change the state of the "All / 0" group, all the lights to adopt that same state.
My automation: - alias: Mi / Bedroom / Follow
trigger:
platform: state
entity_id: light.mi_bedroom
action:
choose:
- conditions: "{{ is_state(trigger.entity_id, 'off') }}"
sequence:
service: light.turn_off
entity_id:
- light.mi_bedroom_clau
- light.mi_bedroom_miha
default:
service: light.turn_on
entity_id:
- light.mi_bedroom_clau
- light.mi_bedroom_miha What's more is that I don't have to manually specify the attributes (brightness, rgb, etc), they are automatically copied (not sure how though but I don't really care now). |
Describe the bug
A light state may be out of sync between Homeassistant - MiLight-Hub. In this case the light on/off button in Homeassistant flips back to the previous state after a few seconds.
Root cause: MiLight hub does not send a MQTT state topic when it receives a command topic without a change.
A possible solution would be send the light state always after each light command.
Steps to reproduce
Expected behavior
Always send a MQTT state after a command.
Consider to make this permanent, or configurable.
Setup information
Firmware version
See next.
Output of http://milight-hub.local/about
Output of http://milight-hub.local/settings
Homeassistant configuration.yaml
Additional context
See screen capture above.
The text was updated successfully, but these errors were encountered: