Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powershell command for triggering automation #1

Open
YOZZOPANOZZO opened this issue Oct 20, 2020 · 0 comments
Open

Powershell command for triggering automation #1

YOZZOPANOZZO opened this issue Oct 20, 2020 · 0 comments

Comments

@YOZZOPANOZZO
Copy link

YOZZOPANOZZO commented Oct 20, 2020

Frist of all, I want to thank you for sharing this, it took literally 2 minutes to set up and it works great! awesome work.
I have a question though.
Is there a way to trigger an automation without having to click on it? for instance, I want my amp to be turnd on as soon as my computer starts. By looking at your code I tried putting together a powershell command that is able to do just that (which I would then run at startup through task scheduler)
this is what I came up with, but unfortunately it does not work:

invoke-RestMethod -Method POST -Body (@{entity_id = "automation.amp2"} | ConvertTo-Json) -Uri "http://homeassistant.local:8123//api/services/automation/trigger" -Headers "Authorization" = "Bearer LONG_LIVED_TOKEN"; "Content-Type = "application/json"

What am I my doing wrong?

Thanks again.

@YOZZOPANOZZO YOZZOPANOZZO changed the title Trigger a single automation on a schedule Powershell command for triggering automation Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant