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

Update state via MQTT without sending a command to the lights. #832

Open
solomondg1 opened this issue Jul 11, 2024 · 3 comments
Open

Update state via MQTT without sending a command to the lights. #832

solomondg1 opened this issue Jul 11, 2024 · 3 comments

Comments

@solomondg1
Copy link

solomondg1 commented Jul 11, 2024

I have remotes, bulbs, and home assistant. If I configure it using the setup in the wiki where the ESP listens to the remote, publishes the state to MQTT, then a HASS automation sends a state back to the ESP via MQTT to finally control the light it takes about a second of delay for all that.

To avoid the delay I've also paired the remote with the light so it does the above and also instantly controls the light. A second later the light gets a duplicate command but that's usually fine for on/off.

The issue comes when you do a lot of changes and the lights go between what the remote is commanding and what the ESP is. I think the fix for this would be to have a way to tell the ESP there is a new state without it sending a command to the lights. I think this could either be a new MQTT topic or a variable in the JSON state payload.

Basically when the remote is controlling my lights all I want to do is keep home assistant's state in sync without sending packets to the lights from the ESP.

@garmck
Copy link

garmck commented Jul 12, 2024

Sounds like an over complicated setup.
You might want to paste some of your setup - including the MQTT settings you are using so we can see your config

Are you using the same device_id in home assistant and milight hub ?

@sidoh
Copy link
Owner

sidoh commented Jul 13, 2024

I don't think you need the whole MQTT forwarder setup. Pair the bulb to the remote and use the same ID as the remote in the hub. As long as the ESP8266 receives the packet from the remote, its state will be updated accordingly.

@solomondg1
Copy link
Author

@sidoh I've added the device ID of the remote to the ESP and I'm able to control the light with that device ID. If I turn the light off via the remote the state on the ESP remains on. I tried refreshing the page and confirming the ESP is receiving data from the remote via the sniffing log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants