---
title: "การแจ้งเตือนจาก Home Assistant ด้วย Echobell: แจ้งเตือนทันทีสำหรับบ้านอัจฉริยะของคุณ"
description: "เชื่อม Home Assistant เข้ากับ Echobell ผ่าน REST command เพื่อรับการแจ้งเตือนแบบพุชตามลำดับความสำคัญหรือสายโทรเข้า สำหรับเหตุการณ์ด้านความปลอดภัยและระบบอัตโนมัติ"
date: 2025-12-01
author: Nooc
authorAvatarLink: /images/avatars/nooc.webp
authorLink: https://nooc.me
tags:
  - Echobell
  - Home Assistant
  - บ้านอัจฉริยะ
  - ระบบอัตโนมัติในบ้าน
  - การแจ้งเตือนผ่าน Webhook
---

# การแจ้งเตือนจาก Home Assistant ด้วย Echobell: แจ้งเตือนทันทีสำหรับบ้านอัจฉริยะของคุณ

การแจ้งเตือนบนมือถือที่มากับ Home Assistant กลมกลืนไปกับทุกอย่างบนมือถือของคุณ Echobell เพิ่มระดับความสำคัญเข้าไป ทั้งแบบพุช สำคัญตามเวลา หรือสายโทรเข้าจริง ๆ เพื่อไม่ให้เหตุการณ์สำคัญในบ้านอัจฉริยะจมหายไป การเชื่อมต่อนี้ไม่ต้องใช้คอมโพเนนต์เสริมใด ๆ ใช้แค่ REST command กับ URL ของ webhook ของคุณ

## การตั้งค่าเบื้องต้น

