AndyP129
(Andrej)
February 8, 2024, 8:21pm
1
I tried to use script with parameters to use notification service “notify.andrej” (Telegram) from HA:
script:
id: notify_am
parameters:
mess: string
then:
homeassistant.service:
service: notify.andrej
data_template:
message: !lambda return ‘mess’;
If I execute the script the script, the message received in the telegram contain only number with 10 digits:
- script.execute:
id: notify_am
mess: “Example Text”
Can anyone help?
Maybe try one of the Home Assistant forums. You took a wrong turn somewhere bud, this is the esphome forum.
Troon
(Troon)
February 9, 2024, 11:36am
4
This is an ESPHome topic , not sure why @Fallingaway24 thought it wasn’t? I’ve moved it back.
@AndyP129 — please format your code correctly . There could be all sorts of indentation issues hiding.
I think you need to move the quotes:
message: !lambda 'return mess;'
If that doesn’t fix it, please post some code with a real string shown, and the response received.
Oh, you’re right. I think i just saw the notify service and jumped the gun so i missed the service call that triggers the notify. My bad
So, you send a notify of, “Example Text” and you recieve 10 digits(numbers) instead of letters?
Troon
(Troon)
February 9, 2024, 1:29pm
7
I think the original code sends 'mess'
as a string of four bytes plus terminator. At a wild guess, I think the notification might well be:
6d65737300
Oh man, i was hoping that wasnt thr case. Converting things back and forth from strings to int or float and vise versa… we dont get along very well. Im just going to bow out of this one.
AndyP129
(Andrej)
February 10, 2024, 6:56am
9
Thank you, after moving the quotes it is working.
Thank you also for the link regarding correct formating of the code, for my next post I will use it.
1 Like