Notify and input_select

I’m sorry if this is a bit basic, but I really have tried hard (and failed) to find an answer in the docs and by searching the forum.

I want to send an SMS message via my Huawei 5G router which is just the current value of an input_select helper variable. I can easily send a text message, that works fine but I cannot work out the correct syntax to be the value of an input_select helper variable.

Using the developer tools services thing, the notify works fine with static text, e.g.

message: Test message

But not when I try anything like:

message: {{states.input_select.system_mode.state}}

Can anyone suggest the right syntax?

Kind thoughts,

Andrew

Scrub that, I found it!

message: “{{ states(‘input_select.system_mode’) }}”

Thank you for listening :slight_smile:

1 Like

This is missing quotation marks, either single or double quotes.

message: {{states.input_select.system_mode.state}}

It should be like this:

message: "{{states.input_select.system_mode.state}}"

The advantage of using the states() function, like this:

message: "{{ states('input_select.system_mode') }}"

is if the entity is undefined, the function will return unknown as opposed to the other technique which will report nothing.

Thank you kindly for helping.

Andrew