I’m relatively new to HA. I have installed the VeSync integration for Levoit air purifiers. Whilst it adds an entity for each air purifier, it only adds attributes for ‘air quality’ - it’s built-in sensor.
It’s by definition. States are always strings, but attributes can have other types. Your template looks fine (just be sure to provide int with a default value). If you’re worried how HA will interpret it e.g. when plotting the value, just make sure to se the desired device_class.
Thanks for your speedy reply. Would you mind elaborating on device_class. I am having a problem with the graph of the value showing discrete bands of data rather than a line graph.
Defines the units of measurement of the sensor, if any. This will also display the value based on the user profile Number Format setting and influence the graphical presentation in the history visualization as a continuous value.