Hello There, I´m configuring wallbox EV charger to dynamically set the max charge to use based on available Amp at home. in order to do that, first I need to know how much available amp do I have, but this is something already got in a sensor called sendor.carga_wallbox.
what I´m missing now is in an automation to set this sensor value to wallbox max charge, I created this automation:
</
alias: Wallbox a 17
description: “”
trigger:
platform: numeric_state
entity_id:
sensor.acometida_amp
above: 20
condition:
action:
device_id: 91bc1fbd644674d94abcfc589634d9be
domain: number
entity_id: b6564c42c5fba3711507b469621ed3d8
type: set_value
value: {{ sensor.carga_wallbox }}
mode: single
/>
When sensor Acometida is below 20 I want to set the value for this entity which is sensor.wallbox_commander_2_sn_755800_corriente_de_carga_maxima
But error receive is this one:
Message malformed: expected float for dictionary value @ data[‘value’]
You’re missing the action: header, perhaps confused by the recent renaming of service to action. Fixed below. Maybe use the UI if you’re not secure in YAML.
As Troon explained, the automation you created is malformed and is missing an action: key.
If you are attempting to create the automation in YAML, I recommend you use the Automation Editor in Visual mode until you become more familiar with YAML.
The main mistake you made in your original automation (the example in your first post) is that you attempted to use a template with a Device Action which doesn’t support templates.
The solution is to use the number.set_value action instead of the Device Action. It supports templates.
The second problem was that the template you designed was incorrect. If you want to get an entity’s state value, you must use the states() function.
The last mistake was omitting the action: key from the automation.