코딩정보




● HA작업) HA와 텔레그램 봇 연동하기 ( 폴링방식 / polling )

♨ 카랜더 일정 : 2023년05월16일
  • 링크

  • 첨부

  • 컨텐츠 정보

    본문

    ● HA작업) HA와 텔레그램 봇 연동하기 ( 폴링방식 / polling ) 
    homeassistant haos 
    https://cafe.naver.com/koreassistant/8444
    https://cafe.naver.com/koreassistant/9611

    참조 작업 성공 했 습니다.

    3232235521_1684166719.1903.png
    텔레그램 설정

    
    
    # configuation.yaml 에 추가
    telegram_bot:
      - platform: polling
        api_key: 0000000000:00000000000000000000000000000000000 <- 생성한 봇의 API키 입력
        allowed_chat_ids:
          - 0000000000
    ===================
    
    메뉴호출 자동화 호출 설정

    
    # configuation.yaml 에 추가
    telegram_bot:
      - platform: polling
        api_key: 5245210519:AAGAiz3V3Eiv-HxPdx-0V86bibG???
        allowed_chat_ids:
          - 778557??
    #자동화에 yaml 추가 1
    alias: 메뉴호출
    trigger:
      - platform: event
        event_type: telegram_command
        event_data:
          command: /menu
    action:
      - service: telegram_bot.send_message
        data:
          disable_notification: false
          title: ???? IoT Home
          message: 안녕하세요 IoT Home 제어 메뉴입니다.
           원하시는 동작을 선택해주세요.
          keyboard:
            - /자동상태알림
            - /UPS
            - /게이트웨이
            - /전등
            - /스마트플러그
    

    자동화 추가 하기

    
    # 자동화 추가 2
    alias: Google Home Telegram Say
    description: ''
    trigger:
      - platform: event
        event_type: telegram_command
        event_data:
          command: /say
    # say 띄우고 뒤에 메세지 적으면 됩니다. 예를들어 /say 강아지 붙잡아 두세요 엘베타고 올라갑니다.
    condition: []
    action:
      - service: tts.google_say
        entity_id: media_player.nest_hub_seojae # 원하시는 스피커에 id를 넣으시면 되고 그룹화 하셨다면 그 그룹화된 id를 넣으시면 됩니다.
        data_template:
          message: '{{ trigger.event.data[''args''] |join('' '') }}'
    mode: single
    
    --------------------
    구글 네스트허브 볼륨 70% 로 볼륨 변경하여  메세지 보내고 40%로 볼륨 변경하기
    --------
    
    alias: Google Home Telegram Sayhub
    description: ""
    trigger:
      - platform: event
        event_type: telegram_command
        event_data:
          command: /sayhub
    condition: []
    action:
      - service: media_player.volume_set
        entity_id: media_player.nest_hub_seojae
        data:
          volume_level: 0.7
      - service: tts.google_say
        entity_id: media_player.nest_hub_seojae
        data_template:
          message: "{{ trigger.event.data['args'] |join(' ') }}"
      - delay: "00:00:22"
      - service: media_player.volume_set
        entity_id: media_player.nest_hub_seojae
        data:
          volume_level: 0.4
    mode: single
    
    구룹을 지정후 all speaker에 보내기
    조건  >/config/configuration.yaml 에서 그룹지정 하기
    
    media_player:
      - platform: group
        entities:
          - media_player.nest_hub_seojae
          - media_player.nest_audio_geosil
          - media_player.hommini_anbang
        name: speaker_all
    
    자동화추가하기>  yaml 로 수정하기 텔레그램 으로 메세지 전송
    
    alias: Google Home Telegram Sayall
    description: ""
    trigger:
      - platform: event
        event_type: telegram_command
        event_data:
          command: /sayall
    condition: []
    action:
      - service: media_player.volume_set
        entity_id: media_player.speaker_all
        data:
          volume_level: 0.7
      - service: tts.google_say
        entity_id: media_player.speaker_all
        data_template:
          message: "{{ trigger.event.data['args'] |join(' ') }}"
      - delay: "00:00:22"
      - service: media_player.volume_set
        entity_id: media_player.speaker_all
        data:
          volume_level: 0.4
    mode: single
    
    ☞ https://11q.kr 에 등록된 자료 입니다. ♠ 정보찾아 공유 드리며 출처는 링크 참조 바랍니다♠1.png
    [ 추가 정보 ... 더보기) ]
    뷰PDF 1,2



    office view

    관련자료

    댓글목록

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일
    답변
    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일
    답변



    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-04-26 16:33:08

    오늘의 홈 현황


    • 현재 접속자♨ 120 명
    • 오늘 가입자※ 2 명
    • 어제 가입자※ 3 명
    • 주간 가입자※ 20 명
    • 오늘 방문자 1,373 명
    • 어제 방문자 1,686 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,289,890 명
    • 전체 게시물※ 8,534 개
    • 전체 댓글수※ 24,515 개
    • 전체 회원수 10,932 명

    QR코드


    ☞ QR코드 스캔은 kakao앱 자체 QR코드

    알림 0








    최신글↑