Pular para o conteúdo

Home Assistant

Uma integração HACS nativa que conecta mudanças de estado de entidades do Home Assistant a Atividades ao Vivo do PushWard no seu iPhone.

ℹ Informação

Unlike other PushWard integrations, Home Assistant uses a custom HACS component — no Docker container required.

Requirements

  • Home Assistant 2025.7.0 or newer
  • The PushWard app on your iPhone, or on an Android phone (Android 12 or later)
  • A PushWard integration key (your default key works out of the box)

Installation

Via HACS (Recommended)

PushWard is in the default HACS store, so there is no custom repository to add.

  1. Open HACS in Home Assistant
  2. Search for "PushWard"
  3. Open it and click Download
  4. Restart Home Assistant

Manual

Copy custom_components/pushward/ from the repository into your Home Assistant's custom_components/ directory and restart.

Setup

Go to Settings > Devices & Services > Add Integration > PushWard.

FieldDescription
Integration KeyYour hlk_ integration key (the default key works)

Use sua chave de integração padrão no app PushWard em Configurações → Chave de Integração ou crie uma chave com escopo restrito para esta integração.

Adding Entities

After setup, click "Add tracked entity" on the integration card. Each entity becomes a Live Activity.

FieldDefaultDescription
Entity—Any Home Assistant entity
Activity SlugAuto (ha-<entity-id>)Unique identifier on PushWard
Activity NameEntity IDDisplay name shown on iPhone
IconDomain defaultSF Symbol name (e.g., washer, thermometer) or MDI icon with mdi: prefix (e.g., mdi:washing-machine, mdi:thermometer)
Priority10–10 eviction priority
Templategenericgeneric, countdown (Timer), alert, steps, gauge, timeline, board, or log
Start StatesDomain defaultComma-separated states that start the activity
End StatesDomain defaultComma-separated states that end the activity
Min. Update Interval5sCooldown between mid-activity updates
Progress Entity / Attribute—0–100 percentage, from the tracked entity or a separate one
Remaining Time Entity / Attribute—Remaining seconds, from the tracked entity or a separate one (auto-parses timestamp, duration, H:MM:SS, or plain seconds)
Accent ColorBlueColor for the Live Activity accent

Each value (remaining time, progress, subtitle, gauge value, current step, fired-at) can read from a separate entity or attribute, so an appliance with separate state and time-remaining sensors needs no template helper.

