Hello all,
I’m trying to create automation, that will take datetime helpers, calculate days difference between them, take number helper and divide it with previously calculated diff.
I got error " Error rendering data template: Result is not a Dictionary" when trying to set number helper with result of calculations.
My code, as follows:
action: input_number.set_value
metadata: {}
data: “{{ state(‘input_number.zaladunek_pieca_kg’) | int / (state('input_datetime.zaladunek_pieca_ostatni) | as_datetime - state(‘input_datetime.zaladunek_pieca’) | as_datetime).days}}”
target:
entity_id: input_number.spalanie_na_dobe_kg
Is it correct or I need to change something?
This automation will be triggered on input.zaladunek_pieca state changed and will calculate avg. fuel consumption for central heating system.
Thanks in advance!