Good evening all,
Is it possible to replace the fixed values in the template below with input numbers?
- platform: template
sensors:
current_electricity_rate:
friendly_name: Current Electricity Rate
value_template: >-
{% set t = strptime(states('sensor.time'), '%H:%M') %}
{%- if t.hour >=6 and t.hour <22 -%}0.2648
# replace 0.2648 to
#input_number.t1_energy_cost
{%- else -%}0.2124
# replace 0.2124 to
#input_number.t2_energy_cost
{%- endif -%}
unit_of_measurement: €/kWh
I have tried several options to implement this but have not been successful so far.
Does anyone have an idea how I can do this?
Thanks in advance