flyte / mqtt-io

Expose GPIO modules (Raspberry Pi, Beaglebone, PCF8754, PiFace2 etc.) and digital sensors (LM75 etc.) to an MQTT server for remote control and monitoring.
MIT License
461 stars 157 forks source link

Option to ignore retained MQTT messages #300

Open molnarg opened 1 year ago

molnarg commented 1 year ago

Is your feature request related to a problem? Please describe. I'm using a GPIO to trigger a button. I'm using the timed_set_ms to only pull down the otput for a short amount of time to simulate a button push. However, when the service is restarted, the retained messages will be resent from the MQTT broker, and the button is pressed.

Describe the solution you'd like Either have an option to explicitly ignore incoming retained messages, or just ignore them when timed_set_ms is set. In those scenarios, it seems to me that it'd be undesirable to trigger the interaction on each restart.

Describe alternatives you've considered I've checked if I can turn off retained message delivery just for this client in the MQTT broker, but Mosquitto doesn't support that. I've also checked whether I can do it on the publishing side, but in the setup I have, I can't do it (Athom Home smart home hub + MQTT Hub app).