Lately, I decided to move from Telegram to Pushover as my go-to platform for notifications about my smart home. During this transition, I ran into the small issue of formatting the Pushover notifications, so specific parts of the notifications are presented bold or underlined.
Let me show you how you’re able to format you to use HTML formatting for notifications sent from your Home Assistant install to Pushover.
Set the HTML parameter when using the Pushover API
To utilize formatted text in Pushover, HTML parsing must be enabled. As can be red on the Pushover API page, this needs to be done by setting the parameter HTML
to 1
. This will enable HTML parsing on the side of Pushover.
But the question is, how can this be set up in Home Assistant?
Sending a Pushover notification with Home Assistant
When creating an automation in Home Assistant, you’re able to add the action Send a notification with pushover (assuming you’ve already successfully set up the Pushover integration). In this action, you have the following fields to fill:
- message; the message you want to send in the notification
- title; the title of the notification
- target; the user/group key of the destination for the notification
- data; extra data to push along with the API request
In a default scenario, you only fill the message field with the notification you intend to send. In that case, the notification will be sent using the API key to the user/group key you gave during setup of the integration.
But we want to style our message. Let me tell you how to do this.
Add HTML to format/style your notification text
To format your notification text, add this adjustment to your Home Assistant action:
- Check the checkbox besides data, now the input field will be open and ready to use
- In the input field, add the following text:
html: 1
- Now for the rest of your message, use HTML tags to style your text, for example:
- For bold text:
<b>This is bold text</b>
- For italic text:
<i>This is italic text</i>
- For underlined text:
<u>This is bold text</u>
- For bold text:
Here is an example of a Pushover notification action using HTML formatted/styled text in Home Assistant.
This is how the parsed notification looks like in the Pushover iOS app:
And that’s it! By simply adding html: 1
in your Home Assistant Pushover notification action card, you can use HTML to format text in your Pushover notifications!