#Trying to use the WebSocket API to trigger an action to send a notification to the companion app

1 messages · Page 1 of 1 (latest)

earnest kiln
#

I'm trying to use the HA WebSocket API to trigger an action to send a notification to the companion app. The HA developer documentation (https://developers.home-assistant.io/docs/api/websocket/#calling-a-service-action) does a nice job of providing an example of the JSON required to call a service for an entity. I've used it successfully to control/interface with entities through the API.

However, while the section of the documentation is called "calling a service action" there is no JSON shown for triggering an action and my efforts to modify the example JSON to trigger the notify action to send a notification to the companion app only result in an error response.

Any help in what the JSON should look like to trigger the notify action so I can send a notification to the companion app would be greatly appreciated.

Thanks in advance for the help.

Home Assistant hosts a WebSocket API at /api/websocket. This API can be used to stream information from a Home Assistant instance to any client that implements WebSockets. We maintain a JavaScript library which we use in our frontend.