Log Temperature at a specific time of the day

Hi, I have a temperature sensor outside and I would like to figure out what the temperature is at e.g. 13:00, every day over the last 365 days.

Not at 12:00, not at 14:00, just at 13:00. The reason is that the sensor is in the sun for a few hours so displays the wrong temperature and I can’t change that.

Any ideas?

The simple answer is to create a time based automation, and copy of the value of the sensor into say a numeric or text helper at that time.

However, thats not quite the whole answer. Usually you can’t actually make a sensor send its data at a specific time, so if you need the reading at EXACTLY 12 o’clock I’m not sure how you’d do this. If it doesn’t matter if it could be out slightly, then it should be fine.

If you then create a template sensor, who’s value is based on the input helper, I think that should start to give you your history data.

You can do this easily with a trigger based template sensor.

It would be something like this:

template:
  - trigger:
    - platform: time
      at: "13:00:00"
    sensor:
      - name: Daily temperature at 1PM
        unique_id: 87232998-e939-4842-8e5a-3d9950fcbb6b
        unit_of_measurement: °C
        state: "{{ states('sensor.outdoor_temperature')}}"

But remember that Home Assistant don’t store data for more than 10 days for regular sensors.

1 Like

Great idea @EdwardTFN - I’ll try that.

1 Like

Or write it to google sheets with an automation.
But won’t the sun change over the year?