mcpField
H
Home Assistant Automation

Home Assistant Automation

github.com/claude-office-skillsその他5454.9k 回インストール39 週間前に更新
リポジトリ

Home Assistant Automation について

Home Assistant Automation は、Home Assistant のスマートホーム設定向けスキルです。デバイス制御やシーン、音声コマンドに加え、エネルギー監視とセキュリティの例を扱います。

主な機能

  1. 01照明などのデバイス制御
  2. 02時刻や状態を使った自動化
  3. 03デバイスシーンの設定
  4. 04音声コマンドの定義
  5. 05エネルギー・セキュリティ自動化の設計

活用シーン

  1. 01時刻やセンサー状態で照明を起動
  2. 02映画鑑賞用の照明シーンを設定
  3. 03音声インテントでサーモスタットを操作
  4. 04動体検知とエネルギー監視を設定

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/claude-office-skills/skills --skill home-assistant-automation

インストール後、Claude Code で/home-assistant-automationを入力して読み込まれたか確認します。

詳細

Home Assistant の自動化

スマートホームデバイスを自動化し、インテリジェントな自動化ワークフローを作成します。

主な機能

デバイス制御
device_commands:
  lights:
    - turn_on:
        entity_id: light.living_room
        brightness_pct: 80
        color_temp: 350
    - turn_off:
        entity_id: light.all_lights
        
  climate:
    - set_temperature:
        entity_id: climate.main_thermostat
        temperature: 72
        hvac_mode: heat
        
  media:
    - media_play_pause:
        entity_id: media_player.living_room_tv
    - volume_set:
        entity_id: media_player.sonos
        volume_level: 0.5
自動化テンプレート
automations:
  morning_routine:
    trigger:
      - platform: time
        at: "06:30:00"
      - platform: state
        entity_id: binary_sensor.alarm
        to: "off"
    condition:
      - condition: state
        entity_id: person.owner
        state: "home"
    action:
      - service: light.turn_on
        target:
          entity_id: light.bedroom
        data:
          brightness_pct: 30
          transition: 300
      - service: climate.set_temperature
        data:
          temperature: 72
      - delay: "00:05:00"
      - service: media_player.play_media
        data:
          media_content_type: music
          media_content_id: "news_briefing"

  away_mode:
    trigger:
      platform: state
      entity_id: group.family
      to: "not_home"
      for: "00:10:00"
    action:
      - service: climate.set_preset_mode
        data:
          preset_mode: away
      - service: light.turn_off
        target:
          entity_id: all
      - service: lock.lock
        target:
          entity_id: lock.front_door
シーン
scenes:
  movie_night:
    entities:
      light.living_room:
        state: on
        brightness: 20
        color_temp: 500
      light.tv_backlight:
        state: on
        rgb_color: [0, 0, 255]
      media_player.soundbar:
        state: on
        source: "TV"
      cover.blinds:
        state: closed
        
  good_night:
    entities:
      light.all_lights:
        state: off
      lock.all_locks:
        state: locked
      alarm_control_panel.home:
        state: armed_night
      climate.thermostat:
        temperature: 68
音声コマンド
voice_intents:
  - intent: "Turn on the lights"
    action: light.turn_on
    entity: light.all_lights
    
  - intent: "Set temperature to {temp}"
    action: climate.set_temperature
    entity: climate.thermostat
    data:
      temperature: "{{ temp }}"
      
  - intent: "I'm leaving"
    action: script.away_mode

統合の例

エネルギー監視
energy_dashboard:
  sensors:
    - sensor.electricity_usage
    - sensor.solar_production
    - sensor.battery_level
  automations:
    - name: "Off-peak charging"
      trigger:
        platform: time
        at: "00:00:00"
      action:
        service: switch.turn_on
        entity_id: switch.ev_charger
セキュリティシステム
security:
  motion_detection:
    trigger:
      platform: state
      entity_id: binary_sensor.motion_front
      to: "on"
    condition:
      - condition: state
        entity_id: alarm_control_panel.home
        state: armed_away
    action:
      - service: camera.snapshot
        entity_id: camera.front_door
      - service: notify.mobile_app
        data:
          message: "Motion detected at front door"
          data:
            image: "/local/snapshots/front_door.jpg"

ベストプラクティス

  1. エンティティの命名:一貫した命名規則を使用します
  2. グループ:デバイスを論理的に整理します
  3. 条件:常に適切な条件を追加します
  4. 通知:通知を送りすぎないようにします
  5. テスト:自動化を徹底的にテストします
  6. バックアップ:定期的に設定をバックアップします

コメント