mcpField
H
ha-entities

ha-entities

github.com/laurigatesOther5971 installsUpdated 1d ago
Repository

About ha-entities

A reference skill for Home Assistant users and agents working with entities. It covers domains, customization, templates, groups, attributes, and state access, rather than automation rules.

Key features

  1. 01Entity domains and IDs
  2. 02Entity customization
  3. 03Template sensors
  4. 04Groups and device classes
  5. 05State and attribute access

Use cases

  1. 01Identify the right entity domain
  2. 02Customize entity names and icons
  3. 03Create template sensors
  4. 04Read entity states in templates

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/laurigates/claude-plugins --skill ha-entities

After installing, type/ha-entitiesin Claude Code to confirm it loaded.

Bundled filesREFERENCE.md

Details

From the project README

Home Assistant Entities

When to Use This Skill

Use this skill when...Use ha-automations instead when...
Understanding entity domainsCreating automation rules
Customizing entitiesWorking with triggers/actions
Creating template sensorsWriting automation conditions
Setting up groupsWorking with scripts/scenes
Working with device classesHandling events

Entity ID Structure

domain.object_id

Examples:

  • light.living_room_ceiling
  • sensor.outdoor_temperature
  • binary_sensor.front_door_contact
  • switch.garden_irrigation

Common Domains

DomainDescriptionExample
lightLighting controllight.kitchen
switchOn/off switchesswitch.outlet
sensorNumeric sensorssensor.temperature
binary_sensorOn/off sensorsbinary_sensor.motion
climateHVAC controlclimate.thermostat
coverBlinds, garage doorscover.garage
lockDoor lockslock.front_door
media_playerMedia devicesmedia_player.tv
cameraCamera feedscamera.front_yard
vacuumRobot vacuumsvacuum.roomba
fanFan controlfan.bedroom
alarm_control_panelAlarm systemsalarm_control_panel.home
personPeople trackingperson.john
device_trackerDevice locationdevice_tracker.phone
weatherWeather infoweather.home
input_booleanVirtual toggleinput_boolean.guest_mode
input_numberVirtual numberinput_number.target_temp
input_selectVirtual dropdowninput_select.house_mode
input_textVirtual textinput_text.message
input_datetimeVirtual date/timeinput_datetime.alarm
input_buttonVirtual buttoninput_button.reset
automationAutomationsautomation.motion_light
scriptScriptsscript.morning_routine
sceneScenesscene.movie_night
groupEntity groupsgroup.all_lights
timerCountdown timerstimer.laundry
counterCounterscounter.guests
zoneGeographic zoneszone.home
sunSun positionsun.sun

For complete device class tables (binary sensor and sensor), see REFERENCE.md.

Entity Customization

customize.yaml
# Single entity
light.living_room:
  friendly_name: "Living Room Light"
  icon: mdi:ceiling-light

# Binary sensor
binary_sensor.front_door:
  friendly_name: "Front Door"
  device_class: door

# Sensor
sensor.outdoor_temperature:
  friendly_name: "Outdoor Temperature"
  device_class: temperature
  unit_of_measurement: "°C"
Glob Customization
customize_glob:
  "light.*_ceiling":
    icon: mdi:ceiling-light

  "sensor.*_temperature":
    device_class: temperature
    unit_of_measurement: "°C"

  "binary_sensor.*_motion":
    device_class: motion

Template Sensors

template:
  - sensor:
      # Simple state
      - name: "Average Temperature"
        unit_of_measurement: "°C"
        device_class: temperature
        state: >-
          {{ ((states('sensor.living_room_temp') | float +
               states('sensor.bedroom_temp') | float +
               states('sensor.kitchen_temp') | float) / 3) | round(1) }}

      # With attributes
      - name: "Power Usage"
        unit_of_measurement: "W"
        device_class: power
        state: "{{ states('sensor.energy_meter_power') }}"
        attributes:
          cost_per_hour: >-
            {{ (states('sensor.energy_meter_power') | float * 0.15 / 1000) | round(2) }}

      # Availability
      - name: "Solar Power"
        unit_of_measurement: "W"
        device_class: power
        state: "{{ states('sensor.inverter_power') }}"
        availability: "{{ states('sensor.inverter_power') != 'unavailable' }}"

For template binary sensors, switches, buttons, numbers, groups, utility meters, counters, and timers, see REFERENCE.md.

State Attributes

Common Attributes
DomainCommon Attributes
lightbrightness, color_temp, rgb_color, hs_color, effect
climatetemperature, current_temperature, hvac_action, preset_mode
media_playervolume_level, media_title, media_artist, source
covercurrent_position, current_tilt_position
weathertemperature, humidity, pressure, wind_speed, forecast
personsource, latitude, longitude, gps_accuracy
sunelevation, azimuth, next_rising, next_setting
Accessing Attributes
# In templates
{{ state_attr('light.living_room', 'brightness') }}
{{ state_attr('climate.thermostat', 'current_temperature') }}
{{ state_attr('sun.sun', 'elevation') }}

# In conditions
condition:
  - condition: numeric_state
    entity_id: light.living_room
    attribute: brightness
    above: 100

Quick Reference

State Functions
FunctionDescriptionExample
states('entity')Get statestates('sensor.temp')
state_attr('entity', 'attr')Get attributestate_attr('light.x', 'brightness')
is_state('entity', 'value')Check stateis_state('light.x', 'on')
is_state_attr('entity', 'attr', 'val')Check attributeis_state_attr('climate.x', 'hvac_action', 'heating')
states.domainAll entities in domainstates.light
expand('group.x')Expand group membersexpand('group.all_lights')

Agentic Optimizations

ContextCommand
Find entity usagegrep -r "entity_id:" config/ --include="*.yaml"
List customizationsgrep -rA2 "^[a-z_]*\\..*:" config/customize.yaml
Find template sensorsgrep -rB2 "platform: template" config/ --include="*.yaml"
Find groupsgrep -rA5 "^group:" config/ --include="*.yaml"
List domains usedgrep -roh "[a-z_]*\\." config/ --include="*.yaml" | sort -u

Comments

Markdown supported