Hi there,
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?
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.
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 off to playing, with the condition that the state of lights.room are on, then you turn_on those lights with a brightness50.
Hey Tinkerer,
really appreciate your help with this.
I tried to follow your advice and manuals and set this script in configuration.yaml:
automation:
trigger:
platform: state
entity_id: media_player.big_screen
to: ‘playing’
action:
service: tts.google_say
entity_id: media_player.living_room_home
data:
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.
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?
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…
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.