My Xiaomi climate sensor reports pressure values in hPa, while in my country atmospheric pressure is typically measured in mmHg. This is not a problem since these values can be linearly recalculated:
Hmmm, I have to get back to this topic. Unfortunately the code above still generates zero values from time to time. I tried to suppress this with adding an additional rule in availability_template
availability_template: "{{ not is_state('sensor.balcony_climate_sensor_pressure', 'unknown') and
states('sensor.balcony_climate_sensor_pressure') | int != 0}}"
Unfortunately this filtered out all values, not just zero ones. I checked this expression in HA template debugger. It evaluates to true (as expected), but no value is stored.
Well, typical values of the atmospheric pressure are 730-750 mmHg. Grafana automatically adjusts bounds so that graph takes full vertical scale, and I find this suitable and handy
When zero values get added to the list, the bounds are adjusted to 0-750, and the graph becomes almost a straight line at the top with spikes to zero. Pressure changes get no longer noticeable. That is what I mean totally unusable (sorry, I do not have a picture right now, as I went to influxdb and manually deleted all zeros).
Well, I can definitely go to grafana settings and explicitely set graph bounds to 730-750, so zero values will just go outside the graph. But I would prefer to fix the source of the problem, rather than mask it.