Rest command into alert

hi at all!
i’ve a rest command to send sms in this format:

alarm_door:
    url: http://172.10.10.1/cgi-bin/sms_send?username=XXX&password=YYY&number=0000000text=Alarm door open

this rest command works great in automations but now i need to insert it in my alert to use
all the functions of HA alert system

alert:
  garage_door:
    name: Garage is open
    done_message: Garage is closed
    entity_id: sensor.door
    state: 'on'
    repeat:
      - 3
    can_acknowledge: false
    skip_first: false   
    notifiers:
      - notify_email

After notify_email i need to execute my rest command alarm_door
I tried with this code in my configuration.yaml under notify section…

  - name: fra-phone
    platform: rest
    resource: http://172.10.10.1/cgi-bin/sms_send?username=XXX&password=YYY&number=0000000text=Alarm door open

but it doesn’t works

Someone could help me??

Thanks a lot

Alert is looking for “notification” type entities.

Did you set up your rest alert as a notify? Or as a rest command?

You can have both. Just create a notify element for your rest command and use this one in your alert.

The arguments only want the object_id. For example, if you have a notify.fra-phone, you would only put “-fra-phone” in this section.

… wait, nevermind, you did this.

What didn’t work? Can you call the notify.fra-phone directly from the services menu?

Yes, man but i must specify title and message… now how to add this values in my notify section ???

thanks

Since you hardcoded everything into the command, you can send an empty request and it should pop up a message. The data parameters are all optional. Erase them.

If you want it to be more dynamic, you should just have to specify the text that goes in for message, title, and target.

notify:  
- name: fra-phone
    platform: rest
    resource: http://172.10.10.1/cgi-bin/sms_send
    username: "XXX"
    password: "YYY"
    message_param_name: "text"
    target_param_name: "number"

Now to use it, specify message and target.

- service: notify.fra-phone
  data:
    message: "Garage Door Open"
    target: "000000"

thanks man, i put this code in my notify section:

notify:  
- name: fra-phone
    platform: rest
    resource: http://172.10.10.1/cgi-bin/sms_send
    username: "XXX"
    password: "YYY"
    message_param_name: "text"
    target_param_name: "number"

but i don’t understand wher insert the second part of your code…

thanks

Wherever you want. In an automation typically.

Try the service tab and pick notify.fra-phone

in the box, type

message: "TEST"
target: <your phone number>