✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Is it possible to trigger updates on receipt of MQTT messages

I am new to Dash and have searched for this topic but couldn’t find a clear answer. I would like to update dash-generated Web pages on receipt of an mqtt message. The only way I could see to do that is to define a an Interval element that updates the page whether or not a new mqtt message has been received. So that works but the page is updated much more frequently than necessary. Is there an alternative approach to updating the page based on an event like the receipt of an mqtt message.

Interval is one way to do it, or you could show the messages on page load (https://dash.plot.ly/live-updates). Otherwise, dash doesn’t support server-to-client updates yet (websockets)

Thanks for the quick response. For this application, on page load doesn’t work and Interval, while not ideal does the job. I do hope that websocket capability is added at some point since the ability to receive data in real time through means like mqtt and then update charts and tables (all without writing a line of javascript or css) is a great advance for those of us who aren’t client-side web programmers.