Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
## 🐛 Bug fixes
- *Actions*: the `supernotify.*` actions, such as `supernotify.notify` and `supernotify.snooze`, are there from when Home Assistant starts, rather than only once Supernotify has loaded, so an automation using them no longer fails to validate while it starts, or if it failed to start. Until it has loaded, they say so with an error. Home Assistant's [action-setup](https://contributors.home-assistant.io/core/quality-scale/action-setup/) rule, needed for its Bronze quality level

## 📝 Other changes
- *Documentation*: a page on [Supernotify's entities](https://supernotify.rhizomatics.org.uk/latest/usage/entities/), what each does and when it updates, and [common problems](https://supernotify.rhizomatics.org.uk/latest/help/troubleshooting/#common-problems) on the Troubleshooting page, each with its cause and fix

# v2.19.1

## ✨ Enhancements
Expand Down
32 changes: 19 additions & 13 deletions custom_components/supernotify/quality_scale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,20 @@ rules:
comment: Not applicable - integration does not support discovery.

docs-data-update:
status: todo
status: done
comment: |
Need a doc section explaining that diagnostic entities (e.g.
sensor.notifier_whisper_attivo) update on notification/scenario events,
not on a poll interval.
docs/usage/entities.md "How Entities Update": nothing is polled, and no outside service is
called to update entities, so no rate limits apply. Scenario condition binary_sensors are
re-evaluated on state changes of their condition entities and on a timer set in
scenario_control; the counters change as notifications are sent; switches when switched.

docs-examples:
status: todo
status: done
comment: |
Rule wants automation blueprints. docs/recipes/ (24 markdown recipes)
covers similar ground informally but isn't in blueprint-exchange format.
The rule accepts YAML automation examples as well as blueprints. docs/recipes/ has YAML
examples for common uses, including complete automations (someone_at_the_door,
restart_email, dishwasher_live_activity, voice_described_cctv), and docs/usage/notifying.md
shows the actions in automations.

docs-known-limitations:
status: done
Expand All @@ -275,16 +278,19 @@ rules:
exempts this case.

docs-supported-functions:
status: todo
status: done
comment: |
Partially covered by docs/usage/actions.md and docs/transports/*, but not
organized as a single supported-functionality reference per the rule.
docs/usage/entities.md lists the entities on each platform (notify, switch, binary_sensor,
sensor, button) and what each does, alongside docs/usage/actions.md for the actions and
docs/transports/ for the transports.

docs-troubleshooting:
status: todo
status: done
comment: |
docs/help/troubleshooting.md lists the debugging tools (archive, diagnostics, debug mode,
enquire actions) but not common symptoms with their causes and fixes, which the rule asks for.
docs/help/troubleshooting.md "Common Problems" gives the symptom, cause and fix for the
problems users can solve themselves: notifications left out by a rule (by suppression
reason), actions when Supernotify isn't loaded, duplicate detection, email without a sender or with a missing attachment,
snapshot URLs, unrendered templates and unknown scenario binary_sensors.

docs-use-cases:
status: done
Expand Down
85 changes: 85 additions & 0 deletions docs/help/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,91 @@ description: Tips, tricks and tools for debugging issues
---
# Troubleshooting

## Common Problems

### A notification doesn't arrive

**Symptom**: the notification is sent, without an error, but nothing arrives, or it doesn't arrive by every delivery
expected. The log has a warning like `SUPERNOTIFY No deliveries made for ...`, followed by the reasons.

**Cause**: a rule left it out, as configured. The reasons are:

| Reason | Why | To fix |
|----------------------|------------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| `SNOOZED` | The recipient, delivery or everything is snoozed | List snoozes with `supernotify.enquire_snoozes`, and end them with `supernotify.unsnooze` |
| `PRIORITY` | The notification's priority isn't one the delivery is for | Change the notification's `priority`, or the delivery's, see [Deliveries](../configuration/deliveries.md) |
| `OCCUPANCY` | The delivery is only for recipients at home, or only away | Check with `supernotify.enquire_occupancy`, see [Deliveries](../configuration/deliveries.md) |
| `DELIVERY_CONDITION` | The delivery's conditions don't hold | See [Conditions](../configuration/conditions.md) |
| `NO_SCENARIO` | The delivery is only for a scenario that doesn't apply | Check with `supernotify.enquire_active_scenarios`, see [Scenarios](../configuration/scenarios.md) |
| `TRANSPORT_DISABLED` | The transport is switched off | Switch it on, or press *Reset overrides*, see [Entities](../usage/entities.md) |
| `NO_TARGET` | The delivery has no one to send to | Give the recipients the addresses or devices it needs, see [People](../configuration/people.md) |

`supernotify.enquire_last_notification` shows what happened to the last notification, and the
[Archive](../configuration/archiving.md) to every one.

### An action says Supernotify isn't loaded

**Symptom**: a `supernotify.*` action, such as `supernotify.notify`, fails with *Supernotify isn't loaded*.

**Cause**: Supernotify is still starting, failed to start, or is disabled. If it failed, the log has
*Supernotify failed to start, and will retry*, with the reason, and it tries again by itself.

**Fix**: check the reason in the log and on the integration's page, correct the configuration, and reload
the integration, or enable it if it's disabled.

### The same notification is only sent once

**Symptom**: a notification sent again soon after, with the same message and title, doesn't arrive.

**Cause**: duplicate detection, which leaves out a repeat of a recent notification at the same or a lower priority.

**Fix**: send it with `force_resend: true`, or change the policy, see [Duplicate Detection](../configuration/dupe_detection.md).

### No emails are sent

**Symptom**: nothing goes by email, and the log has a warning at startup that there is no sender.

**Cause**: a direct SMTP email needs a sender address, as Home Assistant's own SMTP integration does.

**Fix**: set `sender` in the email transport's `options`, or set up the SMTP integration from the UI, for
Supernotify to reuse, see [Email](../transports/email.md#configuring).

### An image is missing from an email

**Symptom**: the email arrives without its image, and the log has a warning that the attachment was skipped.

**Cause**: only files in Supernotify's media path, or a folder Home Assistant allows files to be read from, are attached.

**Fix**: save the image in the media path, `www`, a folder in `media_dirs` or one in `allowlist_external_dirs`, see
[Email](../transports/email.md#image-attachments).

### A snapshot URL gives no image

**Symptom**: a notification with a `snapshot_url` arrives without the image, and there may be a repair listing why.

**Cause**: the URL didn't give an image, it was bigger than the *Largest Snapshot Download* setting, or, with
*Only Local Snapshot URLs* on, it isn't Home Assistant itself, on the same network, or in `allowlist_external_urls`.

**Fix**: see [Snapshot URLs](../configuration/multimedia.md#snapshot-urls).

### A template shows as text

**Symptom**: a message has `{{ ... }}` in it, rather than what the template should give.

**Cause**: the *Render Templates in Notify Calls* setting is off, as it is for new installs, so a template that
reaches Supernotify unrendered, such as from AppDaemon or a `{% raw %}` block, is left as it is.

**Fix**: switch the setting on, or move the template into a scenario's `message_template`, see
[Automation and Templates](../usage/notifying.md#automation-and-templates).

### A scenario's binary sensor is unknown

**Symptom**: a *Scenario Condition* binary sensor stays *unknown*.

**Cause**: `refresh` is off in `scenario_control`, so nothing keeps its state current, or the scenario has no conditions.

**Fix**: switch on `refresh`, see [Entities](../usage/entities.md#how-entities-update) and [Scenarios](../configuration/scenarios.md).

## Options

- [AI Agents](./ai_help.md) can give very good help these days, even the free one built into [Google Search](./ai_help.md#google-and-ai-assisted-help).
Expand Down
76 changes: 76 additions & 0 deletions docs/usage/entities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
tags:
- entities
- scenario
- recipient
- delivery
- transport
- administration
description: The entities Supernotify adds to Home Assistant, what each does, and when they update
---
# Entities

Supernotify adds these entities to Home Assistant. Apart from the recipients' notify entities, they all
belong to a single *SuperNotify* device, on the integration's page. Supernotify is a service, not a
device integration, so the same entities are available whatever phones, speakers or other devices
notifications go to.

## Notify

| Entity | What it does |
|-------------------|--------------------------------------------------------------------------------------------------|
| Notify *recipient* | One for each recipient. Sending a message to it notifies that recipient, with all their usual deliveries, occupancy, scenarios, snoozes and duplicate checks applied. Only a message and title can be given, as for any notify entity; use the [`supernotify.notify`](actions.md) action for anything more |

## Switches

Each switch turns something on or off at runtime, overriding its `enabled` in the configuration.
The override is kept across a restart or reload, until the configured value itself changes. The
*Reset overrides* button puts them all back. All are configuration entities.

| Entity | What it does |
|---------------------------------|------------------------------------------------------------------------------|
| Scenario *scenario* | Whether the scenario is enabled, and so able to apply to notifications |
| Recipient *recipient* Enabled | Whether the recipient is enabled, and so able to be notified |
| Delivery *delivery* Enabled | Whether the delivery is enabled, and so able to be used for notifications |
| *Transport* Enabled | Whether the transport is enabled. When off, none of its deliveries are used |

## Binary Sensors

All are diagnostic entities.

| Entity | What it shows |
|---------------------------------|------------------------------------------------------------------------------|
| Scenario Condition *scenario* | Whether the scenario's conditions hold right now, evaluated at medium priority with the current occupancy. Read only: whether the scenario is enabled is its switch. It is *unknown* if `scenario_control` has `refresh` switched off, see [Scenarios](../configuration/scenarios.md) |
| Scenario Manual *scenario* | For a scenario with no conditions of its own. This one is the control: a script or automation sets it on or off, and the scenario applies while it's on. Kept across a restart |
| Recipient *recipient* | Whether the recipient is enabled. Deprecated, use the recipient's switch |
| Delivery *delivery* | Whether the delivery is enabled. Deprecated, use the delivery's switch, and disabled unless switched on |
| Transport *transport* | Whether the transport is enabled. Deprecated, use the transport's switch, and disabled unless switched on |

## Sensors

Both are diagnostic entities, counting up from when Supernotify was installed, and kept across a restart.

| Entity | What it counts |
|------------------------|---------------------------------------------------------------------------------------------------------|
| Notifications sent | Notifications delivered by at least one delivery. A notification with `dry_run` isn't counted |
| Notification failures | Notifications that stopped with an unexpected error. A delivery failing, or a notification skipped by a rule such as a snooze, isn't counted, see [Troubleshooting](../help/troubleshooting.md) |

## Button

| Entity | What it does |
|------------------|-----------------------------------------------------------------------------------------------------------|
| Reset overrides | Puts every scenario, recipient, delivery and transport switched on or off at runtime back to its configured state, the same as the `supernotify.reset_overrides` action. A configuration entity |

## How Entities Update

Supernotify doesn't poll anything, and has no requests to an outside service to update its entities, so
no rate limits or quotas apply. Its entities change when something happens:

- The **switches** change when switched, or when *Reset overrides* is pressed or the configuration changes
- The **Scenario Condition** binary sensors are evaluated again straight away when an entity in their conditions
changes state, and once a minute for conditions that depend on the time or date, or on something Home Assistant
can't track. Both are set in `scenario_control`, see [Scenarios](../configuration/scenarios.md)
- The **counters** change as each notification is sent
- **Recipient**, **delivery** and **transport** binary sensors change with their switches

The `supernotify.refresh_entities` [action](actions.md) publishes the state of every entity again, if one ever looks out of date.
Loading