📑 Como enviar SMS através do HA

Tens q instalar um servidor de voip no rasp. Certo? Venha de la esse tutorial…

Ja li o pdf do zanzito mas nao percebi como se envia os sms… alguem com um tutorial?

Na página 6 do manual está a resposta à tua pergunta.

Send SMS. When active, Zanzito uses the SMS messaging capabilities of your phone to send actual SMS
messages;

To request the sending of an SMS message, your backend server must publish an MQTT message in the form:

zanzito/<your-device-name>/sendsms/<phone-number> <text>

You can decide whether or not a standard Android notification is shown upon receiving an SMS message
request and the corresponding notification sound

Não, usas um servidor sip (voip) existente. E depois tens que pagar o envio dessa sms.

como faço para enviar um sms numa automaçao pelo zanzito ?

Invalid config for [automation]: Service zanzito/skysurf_phone/sendsms/91xxxxxxx teste zanzito sms does not match format <domain>.<name> for dictionary value @ data[‘action’][3][‘service’].

dá-me erro:

- alias: Update HA
  trigger:
    platform: state
    entity_id: updater.updater
  action:
    - service: notify.noti_pushbullet
      data:
        title: "Home Assistant"
        message: "Update Disponível para o HA"
    - service: script.notify_save_to_file
      data:
        message: '{{ as_timestamp (now()) | timestamp_custom("%d/%m %H:%M") }} - Update HA'
    - service: notify.gmail
      data:
        title: "Home Assistant"
        message: "Update Disponível para o HA"
    - service: zanzito/skysurf_phone/sendsms/91xxxxxx teste zanzito sms

nao é assim para enviar ?? sms pelo zanzito ?

Parece que não leste o que escrevi na mensagem anterior por isso vou repetir:

To request the sending of an SMS message, your backend server must publish an MQTT message

Assim sendo, o serviço a utilizar não é esse…

podes dar um exemplo de como publicar uma mensagem mqtt ? na automaçao ? nao percebo nada disso … thanks…

é algo deste género:

- alias: Update HA
  trigger:
    platform: state
    entity_id: updater.updater
  action:
    - service: notify.noti_pushbullet
      data:
        title: "Home Assistant"
        message: "Update Disponível para o HA"
    - service: script.notify_save_to_file
      data:
        message: '{{ as_timestamp (now()) | timestamp_custom("%d/%m %H:%M") }} - Update HA'
    - service: notify.gmail
      data:
        title: "Home Assistant"
        message: "Update Disponível para o HA"
    - service: mqtt.publish
    #- platform: mqtt
      data_template:
        topic: "zanzito/skysurf_phone/sendsms/91xxxxxx teste zanzito sms"

depois de algumas pesquisas alterei para:

- alias: Update HA
  trigger:
    platform: state
    entity_id: updater.updater
  action:
    - service: notify.noti_pushbullet
      data:
        title: "Home Assistant"
        message: "Update Disponível para o HA"
    - service: script.notify_save_to_file
      data:
        message: '{{ as_timestamp (now()) | timestamp_custom("%d/%m %H:%M") }} - Update HA'
    - service: notify.gmail
      data:
        title: "Home Assistant"
        message: "Update Disponível para o HA"
    - service: mqtt.publish
    #- platform: mqtt
      data_template:
        topic: "zanzito/skysurf_phone"
        payload_template: "{ zanzito/skysurf_phone/sendsms/91xxxxx teste zanzito sms }"

mas continua sem enviar sms… :frowning:
alguem que me possa ajudar … obrigado

A opção de enviar/receber SMS está activa na app do telemóvel?

sim esta … o codigo esta correcto ?

Altera para:

- service: mqtt.publish
  data:
    topic: "zanzito/skysurf_phone/sendsms/91xxxxxx teste zanzito sms" 

Se não funcionar experimenta tirar as aspas do tópico.

