Difference to same time yesterday

Hi,
i am new in Home Assistant i have integrated some sensors in my configuration from mqtt like that

mqtt:
  sensor:
    - name: "Stockwaage1GewichtStock2"
      state_topic: "waage1/GewichtStock2"
      unit_of_measurement: "kg"

This is the weight of a beehive !
What i want to achieve is to show the difference of the weight to the same time yesterday.

My aproach was to do this via a template sensor but i dont know how to get data for yesterday

Is there a function i can use in the template

You will need to set up a SQL sensor to get yesterday’s value.

1 Like