Home AssistantとEchobell:スマートホームの即時アラート通知

Home AssistantをRESTコマンドとWebhookでEchobellに接続し、セキュリティイベント、温度アラート、オートメーションのトリガーを優先度付きのプッシュ通知や電話着信で受け取る方法を解説します。

Home AssistantとEchobell:スマートホームの即時アラート通知

Home Assistantの標準モバイル通知は、他のスマートフォン通知に埋もれてしまいがちです。Echobellは優先度レベル(プッシュ、タイムセンシティブ、実際の電話着信)を追加することで、重要なスマートホームのイベントが見落とされないようにします。このインテグレーションにカスタムコンポーネントは不要で、RESTコマンドとWebhook URLだけで連携できます。

基本セットアップ

  1. Echobellをダウンロードしてチャンネルを作成(例:「Home Alerts」)
  2. チャンネル設定からWebhook URLをコピー
  3. configuration.yamlにRESTコマンドを追加:
rest_command:
  echobell_home:
    url: "https://hook.echobell.one/t/YOUR_TOKEN"
    method: POST
    content_type: "application/json"
    payload: '{"title": "{{ title }}", "message": "{{ message }}"}'
  1. Home Assistantを再起動
  2. 任意のオートメーションからサービスを呼び出す

ドアセンサーの簡単なオートメーションでテスト:

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チャンネルタイプを**着信(Calling)**に設定して電話のように鳴らします:

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の条件を使ってチャンネル側でフィルタリング:

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)

これにより、外出中のセキュリティが有効な場合または夜間のみアラートが送られ、日中の動体検知ノイズをオートメーションを無効にせずにフィルタリングできます。

家電の完了アラート

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!"

朝のサマリー

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のNotification履歴にタップ可能なリンクを追加できます:

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. Home Routine(通常): 家電、日次サマリー
  2. Home Monitoring(タイムセンシティブ): 温度、湿度、電力スパイク
  3. Home Security(着信): 警戒中の動体検知、ドアセンサー、重大な障害

Webhook URLのセキュリティ

Home Assistantのsecretsを使ってWebhook URLが設定ファイルに露出しないようにする:

# secrets.yaml
echobell_webhook: "https://hook.echobell.one/t/YOUR_TOKEN"

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

高度なテンプレートとトラブルシューティングを含む技術ドキュメントの詳細はHome Assistantインテグレーションガイドを参照してください。その他のインテグレーションについてはGitHub Actions通知Grafana監視アラートをご覧ください。