The board and log templates compose several entities into one activity. A board shows 1–4 tiles, each reading from a separate entity; a log shows a newest-first list of up to 20 lines, with optional extra columns (an attribute or another entity's value) and a per-line severity level.

Domain Defaults

Start/end states and icons are pre-filled based on the entity's domain. The default icons are Material Design (mdi:) names, which PushWard accepts alongside SF Symbols:

DomainIconStart StatesEnd States
binary_sensormdi:toggle-switch-variantonoff
switchmdi:toggle-switch-variantonoff
climatemdi:thermostatheating, coolingoff, idle
vacuummdi:robot-vacuumcleaningdocked, idle
media_playermdi:castplayingoff, idle, paused
lockmdi:lockunlockedlocked
covermdi:window-openopening, closingopen, closed
timermdi:timer-outlineactiveidle, paused
sensormdi:eyemanualmanual

Activity Lifecycle

Start

The integration listens for state changes on the entities you configure. When an entity enters a start state (e.g., a washer turns on), it creates the activity on PushWard (if it doesn't exist) and a Live Activity appears on your Lock Screen via push-to-start.

Updates

While active, any state or attribute change — on the tracked entity or any configured companion entity — triggers a throttled update. Rapid changes are coalesced — only the latest state is sent when the cooldown expires. The integration is entirely event-driven, so the update interval is a rate-limiter, not a polling period.

End

When the entity reaches an end state, a two-phase dismissal runs:

  1. A "Complete" update is sent (green accent, checkmark icon). The progress bar keeps its last value rather than jumping to 100% -- only the steps and gauge templates fill the bar to its maximum.
  2. After 5 seconds, the activity is ended and dismissed from the Lock Screen

If the entity starts again during the 5-second window, the end is cancelled.

HA Restart

On Home Assistant restart, any tracked entity already in a start state automatically resumes its Live Activity.

Notifications, Widgets & Email

Beyond mirroring entities to Live Activities, the integration exposes services for the rest of the PushWard surface. Each needs the matching permission on your integration key — your default key has all of them:

  • iOS widgets — add a tracked widget sub-entry (event- or poll-triggered, 10–3600 s) to push Home Screen widgets in the value, progress, gauge, status, and stat_list templates, or call pushward.widget_refresh to force a refresh and pushward.delete_widget to remove one. Needs widgets at write.
  • Push notifications — the pushward.send_notification service sends a regular (non-Live-Activity) push with title, body, level (including critical), actions, and rich media. It can also send the notification later or on a repeating schedule, and its buttons can record an answer for the automation to act on. Needs notifications at send, or schedule for scheduled ones. For a plain title and body there is also the notify entity (0.55.0 and later).
  • Transactional email — the pushward.send_email service delivers email to a verified recipient of your account. Needs emails at send.

For driving an activity straight from an automation (rather than tracking an entity), the create, update, end, and delete services are all available. Update actions are template-specific — pushward.update_activity_generic, …_steps, …_gauge, and so on — so each action's form only shows the fields that template uses.

Notify entity

Integration 0.55.0 and later give each entry a notify entity on the same device, named after the entry: notify.pushward_push_notification for an entry titled PushWard. It takes notify.send_message, and it can sit in a notify group with other notify entities. The Companion app's notify.mobile_app_* is a legacy notify service, not an entity, so it cannot join the same group.

- action: notify.send_message
  target:
    entity_id: notify.pushward_push_notification
  data:
    title: Washer
    message: The washer is done.

The message goes out like a pushward.send_notification with only a title and body, so an encryption key seals it (a message too long for the sealed envelope is shortened to fit) and a used-up notification quota refuses it. notify.send_message does not always carry a title; without one, the title is your Home Assistant's name from Settings > System > General ("Home" unless you changed it), so the phone shows which home sent it. For levels, links, buttons or scheduling, use pushward.send_notification.

From 0.55.0, a tap or button url that starts with a single /, like /lovelace/kitchen or /api/webhook/close-valve, is a path on your Home Assistant. Before the call goes out it becomes a full URL on Home Assistant's external URL (Settings > System > Network, Internet), or on the Home Assistant Cloud URL when no external URL is set. The internal URL is never used, since the phone may be away from home when someone taps. Without either, the action fails and says so. Full URLs (https://..., homeassistant://...) are sent as they are.

That covers url and the action urls of send_notification, and url, secondary_url, tap_action, url_action, secondary_url_action, board tiles' url_action, media controls and approval options on the activity update actions. media, icon_url, image_url and callback_url still take full URLs only. To open a dashboard in the Companion app rather than the browser, keep using homeassistant://navigate/lovelace/kitchen.

Silent buttons need https. Media controls, approval options, and every action or notification button without foreground: true are requests the phone sends in the background; iOS refuses cleartext for them and Android drops the button. With an http:// external URL such a path goes out on the Cloud URL instead, and without Home Assistant Cloud the action fails. Plain url and secondary_url strings and foreground: true actions open in the browser, so they may stay on http. A dashboard path on an action without foreground: true is fetched in the background, not opened.

A path to a webhook makes a silent button. Give it method: POST (media controls and approval options already default to it), because a webhook trigger takes only POST and PUT unless you change allowed_methods. The request arrives through the external or Cloud URL, so turn off Only accessible from the local network on the trigger. With the default local_only: true, Home Assistant answers 200, logs "Received remote request for local webhook", and the automation never runs.

- action: pushward.send_notification
  data:
    title: Water leak
    body: Kitchen sensor is wet
    actions:
      - id: close
        title: Close valve
        url: /api/webhook/close-valve
        method: POST

# the automation behind it
- triggers:
    - trigger: webhook
      webhook_id: close-valve
      allowed_methods: [POST]
      local_only: false
  actions:
    - action: valve.close_valve
      target:
        entity_id: valve.main_water

Timers: counting up, goals and pausing

Integration 0.53.0 and later drive the timer template (countdown) in both directions. pushward.update_activity_countdown takes four fields on top of end_date, duration, start_date, warning_threshold, alarm and snooze_seconds:

FieldDescription
directiondown (the default) counts down to the end; up counts up from start_date. Leave start_date out to start now, or give a past timestamp for something that began earlier
goalUp only: a target in seconds or a duration string such as "2h". The ruler fills toward it; past it the clock turns orange and keeps counting as overtime. The goal stays on the slug, so a timer restarted on the same slug still has the last run's target: send goal: null to remove it (an empty string is refused)
show_rulerfalse hides the ruler in either direction. On by default
pausedtrue freezes the clock and false resumes it, in either direction. Sending the state the timer is already in changes nothing, so an automation can send it on every update

An up timer has no end, so the action refuses end_date, duration, warning_threshold, alarm, snooze_seconds and completion_message next to direction: up, and a goal next to direction: down; goal: null, the clear, passes in either direction. A call without direction keeps the stored one, which only the server knows, so a wrong pairing there fails with the server's message instead. Leave the message out of pushward.end_activity for an up timer as well.

- action: pushward.update_activity_countdown
  data:
    slug: kid-nap
    state: ongoing
    state_text: Asleep
    direction: up
    goal: 2h

pushward.pause_timer pauses a timer by slug, or resumes it with paused: false (paused defaults to true). Counting up, the paused time is left out of the clock, so the start time on the card stays right; counting down, the end moves on by the length of the pause. While a count-down is paused, leave end_date and duration out of its updates: either one starts a new window and clears the pause (see Pausing).

- action: pushward.pause_timer
  data:
    slug: kid-nap
    paused: false

The action sends only the switch and the template stays what it is. An ended timer ignores it, so the time it stopped at stays put.

On any other template the server refuses the pause and the action fails with its message. A timer that the 5-activity limit has moved off the phone fails too, with invalid activity state: "preempted": send pushward.update_activity_countdown with state: ongoing to ask for it back, with paused in the same call if you want it paused.

On iPhone, counting up and pausing need PushWard 1.19.0 or later: older versions show an up timer as finished and keep counting down through a pause.

Scheduled and repeating notifications

Add send_at to pushward.send_notification and PushWard holds the notification and sends it at that time, at most 365 days ahead. A time picked in the action editor has no UTC offset, so it is read in Home Assistant's time zone. The send happens on PushWard's side: Home Assistant does not have to be running when it goes out. For reminders from the due dates on a to-do list, with no script to write, use a tracked to-do list.

To repeat it, add a recurrence object:

FieldRequiredDescription
cronYesA 5-field cron expression (minute, hour, day of month, month, day of week) or one of @hourly, @daily, @weekly, @monthly, @yearly. Sends must be at least 15 minutes apart.
timezoneNoIANA time zone name, such as Europe/Warsaw. Defaults to the time zone configured in Home Assistant, so 08:00 means 08:00 at home, across daylight saving changes too.
untilNoDate and time of the last allowed send.
countNoNumber of sends, 1-1000.
  • Set until or count, not both. With neither, the series runs until you cancel it.
  • With a recurrence, send_at is optional and marks where the series starts. Without it, the first send is the next time the cron expression matches, which must be within 365 days.
  • A repeating notification keeps one id for the whole series and takes one of the 25 slots an account has for pending scheduled notifications.
  • Scheduling is free. Each send counts toward your notification quota when it goes out.

Set response_variable on the action to get the id back. A scheduled or repeating send returns scheduled_notification_id, send_at (the next send) and recurrence; one sent right away returns notification_id and answerable. The response only lives for that run, so the example below keeps the id in an input_text helper for the script that stops the reminder.

Iniciar e parar um lembrete em dias úteis
script:
  start_school_run_reminder:
    alias: Start the school run reminder
    sequence:
      - action: pushward.send_notification
        data:
          title: School run in 15 minutes
          body: Shoes, bags, lunch boxes.
          source: home
          recurrence:
            cron: "0 8 * * 1-5"
        response_variable: reminder
      - action: input_text.set_value
        target:
          entity_id: input_text.school_run_reminder_id
        data:
          value: "{{ reminder.scheduled_notification_id }}"

  stop_school_run_reminder:
    alias: Stop the school run reminder
    sequence:
      - action: pushward.cancel_scheduled_notification
        data:
          scheduled_notification_id: "{{ states('input_text.school_run_reminder_id') | int }}"

pushward.cancel_scheduled_notification cancels the schedule, and the PushWard app shows it as canceled for 24 hours. For a repeating one that stops the whole series, even while one of its sends is going out: that send arrives only if it had already gone out, and nothing is sent after it. An id that no longer exists is ignored, so running the stop script twice does no harm.

pushward.list_scheduled_notifications returns scheduled_notifications, a list. status picks which ones: scheduled (the default: still pending, including one being sent right now), sent and failed (both kept for 7 days), canceled (kept for 24 hours) or all. Repeating items also carry recurrence, occurrence (sends so far) and last_sent_at. It only sees the notifications scheduled with this integration's key.

Statuses, failure reasons and more cron examples are on the scheduled notifications page.

Notification answers

Give a notification action no url and PushWard records the tap itself: which button was chosen, and when. Add text_input: true to such an action and the person can type a reply, which is recorded with it (text_input_placeholder and text_input_button_title label the field). An action with foreground: true and no url only opens the app and is never recorded. When at least one action will be recorded, the send_notification response has answerable: true.

pushward.get_notification_answer reads the answer for a notification_id. It waits up to timeout seconds (default 300, at most 86400) and returns as soon as the answer lands, so the automation pauses on that step and the person has that long to tap. timeout: 0 reads once without waiting.

Perguntar antes de fechar a porta da garagem
automation:
  - alias: Ask before closing the garage door
    triggers:
      - trigger: state
        entity_id: cover.garage_door
        to: open
        for: "00:30:00"
    actions:
      - action: pushward.send_notification
        data:
          title: Garage door open
          body: It has been open for 30 minutes. Close it?
          level: time-sensitive
          actions:
            - id: close
              title: Close
              icon: door.garage.closed
            - id: ignore
              title: Ignore
              destructive: true
        response_variable: sent
      - action: pushward.get_notification_answer
        data:
          notification_id: "{{ sent.notification_id }}"
          timeout: 3600
        response_variable: answer
      - choose:
          - conditions:
              - condition: template
                value_template: "{{ answer.action_id == 'close' }}"
            sequence:
              - action: cover.close_cover
                target:
                  entity_id: cover.garage_door

Ignore, and no answer within the hour, both leave the door as it is. The response carries these fields:

FieldDescription
answeredtrue once someone has answered.
statuspending or answered.
action_idThe id of the action that was tapped.
textThe typed reply, for a text_input action.
answered_atWhen the answer was recorded.
reasonOnly when the timeout ran out first. The response then has answered: false and status: pending.
  • The first answer wins. Once one device has answered, later taps on any device change nothing.
  • Answers are kept for 30 days. An automation that should not sit and wait can store the notification_id and read the answer later with timeout: 0.
  • A Home Assistant restart stops a waiting automation like any other. The answer stays on PushWard, so a later read with timeout: 0 still finds it.

The pushward_notification_action event

Integration 0.55.0 and later fire pushward_notification_action on the event bus for each answer to a notification the entry's key sent: a tapped action without a url, a typed reply, an Acknowledge tap, a to-do reminder's Done. It works like the Companion app's mobile_app_notification_action, so an automation that waits for that event ports over by changing the event type and the send action.

Event dataCompanion appDescription
actionactionThe id of the tapped action (pw_ack for the Acknowledge button PushWard adds)
reply_textreply_textWhat was typed into a text_input action, else null
action_idSame as action, under PushWard's own name
notification_idThe notification_id from the send_notification response
collapse_idtagThe collapse_id it was sent with, else null
thread_idgroupThe thread_id it was sent with, else null
answered_atWhen it was answered (RFC 3339)
latetrue when it was answered more than 2 minutes before the event fired, because Home Assistant read it after a restart or an outage
config_entry_idThe PushWard entry whose key sent it

The event carries no action title, nor the notification's title and body; with end-to-end encryption on, PushWard never has them in the clear. The Companion app pattern, with a per-run action id so two runs of the same script don't answer each other:

- variables:
    action_close: "{{ 'CLOSE_' ~ context.id }}"
- action: pushward.send_notification
  data:
    title: "Garage door is open"
    body: "Close it?"
    actions:
      - id: "{{ action_close }}"
        title: Close
- wait_for_trigger:
    - trigger: event
      event_type: pushward_notification_action
      event_data:
        action: "{{ action_close }}"
  timeout: "00:30:00"
  continue_on_timeout: false
- action: cover.close_cover
  target:
    entity_id: cover.garage_door

Matching on notification_id: "{{ sent.notification_id }}" from a response_variable works too. A text reply arrives in {{ wait.trigger.event.data.reply_text }}.

Home Assistant reads the answers from the answer stream, with one long-poll per PushWard entry, and only while something can still be answered: a notification sent in the last 7 days with no answer yet (a scheduled one counts from when it goes out). With nothing like that, no connection is held. The stream's position is kept in .storage, so an answer given while Home Assistant was restarting fires once it is back, as long as that notification is still waited for and the answer is less than an hour old. An answer read late to anything else (more than 7 days after the send, or while nothing was waiting) fires only if it was given in the last 10 minutes. Older answers are skipped, so a tap from yesterday never runs an automation at a random moment. For an automation that must act only on a tap as it happens, add a condition on late:

- condition: template
  value_template: "{{ not wait.trigger.event.data.late }}"

pushward.get_notification_answer reads answers on its own and is not affected.

How recording works, and its limits, is covered on the notification answers page.

Chega na versão 1.17.0 do app

Esta seção descreve um recurso de uma atualização do app que está em análise na App Store. Ele é desbloqueado aqui automaticamente assim que a atualização for lançada.

Chega na versão 1.20.0 do app para iPhone, iPad e Mac, e na versão 1.1.0 para Android

Esta seção descreve um recurso das atualizações do app que estão em análise na App Store e no Google Play. Ele é desbloqueado aqui automaticamente assim que qualquer uma das atualizações for lançada.

To-do reminders

A tracked to-do list turns the due dates on a Home Assistant to-do list into PushWard reminders. Add one under Settings > Devices & Services > PushWard > Add tracked to-do list and pick any todo entity, such as a Local To-do list. Every open item with a due date gets a scheduled notification: the item's title is the push title, and its description is the body (the list name when it has no description).

OptionDefaultDescription
Remind before due0 minSend the reminder this long before the due time, up to 7 days.
Time for date-only items09:00An item with a due date but no time is reminded at this time on that day.
Notification levelactivepassive, active or time-sensitive.
Done buttonOnAdds a Done button to the push. Tapping it completes the item in Home Assistant.
Take back reminders when doneOffRemoves a reminder that already went out from your devices once its item is completed or deleted (integration 0.56.0 and later).
Most reminders scheduled at once101-25. Only the soonest items are scheduled; the rest follow as those go out.

Say the list has a 30 minute lead and you add "Dentist", due tomorrow at 15:00. PushWard schedules a push titled Dentist for 14:30 tomorrow, with a Done button. Tap Done and the item is ticked off in Home Assistant; move the appointment to 16:00 and the reminder moves to 15:30.

  • Adding or editing an item schedules or replaces its reminder right away. Completing or deleting it cancels the reminder.
  • PushWard sends the push itself, so it arrives even if Home Assistant is offline at that time.
  • An item due more than 365 days out is scheduled once it comes within range. An item whose reminder time has already passed gets its reminder within a minute, unless it is more than 90 minutes past due; then it gets none.
  • If you stop a reminder in the PushWard app, the item stays open and gets no new reminder until you change its due date or time. Renaming an item whose reminder already went out does not send it again either.
  • After a reminder goes out, the item stays open until you tick it off. With the Done button, Home Assistant watches for the tap for 24 hours.
  • With Take back reminders when done on, a reminder that already went out is taken back once its item is completed (in Home Assistant or with the Done button) or deleted, the way pushward.clear_notification does it, from every device of the account. That is best effort: Apple Watch keeps the reminder, and so does PushWard on iPhone, iPad or Mac before 1.20; Android removes it from PushWard 1.1.0. Home Assistant forgets a sent reminder 90 minutes after the item's due time, or 24 hours after the send with the Done button on if that is later, so an item completed after that keeps its reminder. Moving an item to a later due time does not take back the reminder that went out for the earlier one, so if you complete the item before its new reminder goes out, the earlier one stays.
  • From integration 0.56.1, an item completed around its reminder time is taken back only once PushWard reports that reminder sent, so the retract almost always reaches your devices after the reminder (PushWard reports it sent just before it pushes it). If PushWard has not sent it yet, Home Assistant cancels it and looks again 10 seconds later, taking it back only if it went out in the meantime; each look counts as one of the 3 tries below. Unticking an item whose reminder was taken back, or canceled this way, sends the reminder again within a minute, unless the item is more than 90 minutes past due. Integration 0.56.0 takes the reminder back 10 seconds after its time without asking PushWard, so one that PushWard sends later stays, and an unticked item gets no new reminder.
  • PushWard allows 10 retracts a minute per account, 5 at once, and Home Assistant keeps under that across all its lists. It stops at the first retract that fails and tries each reminder up to 3 times; the rest wait for the next sync, at the latest an hour later.
  • Every pending reminder takes one of the 25 slots the account has for scheduled notifications, shared with anything else that schedules them. Leave room below 25 if your automations schedule notifications too.
  • Which reminder belongs to which item is kept in Home Assistant's storage, not in the item, so notes synced to other apps (Apple Reminders through the Home Assistant app's Reminders Sync, for example) stay clean.
  • Removing the list, or the whole integration, cancels its pending reminders.

Account Sensors

The integration also creates five sensors that track your PushWard usage against your plan, refreshed about every 15 minutes:

  • sensor.pushward_notifications_used
  • sensor.pushward_live_activity_updates_used
  • sensor.pushward_widget_updates_used
  • sensor.pushward_emails_used
  • sensor.pushward_subscription_tier — free or premium

Example: Washing Machine

Track a washing machine using a sensor entity with a progress attribute:

SettingValue
Entitysensor.washing_machine_status
Iconwasher (or mdi:washing-machine)
Templategeneric
Start Stateswashing, rinsing, spinning
End Statesoff, complete, idle
Progress Attributeprogress_percent
Accent ColorBlue