How to use Text Formatting in a Pushover Notification from Home Assistant

Written by

Jannick Nijholt

Published on

28/08/2024

Last update

28/08/2024
BlogUncategorized

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
Pushover notification message setup interface.

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>

Here is an example of a Pushover notification action using HTML formatted/styled text in Home Assistant.

Pushover notification action in Home Assistant where data has been added, so the HTML in the notification will be parsed by Pushover.

This is how the parsed notification looks like in the Pushover iOS app:

Garage door alert from Home Assistant in Pushover where the HTML formatted text has been parsed. Saying The garage door is still open! Be aware! (in bold) The garage door has been open for 5 minutes. Where 5 minutes is italic.

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!

Profile Picture of Jannick Nijholt

Question, comment or an idea?

Shoot me an email!
You can reach me on [email protected]