I know I’m not the first to use the Home-Assistant API in PowerShell, and the project is based on this post.
Anyway, I made this Module (or collection of functions) last year and published it yesterday on GitHub, the point is to interact with Home-Assistant from PowerShell, I think this can be useful. I am open to suggestions, requests and changes
Here is the guthub page:
Current functions and parameters:
Get-HomeAssistantConfig
Get-HomeAssistantEntity
Get-HomeAssistantEntity -entity_id ENTITY_ID
Get-HomeAssistantServices
Invoke-HomeAssistantService -service SERVICE -entity_id ENTITY_ID
Invoke-HomeAssistantService -service SERVICE -json 'JSON'
New-HomeAssistantSession -ip HOME-ASSISTANT_IP -port HOME-ASSISTANT_PORT -token ACCESS_TOKEN
You can make a token at http://HOME-ASSISTANT-IP:8123/profile
For more info: https://developers.home-assistant.io/docs/en/auth_index.html
In action:
I have some plans for the future. One thing I like to be able to do is to update template sensors with information from PowerShell. And maybe make is useful to make automations.