Ubidots Community

[SOLVED] Show a discrete state variable

Hello, I have a weather station which has a light and rain sensors, this station works under raspberry-pi. I would like the user to have visual feedback on the level of luminosity and not a value in lux or lumens. For example: night, sunny weather, overcast weather, rainy weather (if the rain sensor is active), etc. I haven’t programmed my interface on ubidots yet, can someone show me how to do this, or what widget is best suited for this app, please.

Good day

I hope all is well,

You can set up an indicator widget to show color and text based on a variable value, as shown below.


In case the text will depend on more variables or conditions you should use the HTML Canvas widget which allows you to create custom visualizations for your clients using HTML, CSS, and JavaScript. Please refer to the following article to learn more.

All the best,

Hello @abdouTobblaze,

You can display discrete text based on you variable using the Indicator widget. This allows setting value ranges based on your Light sensor to change the color and label of the widget. Ultimately, you’ll be able to display “night”, “sunny weather”, etc. based on the Lux/Lumens values.

This is how the Indicator widget setup would look

This is how the widget would respond to the values

Makes sense?



Thank you Isabel and David for the quick response, I will try this right away.