I have an automation that does the following:
-
Send notification when propane sensor increases by 15% (it is being filled)
-
Wait 10 minutes
-
Send notification propane filled to x%. Gallons added (sensor_now - sensor_yesterday)
-
Set template sensor “propane_tank_last_fill_gal” to state: (sensor_now - sensor_yesterday). This way I can make a lovelace card with gallons filled and date so I can compare when I get my bill
I’m stuck at step 4. Step 1-3 works.
alias: Notification - Propane Fill
description: ""
trigger:
- platform: template
value_template: >-
{{ states('sensor.pro_plus_22d5_tank_percent') | float -
states('sensor.pro_plus_22d5_tank_percent_yesterday') | float > 15}}
condition: []
action:
- service: notify.mobile_app_pixel_7
metadata: {}
data:
message: >-
Propane tank is being filled. Start {{ '%0.1f' |
format(states('sensor.pro_plus_22d5_tank_percent_yesterday') | float *
10) }} gallons.
title: Home Assistant
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- service: notify.mobile_app_pixel_7
metadata: {}
data:
title: Home Assistant
message: >-
Propane filled to {{ '%1.0f' |
format(states('sensor.pro_plus_22d5_tank_percent') | float) }}%. Gallons
added {{ '%1.0f' | format(states('sensor.pro_plus_22d5_tank_percent') |
float * 10 - states('sensor.pro_plus_22d5_tank_percent_yesterday') |
float * 10) }}.
sensor:
- name: "propane_tank_last_fill_gal"
state:
{% set tank_start = states('sensor.pro_plus_22d5_tank_percent_yesterday') | float * 10 %}
{% set tank_end = states('sensor.pro_plus_22d5_tank_percent') | float * 10 %}
{{ tank_end - tank_start }}
mode: single
I get the error Message malformed: extra keys not allowed @ data['sensor']