1. [ดาวน์โหลด Echobell](https://apps.apple.com/app/apple-store/id6743597198?pt=128151925&ct=blog-home-assistant-notifications-1ozbir&mt=8) / [Google Play](https://play.google.com/store/apps/details?id=one.echobell.echobellandroid) แล้วสร้างช่องหนึ่งช่อง (เช่น "Home Alerts")
2. คัดลอก URL ของ webhook จากหน้าตั้งค่าช่อง
3. เพิ่ม REST command ลงใน `configuration.yaml`:

```yaml
rest_command:
  echobell_home:
    url: "https://hook.echobell.one/t/<channel-token>"
    method: POST
    content_type: "application/json"
    payload: '{"title": "{{ title }}", "message": "{{ message }}"}'
```

4. รีสตาร์ต Home Assistant
5. เรียกใช้บริการนี้จากออโตเมชันใดก็ได้

ทดสอบด้วยออโตเมชันเซนเซอร์ประตูง่าย ๆ:

```yaml
automation:
  - alias: "Door Open Test"
    trigger:
      - platform: state
        entity_id: binary_sensor.front_door
        to: "on"
    action:
      - service: rest_command.echobell_home
        data:
          title: "Front Door"
          message: "Door opened at {{ now().strftime('%H:%M') }}"
```

## ตัวอย่างออโตเมชันที่ใช้ได้จริง

### มอนิเตอร์อุณหภูมิพร้อมสายโทรแจ้งเตือน

สำหรับเซนเซอร์ที่ปกป้องอาหาร อุปกรณ์ หรือความปลอดภัย ให้ตั้งประเภทช่อง Echobell เป็น **โทรเข้า** เพื่อให้ดังเหมือนสายโทรศัพท์:

```yaml
automation:
  - alias: "Freezer Temperature Alert"
    trigger:
      - platform: numeric_state
        entity_id: sensor.freezer_temperature
        above: -10
        for:
          minutes: 15
    action:
      - service: rest_command.echobell_home
        data:
          title: "⚠️ Freezer Temperature Alert"
          message: "Freezer is at {{ states('sensor.freezer_temperature') }}°C for 15+ minutes"
          severity: "critical"
```

### แจ้งเตือนความปลอดภัยอย่างชาญฉลาด

ส่งตัวแปรบริบทไปกับ webhook แล้วใช้[เงื่อนไขของ Echobell](/th/docs/conditions)กรองที่ฝั่งช่อง:

```yaml
automation:
  - alias: "Smart Security Alert"
    trigger:
      - platform: state
        entity_id:
          - binary_sensor.motion_living_room
          - binary_sensor.motion_bedroom
        to: "on"
    action:
      - service: rest_command.echobell_home
        data:
          title: "Security Event"
          message: "{{ trigger.to_state.attributes.friendly_name }} detected motion"
          alarm_state: "{{ states('alarm_control_panel.home_alarm') }}"
          hour: "{{ now().hour }}"
```

เงื่อนไขของช่อง: `alarm_state == "armed_away" || (hour >= 22 || hour <= 7)`

แบบนี้จะส่งการแจ้งเตือนเฉพาะตอนที่ระบบกันขโมยถูกเปิดใช้งานหรือเป็นเวลากลางคืน ซึ่งช่วยกรองสัญญาณรบกวนจากความเคลื่อนไหวตอนกลางวันออกไป โดยไม่ต้องปิดออโตเมชันทิ้ง

### แจ้งเตือนเมื่อเครื่องใช้ไฟฟ้าทำงานเสร็จ

```yaml
automation:
  - alias: "Laundry Done"
    trigger:
      - platform: state
        entity_id: sensor.washer_power
        to: "0"
        for:
          minutes: 3
    action:
      - service: rest_command.echobell_home
        data:
          title: "🧺 Laundry Complete"
          message: "Washing machine finished. Don't let it sit!"
```

### สรุปประจำเช้า

```yaml
automation:
  - alias: "Morning Home Report"
    trigger:
      - platform: time
        at: "08:00:00"
    action:
      - service: rest_command.echobell_home
        data:
          title: "Good Morning - Home Status"
          message: >
            Temperature: {{ states('sensor.living_room_temperature') }}°C
            Humidity: {{ states('sensor.living_room_humidity') }}%
            Energy yesterday: {{ states('sensor.daily_energy') }} kWh
            All windows: {% if is_state('binary_sensor.window_group', 'off') %}Closed{% else %}OPEN{% endif %}
```

## ฟีเจอร์ขั้นสูง

### ลิงก์ตามบริบท

ตัวแปร `externalLink` จะเพิ่มลิงก์ที่แตะได้ลงในประวัติการแจ้งเตือนของคุณใน Echobell:

```yaml
action:
  - service: rest_command.echobell_home
    data:
      title: "Motion at Front Door"
      message: "Check the camera feed"
      externalLink: "https://my-home-assistant.duckdns.org/lovelace/security"
```

### กลยุทธ์แบบหลายช่อง

ใช้ช่องแยกกันโดยตั้งประเภทการแจ้งเตือนต่างกัน:

1. **กิจวัตรในบ้าน** (ปกติ): เครื่องใช้ไฟฟ้า สรุปประจำวัน
2. **การมอนิเตอร์บ้าน** (สำคัญตามเวลา): อุณหภูมิ ความชื้น การใช้พลังงานที่พุ่งสูง
3. **ความปลอดภัยในบ้าน** (โทรเข้า): ความเคลื่อนไหวขณะเปิดระบบกันขโมย เซนเซอร์ประตู ความล้มเหลวร้ายแรง

### เก็บ URL ของ Webhook ให้ปลอดภัย

ใช้ระบบ secrets ของ Home Assistant เพื่อไม่ให้ URL ของ webhook ปรากฏในไฟล์คอนฟิก:

```yaml
# secrets.yaml
echobell_webhook: "https://hook.echobell.one/t/<channel-token>"

# configuration.yaml
rest_command:
  echobell_home:
    url: !secret echobell_webhook
```

ดูเอกสารทางเทคนิคฉบับเต็ม รวมถึงการใช้เทมเพลตขั้นสูงและการแก้ปัญหา ได้ที่[คู่มือการเชื่อมต่อ Home Assistant](/th/docs/developer/home-assistant) ส่วนการเชื่อมต่ออื่น ๆ ดูได้ที่[การแจ้งเตือนจาก GitHub Actions](/th/blog/github-actions-notifications) และ[การแจ้งเตือนการมอนิเตอร์ด้วย Grafana](/th/blog/grafana-call-notification)
