Closed bkk87 closed 3 years ago
This is not abug
With clean = false the robot would see the previous command and start cleaning.
Would it ever stop executing that previous command or just repeat that every time a connection to the broker is established?
If I read the specs correctly then the robot would just start cleaning once and the message is removed/"processed".
The "clean" parameter is different to the "retain" parameter in mqtt. "retain" will always hold the last message and not delete it.
Also, when using the clean parameter, one can configure in e.g. mosquitto that the session will at some point be removed in case the robot does not connect back to the broker (persistent_client_expiration).
When MQTT settings are configured, Valetudo will subscribe to several topics during start-up, e.g. valetudo/rockrobo/command.
In Valetudo, it is possible to specify a 'global' QoS parameter. The QoS parameter is correctly set when subscribing or publishing to a topic.
However, what is currently not possible is to set the 'clean' parameter of mqtt.js for topic subscription. See: https://github.com/mqttjs/MQTT.js
The current default in Valetudo is
clean = true
which means that all messages are deleted when the robot re-establishes a new connection at the MQTT broker.Being able to set
clean = false
is especially useful when setting QoS to 1 or 2 because this would allow for offline messages. Example:clean = false
the robot would see the previous command and start cleaning. Withclean = true
(current default) , the command message would be deleted at the broker when the robot comes back online and re-establishes the connection.