I had a lot of trouble with getting the “yesterday” value too. I came up with two solutions. The only pure HA solution I came up with was using input_number.today_deaths
and input_number.yesterday_deaths
and then creating an automation that ran whenever my other covid trackers update that would put the input_number.today_deaths
in the input_number.yesterday_deaths
and then put the new number in input_number.today_deaths
.
However, this got complicated as I tried to track multiple places and had multiple updates. The solution I ended up with was actually using InfluxDB. Those types of queries are super specific to how your DB is setup, you can read more detail about mine in How a computational biologist tracks COVID-19 pt 1 of?