Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 103467

Avoid calculating value template when value not available

$
0
0

Hello,

I have a template sensor which subtracts an offset from a temperature sensor. However when the sensor data drops out, or whenever home assistant restarts, the temperature sensor data temporarily becomes unavailable, and the template outputs just the offset (in this case -1).

This produces a sudden spike in the graph, and means the y axis is scaled too small until the spike moves off the end of the displayed period and it rescales to zoom in again (see photo below)

Is there a way to adjust the value template to avoid this happening? All it would need is a quick check to make sure the output is positive, or that the temperature input is available, and if not, don’t output anything - however I’m not sure how to code this.

Any ideas?

Thanks :slight_smile:

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 103467

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>