já alterei e coloquei com e sem aspas e nao envia o sms …

Testa isto, comigo funciona:

- service: mqtt.publish
  data:
    topic: "zanzito/skysurf_phone/sendsms/91xxxxxx"
    payload: "teste zanzito sms"

@Skysurf
O código funcionou?

sim ! já funca … thaks… :wink: ja envia sms … :wink: muito obrigado!

Como posso criar uma automaçao / script para enviar sms para uma lista de numeros como no 1º topico mas com o zanzito: algo do genero:
contact_list:
name: Contactos
options:
- Rodolfo
- Contact 2
- Contact 3
- Contact 4
- Contact 5
- “Número” ## with this option we can set the phone number in the Number input_text
initial: “Número”

tal como no 1º topico … ?

Boa noite comprei esta app, já fiz o tutorial, mas nao me esta a enviar sms…
deu erro ao validar a configuraçao:
entao no ficheiro groups.yaml tive de desativar o
#view: yes

e no
join.yaml
tive de desativar o:

#control: hidden
#view: no

no front end tenho:

join

qual pode ser o problema ? sera de ter comentado aquele codigo ?

codigo do groups.yaml

default_view:
  #view: yes
  icon: mdi:home
  entities:
    - group.join_joaoapps

codigo do join.yaml


homeassistant:
###############################################################################
#                                                                             #
#                         C U S T O M I Z E                                   #
#                                                                             #
###############################################################################   

  customize:
    script.join_mega_script:
      icon: mdi:email
    input_text.msg_text:
      icon: mdi:comment-text-outline
    input_text.phone_number:
      icon: mdi:phone-classic
    input_text.join_url:
      icon: mdi:web
    input_text.join_cmd:
      icon: mdi:console
    input_select.contact_list:
      icon: mdi:account-group
    input_select.join_services:
      icon: mdi:sitemap
  customize_glob:
    "script.join_script_*":
      hidden: true

###############################################################################
#                                                                             #
#                         G R O U P                                           #
#                                                                             #
###############################################################################         
      
group:
  join_joaoapps:
    name: "Join"
    #control: hidden
    #view: no
    entities:
      - input_select.contact_list
      - input_text.phone_number
      - input_text.msg_text
      - input_text.join_url
      - input_text.join_cmd
      - input_select.join_services
      - script.join_mega_script
      
###############################################################################
#                                                                             #
#                         N O T I F Y                                         #
#                                                                             #
###############################################################################         
      
notify:
  - platform: joaoapps_join
    name: Join
    api_key: dxxxxxxxxxxxxxxxx
    device_id: 9xxxxxxxxxxxxxxxxxxxxxxxx
    device_names: Galaxy S7 Edge

joaoapps_join:
  - name: SkySurf
    device_id: 9xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    api_key: dxxxxxxxxxxxxxxxxxxxxxxxxx
    
###############################################################################
#                                                                             #
#                         I N P U T    S E L E C T                            #
#                                                                             #
###############################################################################       

input_select:
  join_services:
    name: Serviços
    options:
     - Enviar SMS
     - Enviar Ficheiro
     - Enviar URL
     - Enviar comando tasker
     - Tocar Telemóvel
     - Definir Wallpaper
    initial: Enviar SMS

  contact_list:
    name: Contactos
    options:
     - Henrique
     - Cxxxxxxx
     - xxxxxxxx
     - Contact 4 
     - Contact 5
     - "Número"        ## with this option we can set the phone number in the Number input_text
    initial: "Número"
###############################################################################
#                                                                             #
#                         I N P U T    T E X T                                #
#                                                                             #
###############################################################################   
    
input_text:
  msg_text:
    name: "SMS:"
    initial: ""

  phone_number:
    name: "Número:"
    max: 15
    initial: ""

  join_url:
    name: "Endereço URL:"
    initial: ""

  join_cmd:
    name: "Comando Tasker:"
    initial: Comando Tasker
    
