Skip to content

Powershell command for triggering automation #1

Description

@YOZZOPANOZZO

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions