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

MQTT group sync documentation #362

Closed
xoseperez opened this issue Jan 2, 2018 · 9 comments
Closed

MQTT group sync documentation #362

xoseperez opened this issue Jan 2, 2018 · 9 comments
Labels

Comments

@xoseperez
Copy link
Owner

Originally reported by: Ian Cunningham (Bitbucket: iancun, GitHub: iancun)


I've got 3 LED strips now running from an H801, and I've set them to use the same MQTT root topic so that they will receive identical commands from Home Assistant. It works, but they change colour at slightly different times.

I note that there is a MQTT group sync option - would this mean that all lights change colour at the same instant? If so, how does it work, as I can't find anything on this setting? :)

@xoseperez
Copy link
Owner Author

At the moment only status is sync'd between devices, not colors, but I'll try to add this option soon. Anyway if you are concerned about timing it won't solve the issue since it will depend on when the device receives and processes the message.

@xoseperez
Copy link
Owner Author

You can now sync colors too. The code is in the dev branch and will be released soon.

@xoseperez
Copy link
Owner Author

Original comment by Ian Cunningham (Bitbucket: iancun, GitHub: iancun):


Many thanks :).

Is it possible to sync the moment that the changes happen (i.e. all controllers initiate changes at the exact instant), or will there always be some variability with changes? At the moment, the controllers initiate changes within around 1 second of eachother, but out of sync. Perhaps this is more complex than I realise ;).

@xoseperez
Copy link
Owner Author

One solution I can think of is to sync times between them too. That should be done outside MQTT but maybe NTP feature already provides an accurate timing. Then the message should contain the action to perform ("change color to ...") and the time to perform it ("19:23:34"). The sender of the message with set that time to a few seconds in the future (2, 3 seconds).

Another option would be to perform the sync by other means (not MQTT). UDP or ESPNow come to mind.

@xoseperez
Copy link
Owner Author

Original comment by Ian Cunningham (Bitbucket: iancun, GitHub: iancun):


Oh, good idea! I've not heard of ESPNow, so I'll have a read of this technology now.

@xoseperez
Copy link
Owner Author

Released with 1.11.4

@xoseperez
Copy link
Owner Author

Removing milestone: 1.11.4 (automated comment)

@chryss44
Copy link

chryss44 commented Feb 2, 2018

Hi Xose,
Yesterday i used Group MQTT on my Sonoff and have a strange reaction on my broker (Jeedom).
I have permanently this message :
[2018-02-02 13:07:21][DEBUG] : 16 : Client jeedom received PUBLISH (d0, q0, r1, m0, 'ESPURNA_TEST/status', ... (1 bytes)) [2018-02-02 13:07:21][DEBUG] : Message 0 sur ESPURNA_TEST/status [2018-02-02 13:07:21][INFO] : Message texte : 0 pour information : status sur : ESPURNA_TEST [2018-02-02 13:07:21][DEBUG] : 16 : Client jeedom received PUBLISH (d0, q0, r1, m0, 'jardin', ... (1 bytes)) [2018-02-02 13:07:21][DEBUG] : Message 0 sur jardin [2018-02-02 13:07:21][INFO] : Message texte : 0 pour information : jardin sur : [2018-02-02 13:07:21][INFO] : Saving device [2018-02-02 13:07:21][ERROR] : Le nom de l'équipement ne peut pas être vide : MQTT Object ( [id:protected] => [name:protected] => [logicalId:protected] => [object_id:protected] => [eqType_name:protected] => MQTT [eqReal_id:protected] => [isVisible:protected] => 0 [isEnable:protected] => 0 [configuration:protected] => {"topic":"","type":"topic"} [timeout:protected] => 0 [category:protected] => [display:protected] => [order:protected] => [comment:protected] => [_debug:protected] => [_object:protected] => [_needRefreshWidget:protected] => [_timeoutUpdated:protected] => [_batteryUpdated:protected] => [_cmds:protected] => Array ( ) ) [2018-02-02 13:07:21][DEBUG] : 16 : Client jeedom sending DISCONNECT

Can-you help me ?

@chryss44
Copy link

chryss44 commented Feb 9, 2018

Hello,
I have found solution to clean the message, i put front my group.
I Explain,
If you just put a single word (like jardin for me) on the name of group, mosquitto don't like it and you have a ERROR message every second :-((((.
If you don't want have a ERROR message, put another word and "/" front of your first word (like sonoff/jardin) and the ERROR message desappear.
If this help everybody ;-).

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

No branches or pull requests

2 participants