📑 Como enviar SMS através do HA

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