From ef4592c24a0c896fd4bf0059699f3ebaf79f2a11 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Mon, 6 Jul 2026 02:55:29 -0400 Subject: HA: Add entity and automation ids See https://community.home-assistant.io/t/all-automations-show-no-traces-found/389304 and https://www.home-assistant.io/faq/unique_id --- hostnix/elmo/home-assistant.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'hostnix/elmo/home-assistant.nix') diff --git a/hostnix/elmo/home-assistant.nix b/hostnix/elmo/home-assistant.nix index 0fda5fe..fa1d2fa 100644 --- a/hostnix/elmo/home-assistant.nix +++ b/hostnix/elmo/home-assistant.nix @@ -29,6 +29,7 @@ let button = entity_id: action: { inherit action; + id = "button_${entity_id}"; alias = "Button ${entity_id}"; trigger = { inherit entity_id; @@ -106,6 +107,7 @@ in platform = "template"; switches = { midea_cool = { + unique_id = "switch_midea_cool"; value_template = "{{ is_state('climate.air_conditioner_1', 'cool') and state_attr('climate.air_conditioner_1', 'temperature')|float < 72 }}"; turn_on = [ { @@ -125,8 +127,9 @@ in climate = [ { - platform = "generic_thermostat"; + unique_id = "climate_bedroom_heat"; name = "Bedroom Heat"; + platform = "generic_thermostat"; heater = "switch.thermostat_heat"; target_sensor = "sensor.bedroom_temperature"; min_cycle_duration.minutes = 2; @@ -140,8 +143,9 @@ in # (setTemperatureAt "22:00" 69) } { - platform = "generic_thermostat"; + unique_id = "climate_bedroom_cool"; name = "Bedroom Cool"; + platform = "generic_thermostat"; ac_mode = true; heater = "switch.midea_cool"; target_sensor = "sensor.bedroom_temperature"; @@ -151,6 +155,7 @@ in automation = [ { + id = "depart"; alias = "Depart"; trigger = { platform = "zone"; @@ -166,6 +171,7 @@ in } { + id = "arrive_sunrise"; alias = "Arrive/Sunrise"; trigger = [ { @@ -192,6 +198,7 @@ in } { + id = "summer_thermostat"; alias = "Summer thermostat"; trigger = [ (ha.trigger.at "08:00") @@ -276,6 +283,7 @@ in # ]; # } { + id = "grow_light_morning"; alias = "Grow light morning"; # TODO make configurable (snooze) trigger = [ (ha.trigger.at "09:00") ]; @@ -297,6 +305,7 @@ in ]; } { + id = "grow_light_night"; alias = "Grow light night"; trigger = [ (ha.trigger.at "20:00") ]; action = [ (ha.action.off "switch.wakko") ]; @@ -313,6 +322,7 @@ in (ha.button "binary_sensor.bedroom_button_2" (ha.action.toggle "switch.wakko")) { + id = "fridge_door_ajar"; alias = "Fridge door ajar"; triggers = [ { @@ -339,6 +349,7 @@ in ]; } { + id = "fridge_door_closed"; alias = "Fridge door closed"; triggers = [ { @@ -360,6 +371,7 @@ in # The panel light can become unresponsive and need to be reboot. { + id = "panel_light_reinitialize"; alias = "Panel light reinitialize"; trigger = [ { -- cgit v1.3.1