I got some ESP(home) devices that are offline when the “hacked” device is off. Take my Jura coffee machine as example. I attached an ESP to it and this counts the amount of coffee that we made.
So now I want to display the total amount of coffee in a nice graphic. only the sensor turns tot unavailable when the device is offline and that gives “NaN” on my lovelace items. So I want to prevent this. I read/googled a lot on this, tried to use the availability_template but that don’t work for this. and couldn’t find anything with previous_state or last_state on a template sensor…
default 0 sets the value to 0 if the device is offline. and that will also affect my total counter. it’s an increasing number (of made cofffee :D) so pulling it to 0 is not the way…
OK…just trying to understand the issue without spending a lot of time … there is also something like ‘input_number’ which you can update and use its state
Another thought is to address this from the graph/card by excluding non-numeric values…I have seen this somewhere. apex/plotly allow to mod on the input