Hi,
I have a problem i’m not sure how to work around.
The To-value has a + in it so the automation won’t fire.
When i read the documentation there should be “” around the To-value.
But if i go into YAML-mode and add “Disney+” and save the editor removes “”.
I’m guessing the + is the problem since i have separate triggers on for example Netflix in the same automation, that works.
trigger:
- platform: state
entity_id: media_player.living_room_tv
attribute: source
to: Netflix
- platform: state
entity_id: media_player.living_room_tv
attribute: source
to: Twitch
- platform: state
entity_id: media_player.living_room_tv
attribute: source
to: SVT Play
- platform: state
entity_id: media_player.living_room_tv
attribute: source
to: Disney+
All but Disney+ works.
Anyone have an idea how to workaround this problem?
If the Automations YAML editor is removing double quotes from an attribute that contains special characters (+) and should be a string, then it sounds like a straight-up bug.
Does the same happen with single quotes (which don’t parse escape codes like \n)?
I’ve seen annoying rework of whitespace around more complex YAML like multi-line {{ templates }} formatted specially for readability.
I checked that, it is with +
Used that way to know what to write in the automation.
Question is if the right place to fix this is in the lg tv integration so it instead would be Disney plus. Or is it better to have it changed in the automation editor so quotations is used like the docs say?
Easiest i would assume is change the lg tv integration?
I think we have different definitions of “Easiest”.
Getting a change pushed through to an integration involves multiple people and takes time.
Before proceeding with your plan, have you searched the other topics which mention LG? There are a few, and I don’t remember anyone mentioning issues with Disney+
the only work around I know would be to completely write the automation in yaml and bypass the UI editor completely for that automation. There are some things you need to do before you can do that tho.
first you need to create a new file in your config directory (where configuration.yaml is) and call it something readable like automations_yaml.yaml
then go to your configuration.yaml file and add an entry:
automation yaml: !include automations_yaml.yaml
then go to the automation you created in the UI and copy the yaml for it. Paste the code you just copied into the automations_yaml.yaml file you just created above. Ensure indentations are correct.
Add the quotes around your “Disney+” then save the file.
reload automations from the developers tools-yaml tab (do a config check first).
Your automation should show up your automations list with proper formatting maintained.
If it doesn’t show up but if not then do a full restart of HA.
Then you should probably submit an issue to the UI editor github.