{"id":15306694,"url":"https://github.com/t0mer/matterbridge-custom-notifier","last_synced_at":"2025-04-15T00:31:25.254Z","repository":{"id":192296135,"uuid":"686447561","full_name":"t0mer/matterbridge-custom-notifier","owner":"t0mer","description":"matterbridge-custom-notifier allows us to send whatsapp notifications to group using api calls but without the need to use the official whatsapp cloud api","archived":false,"fork":false,"pushed_at":"2024-04-01T18:55:35.000Z","size":728,"stargazers_count":22,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T15:53:56.887Z","etag":null,"topics":["api","go","hacs","hacs-custom","hacs-integration","home-assistant","matterbridge","python","whatsapp"],"latest_commit_sha":null,"homepage":"https://github.com/t0mer/matterbridge-custom-notifier","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t0mer.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":"2023-09-02T20:31:02.000Z","updated_at":"2025-04-03T14:31:25.000Z","dependencies_parsed_at":"2024-06-12T16:23:13.453Z","dependency_job_id":"736a64f9-24dd-4443-9c15-4f21cd6654fe","html_url":"https://github.com/t0mer/matterbridge-custom-notifier","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"87c5ab37785637b2af7832798ae143c71d1e705a"},"previous_names":["t0mer/matterbridge-custom-notifier"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0mer%2Fmatterbridge-custom-notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0mer%2Fmatterbridge-custom-notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0mer%2Fmatterbridge-custom-notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0mer%2Fmatterbridge-custom-notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t0mer","download_url":"https://codeload.github.com/t0mer/matterbridge-custom-notifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248796447,"owners_count":21162968,"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":["api","go","hacs","hacs-custom","hacs-integration","home-assistant","matterbridge","python","whatsapp"],"created_at":"2024-10-01T08:06:54.640Z","updated_at":"2025-04-15T00:31:24.924Z","avatar_url":"https://github.com/t0mer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# matterbridge-custom-notifier\n\n[matterbridge](https://github.com/42wim/matterbridge) is a bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!) written in GO.\n\n[matterbridge-custom-notifier](https://github.com/t0mer/matterbridge-custom-notifier) is a [Homeassistant ](https://www.home-assistant.io/) custom notification component that enables us to send notification to Whatsapp groups using the Matterbridge gateway and without the need to register to 3rd party integrator or the official Whatsapp cloud API.\n\n## Limitations\n* When using your own number to send the notifications it will act like your are sending messages to yourself. that way no alert will popup. Consider using other phone number for that.\n\n## Getting started\n\n### Get WhatsApp group id (JID) from WhatsApp web\nYou will also need to find the jid (Group identifier) of the group you want to send the notifications to. You can get the JID from WhatsApp web.\n\nOpen WhatsApp web and navigate to the relevant group:\n![Whatsapp web](https://github.com/t0mer/matterbridge-custom-notifier/blob/main/screenshots/smart_home_group.png?raw=true)\n\nOpen Developer tools, click the inspect toll and click on one of the messages:\n![Developer tools](https://github.com/t0mer/matterbridge-custom-notifier/blob/main/screenshots/jid.png?raw=true)\n\nIn the data-id you will see string that looks like that: **true_1203631xxxxxxxxx @g.us_3EB072082B43E417EA35_xxxxxxxxxxxx@c.us**.\nCopy the part that start right after **true_** and ends with **@g.us**. this is the JID you will need.\n\n\n### Setting up matterbridge\nFirst, create a new firectory named matterbridge under /opt and download the matterbridge pre-compiled binary:\n\n* [Linux ARM](https://matter.techblog.co.il/linux_arm/matterbridge)\n* [Linux ARM64](https://matter.techblog.co.il/linux_arm64/matterbridge)\n* [Linux x86_x64](https://matter.techblog.co.il/linux_amd_x86_x64/matterbridge).\n\nAlternatively, you can compile matterbridge accordingly to your system OS and CPU architecture. You can find the instructions here [Matterbridge](https://github.com/42wim/matterbridge#installing--upgrading)\n\n\nNext, create a file named matterbridge.toml and place it in the same directory with the binary file.\n\nAdd the following text to the file:\n\n```toml\n[general]\nLogFile=\"/var/log/matterbridge.log\" #Path to log file\nIconURL=\"https://github.com/identicons/{NICK}.png\" #Create avatar from github if user does not have one\nPreserveThreading=true\nShowUserTyping=false\nShowJoinPart=false\nNoSendJoinPart=false\n\n[api.myapi]\nBindAddress=\"0.0.0.0:4242\" #Set API bind address and port\nBuffer=1000 \nRemoteNickFormat=\"{NICK} \"\nToken=\"Add you own token\" #Optional, secure the api endpoint with strong token\n\n[whatsapp.bridge]\n# Number you will use as a relay bot. Tip: Get some disposable sim card, don't rely on your own number.\nNumber=\"+xxxxxxxxxxxx\"\n# First time that you login you will need to scan QR code, then credentials willl be saved in a session file\n# If you won't set SessionFile then you will need to scan QR code on every restart\n# optional (by default the session is stored only in memory, till restarting matterbridge)\nSessionFile=\"session-xxxxxxxxxxxx.gob\"\n# If your terminal is white we need to invert QR code in order for it to be scanned properly\n# optional (default false)\nQrOnWhiteTerminal=false\n# Messages will be seen by other WhatsApp contacts as coming from the bridge. Original nick will be part of the message.\n#RemoteNickFormat=\"@{NICK}: \"\nRemoteNickFormat=\"{NICK}: \"\n# extra label that can be used in the RemoteNickFormat\n# optional (default empty)\nLabel=\"Organization\"\n\n\n[[gateway]]\nname=\"gateway1\"\nenable=true\n\n    [[gateway.out]] #Set as out - send the message to this group\n    account=\"whatsapp.bridge\"\n    channel=\"xxxxxxxxxxx@g.us\"\n\n\n    [[gateway.in]] #Set the API as in, receive message from the api \n    account=\"api.myapi\"\n    channel=\"api\"\n\n```\n\nNow, run matterbridge (If you get a permission errors, run chmod +x matterbridge to give execute permissions).\nIf everything goes well, you should see a QR code. Go to the whatsapp app and under Linked devices scan it:\n\n![QR Code](https://github.com/t0mer/matterbridge-custom-notifier/blob/main/screenshots/qr.png?raw=true)\n\nAfter a successfull scan, you will see it in the linked devices list under the name **whatsmeow** which is the library that matterbridge is based on.\n\n![Linked devices](https://github.com/t0mer/matterbridge-custom-notifier/blob/main/screenshots/linked_devices.png?raw=true)\n\n### Set matterbridge to start on system startup\nAs for now, this version of matterbridge that supports multi devices can be installed as System service and I'm working in a docker container version.\n\nTo add matterbridge as system service, run the following command:\n```bash\nnano /etc/systemd/system/matterbridge.service\n```\nand paste the following text:\n\n```\n[Unit]\nDescription=Matterbridge daemon\nAfter=network-online.target\n\n[Service]\nWorkingDirectory=/opt/matterbridge\nType=simple\nUser=root\nExecStart=/opt/matterbridge/matterbridge -conf /opt/matterbridge/matterbridge.toml\nRestart=always\nRestartSec=5s\n\n[Install]\nWantedBy=multi-user.target\n\n```\n Save the file and enable it by running the following commands:\n\n```bash\n systemctl enable matterbridge\n systemctl status matterbridge\n```\n\nAnd to verify that the servie is running, run the following command:\n```bash\nsystemctl status matterbridge\n```\nThe output should look like this\n\n```\n● matter.service - Matterbridge daemon\n   Loaded: loaded (/etc/systemd/system/matter.service; enabled; vendor preset: enabled)\n   Active: active (running) since Tue 2023-09-05 10:24:12 UTC; 6 days ago\n Main PID: 9486 (matterbridge)\n    Tasks: 6 (limit: 4915)\n   CGroup: /system.slice/matter.service\n           └─9486 /opt/matterbridge/matterbridge -conf /opt/matterbridge/matterbridge.toml\n\nSep 11 16:51:02 pub-api matterbridge[9486]: 16:51:02.534 [Client WARN] Error decrypting message from 972546683213@s.whatsapp.net in xxxxxxxxxx-1628582008@g.us: failed to decrypt group message: no send\n```\n\nYou can also view the log by running\n```bash\ntail -f /var/log/matterbridge.log\n```\n\n## Add the custom notifier to homeassistant\nTo add matterbridge reposiroty to HACS, Open you Homeassistant application and navigate to HACS:\n\n![HACS](https://github.com/t0mer/matterbridge-custom-notifier/blob/main/screenshots/hacs.png?raw=true)\n\nThen click on Integrations:\n\n![Integrations](https://github.com/t0mer/matterbridge-custom-notifier/blob/main/screenshots/integrations.png?raw=true)\n\nOn the upper right corner, click the three dots and select Custom repositories:\n\n![Custom repositories](https://github.com/t0mer/matterbridge-custom-notifier/blob/main/screenshots/custom_repos.png?raw=true)\n\nUnder repository, paste the following address: **https://github.com/t0mer/matterbridge-custom-notifier**\n\nAnd Under category, select Integration:\n\n![Repo details](https://github.com/t0mer/matterbridge-custom-notifier/blob/main/screenshots/repo_details.png?raw=true)\n\nAnd click **ADD**.\n\nYou can now see that the *Matterbridge\" was added to the custom repositories list:\n![Custom Repo Added](https://github.com/t0mer/matterbridge-custom-notifier/blob/main/screenshots/repo_added.png?raw=true)\n\nTou can now add matterbridge custom component from HACS.\n\n## Configure homeassistant to use matterbridge.\nFirst, afetr the custom component installation, make sure you restarted home assistant.\n\n### configuration.yaml\nTo work with matterbridge, add the following code to your configuration.yaml file:\n```yaml\n\nnotify:\n  - platform: matterbridge\n    name: #Firendly name for the application\n    nickname: #The name for the sender that appears in the message\n    url: #URL for the matterbridge API. the url should end with \"/api/message\"\n    token: #The token you entered in the matterbridge configuration file.\n```\n\nSave the file and restart Home-assistant.\n\n### Sending test notification\nIn Home assistant, under Developer tools go to services and find matterbridge notification service. \n\nInsert the following lines:\n\n```yaml\nservice: notify.matter_whatsapp_notifire\ndata:\n  title: #Title for the message (Required!)\n  message: #Message to send\n    target: #Gateway name from the matterbridge configuration file\n```\nAnd click *Call Service*\n\n\n# Notes\n* Matterbridge is not officially supported by Whatsapp. It's an open source written in GO.\n* In the matterbridge configuration you can add many gateways to send notifications to different groups by using multiple gateways. This is the reason that you can specify gateway name as target in the payload.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft0mer%2Fmatterbridge-custom-notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft0mer%2Fmatterbridge-custom-notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft0mer%2Fmatterbridge-custom-notifier/lists"}