Shelly i3 MQTT events

Hi,
I have a MQTT related question. I setup a Shelly i3 with MQTT using the Mosquitto broker. The Shelly connects fine and I can see the different push events in the topic “input_event”. So far so good. My problem however is that when I subscribe to the MQTT topics, the broker keeps firing messages to the subscriber even if no button is pushed. This makes it complicated to use the events to fire actions in Node Red. Of course, the message also includes an event counter from which I can see that the message was sent even though the button was not pushed (because the event counter does not increase), but if I want to use this information, I need to use flow variables and these things to make the automation work in Node Red. Does anybody know a smarter way to get only those messages, when a button is actually pushed?
Thanks and regards

Hi,

I have one of these devices and I could disable these 30-sec periodic state messages, but I am unsure about how I did it,.

If am not wrong, you can set mqtt_update_period to 0 to disable state updates under /settings. See the Shelly doc at https://shelly-api-docs.shelly.cloud/#mqtt-configuration:

Device state is reported periodically, every 30 seconds by default. This can be changed by setting a new period for updates: mqtt_update_period under /settings . A value of 0 will disable periodic updates.

4 Likes

Thanks a lot! That was it!

If anyone else encounters the same problem, here is a quick tip: The MQTT update period cannot be set via the web interface. You have to use the REST API with the following command:

http://<shelly-ip>/settings?mqtt_update_period=0
6 Likes