Yeah it works here when you use the templates as mentioned above.
In that case you don’t need to send a message every that as using that template the message will always arrive.
You can for example use this message and you will see it arrives in Whatsapp:
Your HA code is this is a test
Just replace the
this is a test
part with the actual message you want to send, but make sure it always starts with
The following is my code, could you please let me know if this is you are suggesting ?
import appdaemon.plugins.hass.hassapi as hass
import datetime
class AutoTurnOnOffOutdoorLightes(hass.Hass):
def initialize(self):
# Create a time object for 18:30
runtime_lights_on = datetime.time(18, 30, 0)
# Schedule a daily callback that will call turn_on_outdoor_lights() at 18:30 every night
self.run_daily(self.turn_on_outdoor_lights, runtime_lights_on)
def turn_on_outdoor_lights(self, entity):
self.log("Turned on outdoor lights at 18:30 every night.")
self.call_service("notify/whatsapp", message = "Your HA code is - Turned on outdoor lights.", target = "+972549123456")
self.turn_on("group.outdoor_lights")
Have you tried this API to send WhatsApp messages? It is very easy to setup and no registration required.
I’m using it for a 1 week and it is working very well so far. There is a delay of 5-15 seconds for the message to arrive but it is not a constraint for my use-case.
I am the maintainer of open-wa (https://docs.openwa.dev/) and I intend to develop an addon for home assistant that will allow you to integrate with API requests. If you know your way around docker you can set it up right now actually using this repo:
or just use the CLI (which automatically converts your account into an API with an API explorer - you just need to make sure you have node/npx installed):
npx @open-wa/wa-automate --help
I would appreciate if you can participate in this Github discussion to show a need for an open-wa add-on as part of the official home assistant add on repository: