Whatsapper is here

I am working with home automation with Home assistant in my spare time and I find out something that was kind of missing:

an addon that let you send notification or messages with whatsapp.

Is not easy as telegram or matrix, because Whatsapp doesn’t easily allow bots.

So, I decided to create a really ultra simple web api based on the glorious whatsapp-web.js, a really smart project that connects to whatsapp with Puppeteer and a real instance of Whatsapp Web to avoid getting blocked! Really smart!

My use case

I really hate alarm sirens. But I like alarms :)

My wife parents live nearby and my intent is to create a whatsapp chat (the chat they use most) to send them messages regarding alarm from the house when we are not available (eg: intrusion, water leak, power failure…) so they can intervene.

Create the app

I created a ultra simple node js app to serve the whatsapp-web.js library and dockerize that (this is needed for the home assistant addon)

Basically, the app spawn a web server that expose an api that forwards to the lib and get back the results… sweet!

Create the addon

I’m already participating to an addon contributor, alexbelgium

This was nice, I learned how to publish on docker hub also compiling for multiple architectures (lots of home assistant installations are on arm devices)

Create the home assistant integration

I’m a super noob in python, but looking at other integrations I correctly implemented a home assistant integration!

Here is the repo

basically, it integrates with home assistant notification api and let’s you send messages to chats.

Veeeeeery basic for now, but it solves the use case I needed!

Go for opensource

It’s really fun to write code for the opensource world and the community. Try yourself!

Enjoy!