I have been pulling my hair out to try and resolve a simple automation/ condition out but cant get it right.
Here is my code:
trigger:
- platform: state
entity_id: binary_sensor.sm_s906b_is_charging
to: 'on'
condition:
condition: and
conditions:
- "{{ state_attr("sensor.ahmeds22_room_presence", "distance") == '0.1' }}"
- condition: state
entity_id: sensor.ahmeds22_room_presence
state: 'Livingroom'
action:
- service: notify.alexa_media
data:
but I get an error saying:
2022-06-17 11:16:24 ERROR (MainThread) [homeassistant.components.automation] while parsing a block collection
in "/config/automations.yaml", line 17, column 7
expected <block end>, but found '<scalar>'
in "/config/automations.yaml", line 17, column 25
Can anyone shade some light as to what I am doing wrong? Thanks.
that did it thanks @petro. With regards to 0.1, you reckon I should use it as a float? so remove the ' ? Ideally I want to replace it with < 0.2 as the distance may change erratically and not always 0.1.