Get a text from helper to include in another script

Hello,

I’m have created so my automations changes a helper to a specific string. Then they should run this script.

device_id: 37263affbe8af8f3338ac49acdba642e
domain: mobile_app
type: notify
message: "{% set text = states('input_text.iphonenotistext') | int %} {{(text)  | int }}"

However I’m doing something wrong with the messages as it don’t want to sent out and says there’s an template error.

Im doing all of this as sometimes when I re-add my phone to home assistance, it messes with my automations so they stop sending out notifications to my phone and I have to re-add the phone in every one of them. So I would like to streamline the experience and only have to update 1 script instead.

Kind regard Julian

Why are you trying to convert a text to integer ?
Is this not working ?

message: "{{ states('input_text.iphonenotistext') }}"

1 Like

Thanks!

I was just copying from some other code, im not really sure how HA works yet so I just tried some :slightly_smiling_face:

But the code you wrote works perfectly!