Hello,
I have a custom action that takes a number in our custom component defined as:
name: Battery Charge
description: Set the battery to charge (will force a charge either from the solar panels and then the grid)
fields:
amount_to_charge:
name: Kw to charge
required: true
default: 0
selector:
number:
min: 0
max: 13```
In our services.yaml.
When using this in an automation I get a slider to set the input, which works okay.
Our goal instead is to have an entity as input for this, I tried it by having my automation appear like this:
```alias: zonnedorpen charge from grid
description: ""
triggers: []
conditions: []
actions:
- repeat:
sequence:
- action: zonnedorpen_controller.battery_to_charge
data:
amount_to_charge: {{states('charge_powerref') | float}}
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
while:
- condition: state
entity_id: zonnedorpen.grid_automation_bool
state: "True"
However I keep getting errors like the attached screenshot.
Am I grabbing the state incorrectly?
I used the following as an example:
https://community.home-assistant.io/t/using-a-state-attribute-in-an-automation-action/428269
The actual state looks like the second attached picture.
Home Assistant Community
Hi, I’m trying to use a state attribute and strip it to use in a TTS action after a trigger in an automation. I am able to get the default ‘state’, but I’m trying to get the ‘Game’ attribute under this state. service: tts.google_translate_say data: entity_id: media_player.google_home language: nl message: >- De status is ...