Sending SMS using Twilio

HI
I am attempting to setup Twilio to send an sms inside of an automation …

I have intalled the twilio integration that told me to setup a webhook in the twilio account which i did.

I added the following to configuration.yaml

notify:
  - name: twilio_sma
    platform: twilio_sms
    from_number: "phone number from twilio"


The automation i created in yaml


alias: SMS Send
  description: ''
  triggers:
  - type: changed_states
    device_id: 5c7059377f8a14ab716e735bc4259060
    entity_id: cf2a11b2d7b696e0738aaede2a8457a0
    domain: switch
    trigger: device
    for:
      hours: 0
      minutes: 0
      seconds: 5
  conditions: []
  actions:
  - action: notify.twilio_sms
    metadata: {}
    data:
      message: heater switched
      title: 'heater test '
      target: +972-50-3440135
      data: the heater switched
  mode: single

 

I don’t get any error but the sms is not being sent… Is the problem on the HA end or the twilio end?

Regards

Mrrcomp

Have you checked the automation trace and logs for any errors?

@parautenbach thanks for the response…

The trace gives me the following

Stopped because an error was encountered at January 31, 2025 at 6:31:38 AM (runtime: 0.03 seconds)

expected dict for dictionary value @ data[‘data’]

Remove the second data: line. I’m not using twilio, but according to the docs it shouldn’t be there. That’s also what the error is saying: there’s an unexpected data under data.

@parautenbach thanks

I did manage now to run the automation without error but i dont get and sms and i dont see any mention of an error or a message getting to the twilio console and the

Looks like your message got cut off.

If you say “without error”, do you mean there was no error in the trace? Did you check the actual HA log too?

@parautenbach
Correct trace no longer giving error.TBH not sure; how to see /he HA log

Settings > System > Logs