Skip to content

Home Assistant Notifications

Overview

  1. Access your profile after logging into your Home Assistant website.
  2. You need to generate a Long-Lived Access Tokens via the Create Token button (very bottom of profile page)

Valid syntax is as follows:

  • hassio://{host}/{long-lived-access-token}
    • ☝️ This is the one that is most commonly used.

By default hassio:// will use port 8123 (unless you otherwise specify). If you use hassios:// (adding an s) to the end, then you use the https protocol on port 443 (unless otherwise specified).

So the same URL’s above could be written using a secure connection/port as:

  • hassios://{host}/{access_token}

The other thing to note is that Home Assistant requires a notification_id associated with each message sent. If the ID is the same as the previous, then the previous message is over-written with the new. This may or may not be what your goal is.

So by default Apprise will generate a unique ID (thus a separate message) on every call. If this isn’t the effect you’re going for, then define your own Notification ID like so:

  • hassio://{host}/{long-lived-access-token}?nid=myid
VariableRequiredDescription
access_tokenYesThe generated Long Lived Access Token from your profile page.
hostnameYesThe Web Server’s hostname
portNoThe port our Web server is listening on. By default the port is 8123 for hassio:// and 443 for all hassios:// references.
nidNoAllows you to specify the Notification ID used when sending the notifications to Home Assistant. By doing this, each message sent to Home Assistant will replace the last.
VariableDescription
overflowThis parameter can be set to either split, truncate, or upstream. This determines how Apprise delivers the message you pass it. By default this is set to upstream
👉 upstream: Do nothing at all; pass the message exactly as you received it to the service.
👉 truncate: Ensure that the message will fit within the service’s documented upstream message limit. If more information was passed then the defined limit, the overhead information is truncated.
👉 split: similar to truncate except if the message doesn’t fit within the service’s documented upstream message limit, it is split into smaller chunks and they are all delivered sequentially there-after.
formatThis parameter can be set to either text, html, or markdown. Some services support the ability to post content by several different means. The default of this varies (it can be one of the 3 mentioned at any time depending on which service you choose). You can optionally force this setting to stray from the defaults if you wish. If the service doesn’t support different types of transmission formats, then this field is ignored.
verifyExternal requests made to secure locations (such as through the use of https) will have certificates associated with them. By default, Apprise will verify that these certificates are valid; if they are not then no notification will be sent to the source. In some occasions, a user might not have a certificate authority to verify the key against or they trust the source; in this case you will want to set this flag to no. By default it is set to yes.
ctoThis stands for Socket Connect Timeout. This is the number of seconds Requests will wait for your client to establish a connection to a remote machine (corresponding to the connect()) call on the socket. The default value is 4.0 seconds.
rtoThis stands for Socket Read Timeout. This is the number of seconds the client will wait for the server to send a response. The default value is 4.0 seconds.
emojisEnable Emoji support (such as providing :+1: would translate to 👍). By default this is set to no.
Note: Depending on server side settings, the administrator has the power to disable emoji support at a global level; but default this is not the case.
tzIdentify the IANA Time Zone Database you wish to operate as. By default this is detected based on the configuration the server hosting Apprise is running on. You can set this to things like America/Toronto, or any other properly formated Timezone describing your area.

Send a Home Assistant notification that always replaces the last one sent:

Terminal window
# Assuming the {hostname} we're hosting Home Assistant on is just myserver.local (port 8123)
# Assuming our {long_lived_access_token} is 4b4f2918fd-dk5f-8f91f
# Fix our Notification ID to anything we want:
apprise -vvv hassio://myserver.local/4b4f2918fd-dk5f-8f91f?nid=apprise

Secure access to Home Assistant just requires you to add an s to the schema. Hence hassio:// becomes hassios:// like so:

Terminal window
# Assuming the {hostname} we're hosting a secure version of Home Assistant
# is accessible via my.secure.server.local (port 443)
# Assuming our {long_lived_access_token} is 4b4f2918fd-dk5f-8f91f
apprise -vvv hassios:///my.secure.server.local/4b4f2918fd-dk5f-8f91f

Send a simple notification using only your Long-Lived token to your instance running on port 8123 (default insecure hosting)

Terminal window
# Assuming the {hostname} we're hosting a secure version of Home Assistant
# is accessible via my.server.local (port 8123)
# Assuming our {long_lived_access_token} is 4b4f2918fd-dk5f-8f91f
apprise -vvv hassio:///my.server.local/4b4f2918fd-dk5f-8f91f
  • If you receive a 401 Unauthorized error, ensure your token is valid and has not expired.
  • If you are using HTTPS with a self-signed certificate, you may need to adjust your Home Assistant or Apprise configuration to allow unverified SSL connections. e.g. hassios://my.secure.server/{token}?verify=no