I have a Shelly PM1 connected to my coffee machine which gives me:
sensor.shelly1pm_e09806aa0e25_energy
sensor.shelly1pm_e09806aa0e25_power
Ive used Utility Meter helper to create:
sensor.coffee_machine_daily
sensor.coffee_machine_monthly
using the entity sensor.shelly1pm_e09806aa0e25_energy
for both daily and monthly.
In the templates yaml I have the following code:
- name: Coffee machine daily cost
state: >-
£ {{ ((states('sensor.coffee_machine_daily') | round (2))
* (states('input_number.cost_of_electric_per_kwh') | round(0, 'ceil'))
/100) | round(2, 'ceil')
}}
- name: Coffee machine monthly cost
state: >-
£ {{ ((states('sensor.coffee_machine_monthly') | round (2))
* (states('input_number.cost_of_electric_per_kwh') | round(0, 'ceil'))
/100) | round(2, 'ceil')
}}
Ive also set up a number helper:
input_number.cost_of_electric_per_kwh
with the cost in pence
Now when I create a Statistic Card:
type: statistic
entity: sensor.coffee_machine_daily_cost
period:
calendar:
period: day
stat_type: change
icon: mdi:currency-gbp
unit: £
I shows a question mark on the card for cost, where as the Statistics Card I set for monthly displays the correct cost:
type: statistic
entity: sensor.coffee_machine_monthly_cost
period:
calendar:
period: month
stat_type: change
icon: mdi:currency-gbp
unit: £
I can’t workout why this is happening. If I change the Period to tomorrow it’s still a question mark.
Any ideas, i’d be grateful