I’m trying the following automation.
alias: Turn off HVACs when Nordpool spot prices over limit
description: ''
trigger:
- platform: template
value_template: >-
{{ states('sensor.nordpool_kwh_fi_eur_4_095_024 | float') >
states('input_number.elec_price_slider | float') }}
condition: []
action:
- device_id: 821bbee522b44841af684cb1c0a5a7ab
domain: climate
entity_id: climate.pana_mek
type: set_hvac_mode
hvac_mode: 'off'
- device_id: c6d59cfa6cf443c19a372b6f317e22e7
domain: climate
entity_id: climate.pana_halli
type: set_hvac_mode
hvac_mode: 'off'
mode: single
The action part works fine, but the comparison not.
This is the problem:
I can freely alter the “slider” value, but whatever is the value, the comparison result does not change.
It seems to be handling the values as strings according to the text above the result box, but this is the case only when i put several clauses into the editor. If inserted one at the time, the result type seems to be correct, that is “boolean” for comparison and number for the parameters (however, when using “float” it becomes “string”)
However, in my dashboard when using e.g. entities card or others alike, it displays the value correctly and e.g. in the following automation it handles it nicely as number:
alias: Turn on HVACs when Nordpool spot prices under limit
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.nordpool_kwh_fi_eur_4_095_024
attribute: current_price
below: '10.1'
condition: []
action:
- device_id: 821bbee522b44841af684cb1c0a5a7ab
domain: climate
entity_id: climate.pana_mek
type: set_hvac_mode
hvac_mode: heat
- device_id: c6d59cfa6cf443c19a372b6f317e22e7
domain: climate
entity_id: climate.pana_halli
type: set_hvac_mode
hvac_mode: heat
mode: single
Trying to convert with float does not work, it just returns “unknown”
I have tried e.g. if else statement, no change
What gives? How can I make the comparison (and automation) work?