{"id":15306663,"url":"https://github.com/t0mer/wapi-custom-notifier","last_synced_at":"2025-04-14T16:14:01.865Z","repository":{"id":194570761,"uuid":"691126780","full_name":"t0mer/wapi-custom-notifier","owner":"t0mer","description":"wapi-custom-notifier allows us to send whatsapp notifications to contacts and group using api calls but without the need to use the official whatsapp cloud api","archived":false,"fork":false,"pushed_at":"2024-09-24T19:40:59.000Z","size":30,"stargazers_count":37,"open_issues_count":8,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T16:13:47.579Z","etag":null,"topics":["hacs","hacs-integration","hass","home-assistant","home-automation","javascript","python","python3","whatsapp"],"latest_commit_sha":null,"homepage":"https://github.com/t0mer/wapi-custom-notifier","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/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}},"created_at":"2023-09-13T14:51:46.000Z","updated_at":"2025-04-03T14:31:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"13f042eb-3b50-4a68-b8b8-60fd71f3a104","html_url":"https://github.com/t0mer/wapi-custom-notifier","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"fb220f5c88e82953d6425974c95a787675d41c16"},"previous_names":["t0mer/wapi-custom-notifier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0mer%2Fwapi-custom-notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0mer%2Fwapi-custom-notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0mer%2Fwapi-custom-notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0mer%2Fwapi-custom-notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t0mer","download_url":"https://codeload.github.com/t0mer/wapi-custom-notifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248914115,"owners_count":21182359,"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":["hacs","hacs-integration","hass","home-assistant","home-automation","javascript","python","python3","whatsapp"],"created_at":"2024-10-01T08:06:46.039Z","updated_at":"2025-04-14T16:14:01.835Z","avatar_url":"https://github.com/t0mer.png","language":"Python","readme":"# wapi-custom-notifier\n\n[whatsapp-api](https://github.com/chrishubert/whatsapp-api/) is a REST API wrapper for the [whatsapp-web.js](https://github.com/pedroslopez/whatsapp-web.js) library, providing an easy-to-use interface to interact with the WhatsApp Web platform. It is designed to be used as a docker container, scalable, secure, and easy to integrate with other non-NodeJs projects.\n\n[wapi-custom-notifier](https://github.com/t0mer/wapi-custom-notifier) is a [Homeassistant ](https://www.home-assistant.io/) custom notification component that enables us to send notification to Whatsapp groups using the whatsapp-api 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### Setting up *whatsapp-api*\n1.  create *docker-compose.yaml* file and paste the following content:\n```yaml\nversion: '3.8'\n\nservices:\n  app:\n    container_name: whatsapp_web_api\n    image: chrishubert/whatsapp-web-api:latest # Pull the image from Docker Hub\n    # restart: always\n    ports:\n      - \"3000:3000\"\n    environment:\n      #- API_KEY= #Optional - Recomended to enable when goint to prod\n      - BASE_WEBHOOK_URL=http://localhost:3000/localCallbackExample\n      - ENABLE_LOCAL_CALLBACK_EXAMPLE=TRUE # OPTIONAL, NOT RECOMMENDED TO ENABLE FOR PRODUCTION. Remove after QR scan\n      - MAX_ATTACHMENT_SIZE=5000000 # IN BYTES\n      - SET_MESSAGES_AS_SEEN=FALSE # WILL NOT MARK THE MESSAGES AS READ AUTOMATICALLY\n      # ALL CALLBACKS: auth_failure|authenticated|call|change_state|disconnected|group_join|group_leave|group_update|loading_screen|media_uploaded|message|message_ack|message_create|message_reaction|message_revoke_everyone|qr|ready|contact_changed\n      - DISABLED_CALLBACKS=message_ack  # PREVENT SENDING CERTAIN TYPES OF CALLBACKS BACK TO THE WEBHOOK\n      - ENABLE_SWAGGER_ENDPOINT=TRUE #When enabled, adding \"/api-docs\" to the url will open Swagger. Not recomended to production.\n    volumes:\n      - ./sessions:/usr/src/app/sessions # Mount the local ./sessions/ folder to the container's /usr/src/app/sessions folder\n```\n\n2. Run the Docker Compose:\n```\ndocker-compose pull \u0026\u0026 docker-compose up\n```\n\n3. Visit http://localhost:3000/session/start/ABCD (Replace ABCD with your desired session name)\n\n4. Scan the QR on your console using WhatsApp mobile app -\u003e Linked Device -\u003e Link a Device (it may take time to setup the session)\n\n5. Visit http://localhost:3000/client/getContacts/ABCD (Replace ABCD with your desired session name)\nThis will list all the contacts and groups chats in json format:\n```json\n{\n    \"success\": true,\n    \"contacts\": [\n        {\n            \"id\": {\n                \"server\": \"g.us\",\n                \"user\": \"xxxxxxxxxxxxxxxxxx\",\n                \"_serialized\": \"xxxxxxxxxxxxxx@g.us\"\n            },\n            \"number\": null,\n            \"isBusiness\": false,\n            \"isEnterprise\": false,\n            \"name\": \"AI XXXXX\",\n            \"type\": \"in\",\n            \"isMe\": false,\n            \"isUser\": false,\n            \"isGroup\": true,\n            \"isWAContact\": false,\n            \"isMyContact\": false,\n            \"isBlocked\": false\n        }\n    ]\n}\n```\n\n6. EXTRA: Look at all the callbacks data in ./session/message_log.txt\n\n\n## Add the custom notifier to homeassistant\nTo add wapi reposiroty to HACS, Open you Homeassistant application and navigate to HACS.\n\n1. Click on Integrations.\n\n2. On the upper right corner, click the three dots and select Custom repositories.\n\n3. Under repository, paste the following address: **https://github.com/t0mer/wapi-custom-notifier**\n\n4. Under category, select Integration and click ADD.\n\n5. You can now see that the *wapi\" was added to the custom repositories list.\n\n6. can now add wapi custom component from HACS.\n\n## Configure homeassistant to use wapi.\nFirst, afetr the custom component installation, make sure you restarted home assistant.\n\n### configuration.yaml\nTo work with wapi, add the following code to your configuration.yaml file:\n```yaml\n\nnotify:\n  - platform: wapi\n    name: wapi whatsapp notifire\n    session: ABCD #Set your own session\n    url: http://192.168.0.238:3000/client/sendMessage #Set the url configured in the whatsapp-api docker\n    token: #Optional - This token shoukd be equel to the token you set in the whatsapp-api configuration.\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 wapi notification service.\n\nInsert the following lines:\n\n```yaml\nservice: notify.wapi_whatsapp_notifire\ndata:\n  message: The garage door has been open for 10 minutes.\n  title: Your Garage Door Friend\n  target: xxxxxxxxxx@c.us #Can be contact or group chat id\n\n```\nAnd click *Call Service*\n\n\nTo send media (images and video), you can also send a `media_url` in the data payload. Note that the media must be accessible by the whastapp-api container.\nMultiple media files are now supported. Use the multiline feature as shown below in order to use it.\n\n\n```yaml\nservice: notify.wapi_whatsapp_notifire\ndata:\n  message: The garage door has been open for 10 minutes.\n  title: Your Garage Door Friend\n  target: xxxxxxxxxx@c.us #Can be contact or group chat id\n  data:\n    media_url: |\n      https://api.qrserver.com/v1/create-qr-code/?size=150x150\u0026data=Example\n      https://api.qrserver.com/v1/create-qr-code/?size=150x150\u0026data=Example\n```\n\n\n# Notes\n* wapi is not officially supported by Whatsapp. It's an open source written in GO.\n* In the wapi 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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft0mer%2Fwapi-custom-notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft0mer%2Fwapi-custom-notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft0mer%2Fwapi-custom-notifier/lists"}