I am probably already blind… I don’t see where is it problem.
When I try to set value in action I get error Message malformed: expected float for dictionary value @ data[‘value’]
I have already no idea how do value result more float then float
type: set_value
value: {{ ((states('sensor.allowed_grid_export_limit') | float() * 0.95 | float() / 100 | float()) | round(0, 'floor') | float() * 100 | float()) | float() }}
This sensor is defined like this
- platform: template
sensors:
allowed_grid_export_limit:
unique_id: "svecpetr-23373edefddced7303889e06e2ebc524"
device_class: power
friendly_name: "Allowed Grid Export Limit"
unit_of_measurement: "W"
value_template: >-
{{ 8640|float() }}
An finally this is whole declaration
- id: "1685361726670"
alias: GoodWe - Grid Export - povolení přetoků při kladné ceně za kWh
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.current_spot_electricity_price
above: 0
condition:
- condition: numeric_state
entity_id: number.grid_export_limit
below: sensor.allowed_grid_export_limit
- condition: template
value_template:
"{{ now() - state_attr('automation.goodwe_povoleni_pretoku_pri_kladne_cene_za_kwh',
'last_triggered') | default(as_datetime(0), true) > timedelta(minutes=5) }}"
action:
- device_id: b0a33890a80fbbc0a2cf8fbe4ad46a5f
domain: number
entity_id: number.grid_export_limit
type: set_value
value: {{ ((states('sensor.allowed_grid_export_limit') | float() * 0.95 | float() / 100 | float()) | round(0, 'floor') | float() * 100 | float()) | float() }}
- service: notify.mobile_app_sm_s901b
data:
message:
Povoluji přetoky do DS, protože cena výkupu elektřiny je {{ states("sensor.current_spot_electricity_price")|round(2)
}} Kč/kWh
title: GoodWe Grid Export Enabled
- service: notify.seznam_cz
data:
title: GoodWe Grid Export Enabled
message:
Povoluji přetoky do DS, protože cena výkupu elektřiny je {{ states("sensor.current_spot_electricity_price")|round(2)
}} Kč/kWh
enabled: false
mode: single