###############################################################################
#                                                                             #
#                         S C R I P T                                         #
#                                                                             #
###############################################################################       

script:
  join_script_ring:
    alias: "Script Join Ring"
    sequence:
      - service: joaoapps_join.SkySurf_ring
      
  join_script_send_file:
    alias: "Script Join Send File"
    sequence:
      - service: joaoapps_join.SkySurf_send_file
        data_template:
          url: '{{ states("input_text.join_url") }}'
      - delay: 00:00:01
      - service: input_text.set_value
        data:
          entity_id: input_text.join_url
          value: Endereço URL
          
  join_script_send_sms:
    alias: "Script Join Send SMS"
    sequence:
      - service: joaoapps_join.SkySurf_send_sms
        data_template:
          message: '{{ states("input_text.msg_text") }}'
          number: >
            {% if is_state("input_select.contact_list", "Hxx") %} 9xxxxxxxx
            {% elif is_state("input_select.contact_list", "Cxxxx") %} 9xxxx
            {% elif is_state("input_select.contact_list", "Ixxxx") %} 9xxxxx
            {% elif is_state("input_select.contact_list", "Contact 4") %} 
            {% elif is_state("input_select.contact_list", "Contact 5") %} 
            {% elif is_state("input_select.contact_list", "Número") %} {{ states("input_text.phone_number") }}
            {% endif %}
      - delay: 00:00:05
      - service: input_text.set_value
        data:
          entity_id: input_text.msg_text
          value: ""
      - service: input_text.set_value
        data:
          entity_id: input_text.phone_number
          value: ""
          
  join_script_send_tasker:
    alias: "Script Join Send Tasker"
    sequence:
      - service: joaoapps_join.SkySurf_send_tasker
        data_template:
          command: '{{ states("input_text.join_cmd") }}'
      - delay: 00:00:01
      - service: input_text.set_value
        data:
          entity_id: input_text.join_cmd
          value: Comando Tasker
          
  join_script_send_url:
    alias: "Script Join Send URL"
    sequence:
      - service: joaoapps_join.SkySurf_send_url
        data_template:
          url: '{{ states("input_text.join_url") }}'
      - delay: 00:00:01
      - service: input_text.set_value
        data:
          entity_id: input_text.join_url
          value: Endereço URL
          
  join_script_set_wallpaper:
    alias: "Script Join Send URL"
    sequence:
      - service: joaoapps_join.SkySurf_set_wallpaper
        data_template:
          url: '{{ states("input_text.join_url") }}'
      - delay: 00:00:01
      - service: input_text.set_value
        data:
          entity_id: input_text.join_url
          value: Endereço URL
          
  join_mega_script:
    alias: "Enviar"
    sequence:
      - service: homeassistant.turn_on 
        data_template:
          entity_id: >
           {% if is_state("input_select.join_services", "Tocar Telemóvel") %} script.join_script_ring
           {% elif is_state("input_select.join_services", "Enviar Ficheiro") %} script.join_script_send_file
           {% elif is_state("input_select.join_services", "Enviar SMS") %} script.join_script_send_sms
           {% elif is_state("input_select.join_services", "Enviar comando tasker") %} script.join_script_send_tasker
           {% elif is_state("input_select.join_services", "Enviar URL") %} script.join_script_send_url
           {% elif is_state("input_select.join_services", "Definir Wallpaper") %} script.join_script_set_wallpaper
           {% endif %}

Nao sei se sera disso ou nao mas na app apareçe-me 2 dispositivos com o mesmo nome, escolhi o primeiro para fazer o join api:

Obrigado

@Skysurf isso já é antigo podes usar isto mais recente vê o video que está na parte final do post.

1 Curtiu

thanks …
mt obrigado


Copyright © 2017-2021. Todos os direitos reservados
CPHA.pt - info@cpha.pt


FAQ | Termos de Serviço/Regras | Política de Privacidade