Closed nicoolaro closed 5 months ago
You can use a own Script to call the send message
service: script.whatsapp_send_message data: message: "{{ states('sensor.your_sensor') }}"
Within your script use text: "{{ message }}"
You can use a own Script to call the send message
service: script.whatsapp_send_message data: message: "{{ states('sensor.your_sensor') }}"
Within your script use text: "{{ message }}"
i don't get it, i should creat a script? becasue when i try the code you sent it doesn't work
You can use a own Script to call the send message
service: script.whatsapp_send_message data: message: "{{ states('sensor.your_sensor') }}"
Within your script use text: "{{ message }}"
i don't get it, i should creat a script? becasue when i try the code you sent it doesn't work
Yes - create a new script which calls the WhatsApp send message.
Now you can call your script to pass any message.
Hope it is easier to understand :)
You can use a own Script to call the send message
service: script.whatsapp_send_message data: message: "{{ states('sensor.your_sensor') }}"
Within your script use text: "{{ message }}"
i don't get it, i should creat a script? becasue when i try the code you sent it doesn't work
Yes - create a new script which calls the WhatsApp send message.
Now you can call your script to pass any message.
Hope it is easier to understand :)
Thank you for the help much appreaciate it. But message is not sent. I followed to the letter
Script is executing but i am not receiving a message
You can use a own Script to call the send message
service: script.whatsapp_send_message data: message: "{{ states('sensor.your_sensor') }}"
Within your script use text: "{{ message }}"
i don't get it, i should creat a script? becasue when i try the code you sent it doesn't work
Yes - create a new script which calls the WhatsApp send message.
Now you can call your script to pass any message.
Hope it is easier to understand :)
Thank you for the help much appreaciate it. But message is not sent.
I followed to the letter
Script is executing but i am not receiving a message
Well try to Check your script with a fix text - e.g. "Test"? Does it work?
Maybe your sensor is invalid or is null?
I've tried my script and passed no Text (" "). I did not get a message as well...
You can use a own Script to call the send message
service: script.whatsapp_send_message data: message: "{{ states('sensor.your_sensor') }}"
Within your script use text: "{{ message }}"
i don't get it, i should creat a script? becasue when i try the code you sent it doesn't work
Yes - create a new script which calls the WhatsApp send message.
Now you can call your script to pass any message.
Hope it is easier to understand :)
Thank you for the help much appreaciate it. But message is not sent. I followed to the letter
![]()
Script is executing but i am not receiving a message
Well try to Check your script with a fix text - e.g. "Test"? Does it work?
Maybe your sensor is invalid or is null?
I've tried my script and passed no Text (" "). I did not get a message as well...
Nope, fixed works, template don't. I tried with Telegram and all is ok , Whataspp doesn't work. Oh well i'll continue debugging, thanks for your help!
You can use a own Script to call the send message
service: script.whatsapp_send_message data: message: "{{ states('sensor.your_sensor') }}"
Within your script use text: "{{ message }}"
i don't get it, i should creat a script? becasue when i try the code you sent it doesn't work
Yes - create a new script which calls the WhatsApp send message.
Now you can call your script to pass any message.
Hope it is easier to understand :)
Thank you for the help much appreaciate it. But message is not sent. I followed to the letter
![]()
Script is executing but i am not receiving a message
Well try to Check your script with a fix text - e.g. "Test"? Does it work? Maybe your sensor is invalid or is null? I've tried my script and passed no Text (" "). I did not get a message as well...
Nope, fixed works, template don't. I tried with Telegram and all is ok , Whataspp doesn't work. Oh well i'll continue debugging, thanks for your help!
Hi, i was looking for an answer to this today.
I have found the following format works, straight in the automation
hopefully this is helpful to someone
You can use a own Script to call the send message
service: script.whatsapp_send_message data: message: "{{ states('sensor.your_sensor') }}"
Within your script use text: "{{ message }}"
i don't get it, i should creat a script? becasue when i try the code you sent it doesn't work
Yes - create a new script which calls the WhatsApp send message.
Now you can call your script to pass any message.
Hope it is easier to understand :)
Thank you for the help much appreaciate it. But message is not sent. I followed to the letter
![]()
Script is executing but i am not receiving a message
Well try to Check your script with a fix text - e.g. "Test"? Does it work? Maybe your sensor is invalid or is null? I've tried my script and passed no Text (" "). I did not get a message as well...
Nope, fixed works, template don't. I tried with Telegram and all is ok , Whataspp doesn't work. Oh well i'll continue debugging, thanks for your help!
Hi, i was looking for an answer to this today.
I have found the following format works, straight in the automation
hopefully this is helpful to someone
This worked, thank you!!
This add-on is really amazing, but I am facing the same problem when sending a message containing only numbers (which was probably the same bug that nicoolaro was initially facing with his temperature template.
The add-on log would show this error :
[2024-01-01T23:52:54.177] [ERROR] default - Cannot read properties of undefined (reading 'payload')
Using the Service developer tool, this does not work :
service: whatsapp.send_message
data:
clientId: default
to: xxxxxx@s.whatsapp.net
body:
text: 1
This does work :
service: whatsapp.send_message
data:
clientId: default
to: xxxxxx@s.whatsapp.net
body:
text: >-
1
But a template like this which results in a number output does not work :
service: whatsapp.send_message
data:
clientId: default
to: xxxxxx@s.whatsapp.net
body:
text: >-
{{ states('sensor.temperature') }}
Inserting some non-numeric characters is a temporary fix :
service: whatsapp.send_message
data:
clientId: default
to: xxxxxx@s.whatsapp.net
body:
text: >-
{{ states('sensor.temperature') }} .
Any idea if this can be fixed on add-on side ?
Thank you very much !
Best regards
Try starting your message with text then template value.
service: whatsapp.send_message
data:
clientId: default
to: xxxxxx@s.whatsapp.net
body:
text: >-
Temperature value is {{ states('sensor.temperature') }}.
yes that works for sure, as in my temporary fix above where i simply added a "space and a point" at the end. But it would be better if the bug can be fixed :-) Also in my exemple I used a temperature template to make it easy, but in reality I use this add-on in a chatbot answering queries from a WhatsApp conversation, so I cannot use additional fixed text in the template as it can be anything from a number to a long sentence.
I don't know if it s due to the last code reversal from 1.3.4 to 1.3.5, but this bug is unfortunately still present in latest release 1.3.5. Log error when the message is only a number : [2024-01-21T00:20:36.028] [ERROR] default - Cannot read properties of undefined (reading 'payload')
unfortunately I didn't carefully check the latest pull request. the bug is scheduled for fix
Does templating work in text message, i am trying to send a temperature sensor value to message but am not receiving it.
plane text works ok
example: