Notifications
Цей контент ще не доступний вашою мовою.
This feature comes with Panel Assistant 1.1.
Send a notification from a Home Assistant automation to a panel and it appears over the dashboard as a card drawn in the panel’s own design, light on a dark dashboard and dark on a light one. The options are the ones the Home Assistant Companion app uses on a phone, so an automation you already wrote for your phone works on a panel by changing only the notify action.
Turn it on
Section titled “Turn it on”On the panel’s Configure page, open the advanced settings and turn on Panel notifications in the System section. The dashboard reloads once.
Each panel has its own notify action in Home Assistant: its name starts with notify.panel_assistant_, then the panel’s name and a code. To find it, open Developer tools → Actions and type panel_assistant. The examples below use notify.panel_assistant_living_room_panel; use your panel’s action in its place.
How a message appears
Section titled “How a message appears”Every message joins Home Assistant’s own Notifications list, where you can read it or dismiss it later. That list is shared: dismissing a message removes it from every dashboard.
How much a message interrupts is set by its interruption level, as on a phone:
| Level | On the panel |
|---|---|
passive, or none |
Stays quiet in the Notifications list |
active |
A small notice for 5 seconds, or a card if it has a picture |
time-sensitive |
A card for 10 seconds |
critical |
A card for 20 seconds, edged in red |
A message with buttons is always a card, and it stays on the panel until someone deals with it. Nothing on this page wakes the screen, plays a sound or lights an LED.
Close puts the card away and leaves the message in the Notifications list. Dismiss removes the message from Home Assistant. View notifications opens the list.
Buttons
Section titled “Buttons”Add up to three buttons the same way as for the Companion app. The card then stays until someone taps a button or Dismiss, its timeout passes, or the message is removed from Home Assistant.
- A tap fires the
mobile_app_notification_actionevent, so automations that answer a phone’s buttons answer the panel’s too. The message is then removed, unless you setsticky: true. - Dismiss fires
mobile_app_notification_cleared. - A button with
action: URIopens a page of your Home Assistant, such as/lovelace/cameras. - A new message with the same
tagreplaces the card that is showing.
When the buttons do not fit side by side on a small panel, they go two to a row. If the message then still does not fit, it is shortened to whole lines ending in an ellipsis, and the full text stays in the Notifications list.
Examples
Section titled “Examples”Garage door left open
Section titled “Garage door left open”A time-sensitive card with two buttons. The first is the main action, and a second automation answers it by closing the door.
automation: - alias: 'Garage left open' triggers: - trigger: state entity_id: cover.garage_door to: 'open' for: '00:15:00' actions: - action: notify.panel_assistant_living_room_panel data: title: 'Garage door open' message: 'The garage door has been open for 15 minutes.' data: tag: garage push: interruption-level: time-sensitive actions: - action: CLOSE_GARAGE title: 'Close it' - action: LEAVE_GARAGE title: 'Leave open'
- alias: 'Close the garage from the panel' triggers: - trigger: event event_type: mobile_app_notification_action event_data: action: CLOSE_GARAGE actions: - action: cover.close_cover target: entity_id: cover.garage_doorWater leak
Section titled “Water leak”A critical card is edged in red. sticky keeps it after a button press, so Silence does not hide a leak that has not been dealt with; Dismiss removes it.
actions: - action: notify.panel_assistant_living_room_panel data: title: 'Water leak' message: 'The sensor under the kitchen sink is wet.' data: tag: leak sticky: true push: interruption-level: critical actions: - action: WATER_OFF title: 'Shut off water' - action: LEAK_SILENCE title: 'Silence'A card that leaves on its own
Section titled “A card that leaves on its own”With timeout, in seconds, the Dismiss button counts down the time the card has left. At zero the card leaves the panel, and the message stays in the Notifications list.
actions: - action: notify.panel_assistant_living_room_panel data: title: 'Front door unlocked' message: 'The front door has been unlocked for 10 minutes.' data: tag: front_door timeout: 300 push: interruption-level: time-sensitive actions: - action: LOCK_DOOR title: 'Lock it'A camera picture
Section titled “A camera picture”The picture sits as a tile beside the title. Here it is a camera’s detection snapshot.
actions: - action: notify.panel_assistant_living_room_panel data: title: 'Fox outside' message: 'The north camera saw a fox.' data: image: /api/image_proxy/image.north_camera_fox push: interruption-level: activeThe picture must come from your own Home Assistant and be at most 1024 pixels on each side and 2 MiB. A larger one, such as a full frame from a high-resolution camera, is skipped and the text appears on its own. Detection snapshots like the one above fit.
A reminder with a button
Section titled “A reminder with a button”No interruption level is set, as in most phone automations, yet the card shows because it has a button. It stays until Done or Dismiss.
actions: - action: notify.panel_assistant_living_room_panel data: title: 'Bin day tomorrow' message: 'Put the green bin out tonight.' data: tag: bins actions: - action: BINS_DONE title: 'Done'Plain text
Section titled “Plain text”An active message without a picture or buttons is a small notice at the bottom of the screen for 5 seconds. Tap it to open the Notifications list.
actions: - action: notify.panel_assistant_living_room_panel data: title: 'Laundry ready' message: 'The washing machine has finished.' data: push: interruption-level: activeOn a larger panel
Section titled “On a larger panel”On a 10-inch panel the card keeps the same design and stops growing at 600 pixels wide.
What a panel does not do
Section titled “What a panel does not do”A message can join the Notifications list while the panel is offline; that does not mean it appeared on the panel. Text on the card is shown as written, without Markdown. To have a panel speak a message, use text-to-speech.
Ми Home Assistant і все, що робить Open Home Foundation.
Останнє оновлення:
Коментарі
Коментарі зберігаються в обговоренні цієї сторінки на GitHub, тому їх завантаження з’єднує ваш браузер із GitHub. Цей браузер запам’ятовує ваш вибір і завантажує коментарі на інших сторінках, коли ви прокручуєте до них.
Коментувати без облікового запису GitHub