Invalid config for [automation]: invalid template (TemplateSyntaxError: expected token ānameā, got ā|ā) for dictionary value @ data[āactionā][1][ādata_templateā][āringtone_volā]. Got None.
It seems it doesnāt like the OR condition (||), plus it doensāt recognize the ringtone_vol value (but this depends for sure from first error). Could someone help here to add OR to IF THEN? Thank you
Thank you for reply, Iāll try it asap even if Iām suspetting the state doesnāt work or at least is not valorized with word āhomeā, so first I would like to try to send me a notification with device state, but also there Iām getting crazy
/home/homeassistant/.homeassistant/configuration.yaml: while parsing a block mapping
in ā/home/homeassistant/.homeassistant/automations.yamlā, line 333, column 7
expected āblock endā, but found āscalarā
in ā/home/homeassistant/.homeassistant/automations.yamlā, line 336, column 11
{% if 'home' in [ states.device_tracker.mobile1.state, states.device_tracker.mobile2.state ] %}
0.02
{% else %}
0.10
{% endif %}
I think @lolouk44ās implementation will work too using 0.02 and 0.10. The documentation for ringtone_vol says that it requires a % value which home assistant typically uses 0 to 1 (at least for media_player devices).
EDIT: Itās hard to sayā¦ the documentation points to using 8 as a value. I donāt know why @lolouk44ās automation isnāt working. Chances are my implementation wonāt work either.
EDIT 2: I just checked the source code. The min is 0 the max is 100. So, iām not sure why either @lolouk44ās implementation isnāt working.
Guys, I found the root cause of the error, and thatās a crazy issue. As I wrote I have 2 devices, real names assigned by HA are:
mine: device_tracker.ce051605ca46151234
And my wifeās one: device_tracker.52101ef647546529
The long number string is the devices serial number.
Well, the problem is my wifeās device (Iāve always known that wives are the problem )
I donāt know why, but HA doesnāt like the device name. If, for example I modify it to: device_tracker.cd52101ef647546529
HA accept the configuration and doesnāt give me any error. Obliviously the automation doesnāt work due to wrong device name.
Now, how can I solve this issue? The device name is automatically assigned by HA into know_devices.yaml
EDIT 1:
Well, seem I solved in this way (using āā ):
{% if 'home' in [ states.device_tracker.ce051605ca46151234.state, 'statesdevice_tracker.52101ef647546529' ] %}
script.gateway_volume_ten
{% endif %}
No more error from HA, letās see if the automation works.
EDIT 2: Nope, Iām surrenderingā¦ The quotes just report the name od device_tracker as state, so automation doesnāt workā¦ Thatās really oddā¦
Not sure. I can say that typically python does not like numbers as starting characters of object names. That could be your issue. Try swapping to this:
{% if 'home' in [ state('device_tracker.ce051605ca46151234'), state('statesdevice_tracker.52101ef647546529') ] %}
script.gateway_volume_ten
{% endif %}
This explain why I got the error, and youāre absolutely right about python.
To chek whatās the tracker state, I sent a notification to my phone, like: