I see an error in the log that “gallons” is not a valid unit of measurement for device_class: gas.
Should I just ignore it? Does one of these need to be changed?
The units are definetly gallons.
Propane is in liquid form in the tank.
Here is the code:
template:
- sensor:
- name: "Daily Propane Usage 371 claude Continuous"
unit_of_measurement: "gallons"
state: >
{% set current = states('sensor.propane_tank_neevo_371_gallons') | float %}
{% set last_day = states('sensor.propane_tank_neevo_371_gallons', now() - timedelta(days=1)) | float %}
{% if is_number(current) and is_number(last_day) %}
{{ (last_day - current) | round(2) }}
{% else %}
{{ 0 }}
{% endif %}
state_class: measurement
device_class: gas
Thank you.