Scheduling sensor: -platform

I use a no-long-supported integration called tank_utility.

There is no replacement for the system that I know of (wifi-connected propane tank level monitor).

The system works well, except that it provides new/updated readings at random times. I need it to provide 1 reading per day, preferable at a specific time.

This is the configuration.yaml entry:

sensor
  - platform: tank_utility
    email: "<EMAIL>"
    password: "<PASSWORD"
    devices:
      - "00xxxxxxxxxxxxxxx"

I tried adding using a “homeassistant.update_entity” in an automation, but that doesn’t stop the integration from updating when it shouldn’t.

Is there something I can add to the “-platform” entry to achieve the goal?

Thank you.

Is the problem you are trying to solve that you don’t want the entity to change outside of one time per day or that you don’t want the integration to do the work of logging in except for one time a day? If it’s the former, you could use an automation with a time pattern trigger to read the value and update the helper once a day. If it’s the latter, you’re probably out of luck outside of you or someone else updating the code for the integration.

It is indeed the former.

I want to force a reading and remember that reading at 12:01am every day.

I have a (very) basic understanding of using an automation with a time trigger to read the value, but I don’t understand “update the helper.”

Do you mean:

Run an automation every day at 12:01am that reads the value and assigns it to a variable?

I have that already, but it doesn’t work because of the random updates throughout the day before.

I’m referring to helpers, which you can find in the UI here, like the input number helper.These are entities you can create and set the value and display them on dashboards etc.

But having another second to think about it what you really need is a trigger-based template sensor.

The example in that doc shows what you have in mind – something that updates once per day at a particular time. You would just change the state to read the sensor created by the tank_utility integration.

template:
  - trigger:
      - trigger: time_pattern
        hours: 0
        minutes: 0
    sensor:
      - name: "Daily tank value"
        state: '{{ states("sensor.your_tank_sensor") }}'
        unit_of_measurement: "%"