Replace the Notify.Events delivery with a Google Chat space webhook. The automation builds a cardsV2 card (printer/event header, print details, camera snapshot, Open printer button) and falls back to plain text if Google rejects the card or the request fails. Adds rest_command.google_chat_octoeverywhere, which needs google_chat_octoeverywhere_webhook in secrets.yaml on the host. The notify_event_octoeverywhere_token secret is no longer used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.8 KiB
YAML
47 lines
1.8 KiB
YAML
# REST commands to create and update Notion pages.
|
|
notion_create_print:
|
|
url: "https://api.notion.com/v1/pages"
|
|
method: POST
|
|
content_type: "application/json"
|
|
headers:
|
|
Authorization: !secret notion_token_bearer
|
|
Notion-Version: "2022-06-28"
|
|
payload: >
|
|
{
|
|
"parent": { "database_id": "c7bab550efd740909f656f101697832d" },
|
|
"properties": {
|
|
"File Name": { "title": [{ "text": { "content": "{{ file_name }}" } }] },
|
|
"Status": { "select": { "name": "Printing" } },
|
|
"Printer": { "select": { "name": "{{ printer_name }}" } },
|
|
"Filament Type": { "select": { "name": "{{ filament_type }}" } },
|
|
"Filament Color": { "rich_text": [{ "text": { "content": "{{ filament_color }}" } }] },
|
|
"date:Started:start": { "date": { "start": "{{ started }}", "time_zone": "America/New_York" } }
|
|
}
|
|
}
|
|
|
|
notion_update_print:
|
|
url: "https://api.notion.com/v1/pages/{{ page_id }}"
|
|
method: PATCH
|
|
content_type: "application/json"
|
|
headers:
|
|
Authorization: !secret notion_token_bearer
|
|
Notion-Version: "2022-06-28"
|
|
payload: >
|
|
{
|
|
"properties": {
|
|
"Status": { "select": { "name": "{{ status }}" } },
|
|
"Weight (g)": { "number": {{ weight }} },
|
|
"Length (mm)": { "number": {{ length }} },
|
|
"date:Completed:start": { "date": { "start": "{{ completed }}", "time_zone": "America/New_York" } }
|
|
}
|
|
}
|
|
|
|
# Google Chat incoming webhook (space webhook) for OctoEverywhere printer alerts.
|
|
# Call with `payload` = a dict shaped like a Chat Message body (text and/or cardsV2).
|
|
# Used by automations/05_printers_and_workshop/05c_octoeverywhere_google_chat.yaml.
|
|
google_chat_octoeverywhere:
|
|
url: !secret google_chat_octoeverywhere_webhook
|
|
method: POST
|
|
content_type: "application/json; charset=UTF-8"
|
|
payload: "{{ payload | to_json }}"
|