I wonder if anyone could help with following dummy question about automation please:
Where can find what can be a trigger and an action for specific component and entity?
For example, if i want google home to say ‘Hello Alex’ when i come home, what should be the trigger for device_tracker and what can be an action for media_player.living_room_home?
Is there any resource available online explaining how it works?
Other than the documentation, there’s a list of examples.
In this case, you’d have something like:
message: "Hello Alex"
You’ll need to chose and configure a TTS platform, and update the above to use your actual entity for the device tracker, and the TTS platform of your choice.
Thanks a lot for this!
That’s really helpful.
But how should i go about when i need something else? For example, if i want to dim the lights when google chromecast starts casting or when it is casting something specific? Generally, where do i find specific fields that i can use in actions and triggers for a specific platform/entity like chrome cast, device_state, etc?
What i mean is that here in docs there is nothing about how to make chromecast to trigger something:
I assume im looking into a wrong place. But where should i look then?
Did you read the documentation links on triggers, and actions? It explains what the various platforms you can use are.
You don’t make the chromecast trigger anything. No device is responsible for triggering anything. What you do is define an automation, that says that when (say)
media_player.chromecast goes from
playing, with the condition that the
on, then you
turn_on those lights with a
It sounds like you skipped the getting started guide, so I’d suggest you read that first, then read the automation section of the main documentation, and the examples section.
really appreciate your help with this.
I tried to follow your advice and manuals and set this script in configuration.yaml:
message: ‘Something is playing’
I expected google home to say: ‘Something is playing’ but it doesn’t.
I feel im realy close now to understanding how automation works in hass and would really appreciate if someone could have a look at the above script and point me to what is wrong with it please?
I should say log file is empty and hass launches fine, so i don’t have any syntax errors i think.
Well, if you format it correctly (see the big blue box at the top - select the text and push
</> on the formatting bar) we might be able to help you.
Have you selected the automation in the HA control panel and pushed Trigger to check that the TTS works?
message: 'Chromecast started playing'
If you manually trigger the automation, does it work?
yeah, i was about to write. How can i manually push this?
Do you mean that i need to create similar rule to what i have in configration.yml but in Hass UI?
Go to the control panel, find your automation, click on it, then push Trigger
Do you mean here? (btw thanks a lot for helping me with this!)
In the pics above, ‘Test’ is something that i’ve just created that is a copy of automation from configuration.yaml. But i don’t see any option to puh the trigger there…
looks like im looking in a wrong place. What do you mean by ‘control panel’?
Sorry, if you go to the top left you’ve got States. In there you’ll find all your automations, sensors, switches etc. If you click on the automation you’ll get a box showing when it last triggered, and the option to manually trigger it.
It looks like when i set automation in configuration.yaml it doesn’t work, but when i set it in UI (and it is saved in automation.yaml) it kind of works. I’ll need to experiment with this now.