the solution i gave above is using cayenne MQTT library so the code line automatically adds the widget to the dashboard. and have a look at different data types Data types for Cayenne MQTT API
the solution i gave above is using cayenne MQTT library so the code line automatically adds the widget to the dashboard. and have a look at different data types Data types for Cayenne MQTT API