{"id":21678590,"url":"https://github.com/v411e/hasswebhookbot","last_synced_at":"2025-04-12T05:36:26.681Z","repository":{"id":37904752,"uuid":"413024211","full_name":"v411e/hasswebhookbot","owner":"v411e","description":"A simple maubot to get homeassistant-notifications in your favorite matrix room","archived":false,"fork":false,"pushed_at":"2023-09-26T17:52:51.000Z","size":92,"stargazers_count":12,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T12:50:57.969Z","etag":null,"topics":["bot","hassio","home-assistant","home-automation","homeassistant","matrix","maubot","webhooks"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/v411e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-03T08:51:08.000Z","updated_at":"2024-04-04T10:51:12.000Z","dependencies_parsed_at":"2024-11-25T22:31:26.012Z","dependency_job_id":null,"html_url":"https://github.com/v411e/hasswebhookbot","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v411e%2Fhasswebhookbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v411e%2Fhasswebhookbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v411e%2Fhasswebhookbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v411e%2Fhasswebhookbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/v411e","download_url":"https://codeload.github.com/v411e/hasswebhookbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248524783,"owners_count":21118614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","hassio","home-assistant","home-automation","homeassistant","matrix","maubot","webhooks"],"created_at":"2024-11-25T14:38:41.553Z","updated_at":"2025-04-12T05:36:26.632Z","avatar_url":"https://github.com/v411e.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub release (latest by date)](https://img.shields.io/github/v/release/v411e/hasswebhookbot)\n\n# Home Assistant notification bot for [matrix](https://matrix.org/) via webhooks\nA [maubot](https://github.com/maubot) bot to get [Home Assistant](https://github.com/home-assistant) notifications in your favorite matrix room.\nSimple message                         |  Edited message with reaction | Image\n:-------------------------------------:|:-------------------------:|:----:\n![Imgur](https://i.imgur.com/y22FQKe.jpg)|  ![Imgur](https://i.imgur.com/rPUdca3.jpeg) | ![Imgur](https://imgur.com/CdFZPf9.png)\n\nI am describing in this [blog post](https://riess.dev/washing-machine-notifications/) how I use this bot to get notified whenever my washing machine has finised.\n\n## Configuration\nFirst add this plugin to your maubot manager:\n1. Load the *.mbp file of the current [release](https://github.com/v411e/hasswebhookbot/releases)\n2. Create client and instance\n3. Configure instance `base_url`\n\nAfter setting up the plugin just invite the bot into an *encrypted* room. Each room has an indvidual \"webhook url\". To get yours just write `!ha`. The bot replies with the `WEBHOOK_URL` of your room and also generates some YAML code for the configuration of your home assistant instance (like below).\n\n`configuration.yaml` on HA (don't forget to reload):\n```yaml\nnotify:\n  - name: HASS_MAUBOT\n    platform: rest\n    resource: \"\u003cWEBHOOK_URL\u003e\"\n    method: POST_JSON\n    data:\n      type: \"{{data.type}}\"\n      identifier: \"{{data.identifier}}\"\n      callback_url: \"{{data.callback_url}}\"\n      lifetime: \"{{data.lifetime}}\"\n      content: \"{{data.content}}\"\n      contentType: \"{{data.contentType}}\"\n      name: \"{{data.name}}\"\n      thumbnailSize: 512\n```\n\n## Usage\nThe bot is almost stateless (database only used for lifetime) and can be used within multiple rooms.\nMost attributes are optional. The only attribute that always has to be provided through home assistant is `data: message`. You can set this to `None` if you are not using it (e.g. sending a redaction or image)\n```yaml\nservice: notify.\u003cyour_service_name\u003e\ndata:\n  message: \u003cyour_message\u003e\n  data:\n    type: \u003cmessage / reaction / edit / redaction / image\u003e         # The type of action\n    identifier: \u003cletterbox.status / event_id.$DRTYGw...\u003e  # Use your own identifier (#1) or reference an event_id (#2)\n    callback_url: https://\u003cyour home assistant instance\u003e/api/webhook/\u003csome_hook_id\u003e  # Optional: Get a callback with entity_id of sent message\n    lifetime: 1440    # Optional: Activate message self-deletion after given time in minutes\n```\n\n## Examples\n### Send a message\n```yaml\nservice: notify.hass_maubot\ndata:\n  message: Die Post ist da! 📬\n  data:\n    type: message\n    identifier: letterbox.status\n    callback_url: https://ha.example.com/api/webhook/some_hook_id\n    lifetime: 1440\n```\n### Send a message (but minimal)\n```yaml\nservice: notify.hass_maubot\ndata:\n  message: \"hi\"\n  data:\n    type: \"message\"\n```\n### Delete a message\n```yaml\nservice: notify.hass_maubot\ndata:\n  message: None\n  data:\n    type: redaction\n    identifier: letterbox.status\n```\nor\n```yaml\nservice: notify.hass_maubot\ndata:\n  message: None\n  data:\n    type: redaction\n    identifier: event_id.$DRTYGw...     # event_id can be obtained through callback\n```\n### React to message\n```yaml\nservice: notify.hass_maubot\ndata:\n  message: 📬\n  data:\n    type: reaction\n    identifier: letterbox.status\n```\nor\n```yaml\nservice: notify.hass_maubot\ndata:\n  message: 📬\n  data:\n    type: reaction\n    identifier: event_id.$DRTYGw...     # event_id can be obtained through callback\n```\n### Edit message\n```yaml\nservice: notify.hass_maubot\ndata:\n  message: \u003cdel\u003eDie Post ist da! 📬\u003c/del\u003e\n  data:\n    type: edit\n    identifier: letterbox.status\n```\nor\n```yaml\nservice: notify.hass_maubot\ndata:\n  message: \u003cdel\u003eDie Post ist da! 📬\u003c/del\u003e\n  data:\n    type: edit\n    identifier: event_id.$DRTYGw...     # event_id can be obtained through callback\n```\n\n### Send image\n```yaml\nservice: notify.hass_maubot\ndata:\n  message: None\n  data:\n    type: \"image\"\n    content: \"iVBORw0KGgoAAAANSUhEUgAAADcAAAA5CAYAAACS0bM2AAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAAqdEVYdENyZWF0aW9uIFRpbWUARGkgMjYgU2VwIDIwMjMgMTU6NDU6NDEgQ0VTVJ19+pEAAA6gSURBVGiB7ZrZjxxHcsZ/kVlH391z8D5EUtTqWK4t2bteywdgwH7wf23AgLwP8kKyFzqWEkWKkkiRQ07P9F1HZvghqntIikONLqx3oQQGM91T3RVfRmTEF1+UqKryF7rcn9qAn3L9DO7Pdf0M7s91JT/Fl07KyH4ROSwjs1pZ1FAo1BFCk5u9QOIgF+gk0EuEYebYzh2D7MfZ8x8FXFQoorKqlVWEe/Oau7Oa+8vIo5UyLpV5gFU0gGDAWg66HrYyYbclnGs7LvcSzncTWg5aiZA7wcn3s0t+aJ2LCmVUPpvUfHBQ8elMeVwo81qpolIr1Aqqdu36ZgI4ARFImp/UCd1E2MmF6z3hl6OUa4OE7HsC/EHgxkXk3jJwexa5Mwt8OQ88LJRlOAq/tU2qihcLR7D/B11fcGS5F2h7OJ0LF7ueKz3P1Z7jfNuzlX+3cP1e4ILCrIp8Mqn5n3HFe+PIuFSqeMwHVAFlkAr9RBBgUkUOqyNwIt90TeosZN/acvz1Vsorg4Re6jYb9JOAOywjv3tY8v645tOZsghKHY9C7mlcikNpOeXGKOWXWwkCfDAu+d/9mmUARBDnLEafNA47mx1vYfrmVsLbpzOGJ0w43zmhfDEPfHhQ8+7jmruLyE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I6xn2f33XT8JuP8v6y/6ecufwf25rr9ocP8HujPVz0QO0P4AAAAASUVORK5CYII=\"\n    contentType: \"image/png\"\n    name: \"halogo.png\"\n```\nThe image sending functionality is contributed and used by https://github.com/AlexanderBabel/mail-parser.\n\n## Maubot plugin config\n**Hint:** Depending on your preference, you can choose between two different modes for the edit feature:\n1. Content of `\u003cdel\u003e\u003c/del\u003e` is discarded in the Matrix notification (`keep_del_tag: true`) \u003cbr\u003e Notification example:\n```\n* - New message\n```\n2. Content of `\u003cdel\u003e\u003c/del\u003e` is displayed as normal text (`keep_del_tag: false`) \u003cbr\u003e Notification example: \n```\n* Previous message - New message\n```\n\nYou can change this setting on the maubot configuration page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv411e%2Fhasswebhookbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fv411e%2Fhasswebhookbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv411e%2Fhasswebhookbot/lists"}