From 7c0b5821d09272b3826ec4051f9e29b31ab78ffb Mon Sep 17 00:00:00 2001 From: Christopher Viel Date: Sat, 24 Aug 2024 13:26:08 -0400 Subject: [PATCH] Update terrarium devices and cards --- blueprints/automation/presence_light.yaml | 11 +- .../automation/terrarium_scheduling.yaml | 45 ++- dashboards/cards/livings-overview.yaml | 2 +- dashboards/cards/terrarium.yaml.j2 | 288 ------------------ dashboards/views/terrariums.yaml | 158 ++++------ packages/core/history.yaml | 29 +- packages/core/zwave.yaml | 3 +- packages/livings/aunt_lydia.yaml | 106 +++++++ packages/livings/carl.yaml | 88 ------ packages/livings/slinky.yaml | 135 -------- 10 files changed, 219 insertions(+), 646 deletions(-) delete mode 100644 dashboards/cards/terrarium.yaml.j2 create mode 100644 packages/livings/aunt_lydia.yaml delete mode 100644 packages/livings/slinky.yaml diff --git a/blueprints/automation/presence_light.yaml b/blueprints/automation/presence_light.yaml index 213bad65..0618761e 100644 --- a/blueprints/automation/presence_light.yaml +++ b/blueprints/automation/presence_light.yaml @@ -27,7 +27,8 @@ blueprint: description: This light will turn on when presence is detected. selector: entity: - domain: light + filter: + - domain: light light_off_entity: name: Light description: > @@ -36,15 +37,17 @@ blueprint: Defaults to `light_entity`. selector: entity: - domain: light + filter: + - domain: light default: "" presence_entity: name: Presence entity description: The presence sensor that will be used as a trigger. selector: entity: - domain: binary_sensor - device_class: presence + filter: + - domain: binary_sensor + device_class: presence initial_state: true max_exceeded: silent diff --git a/blueprints/automation/terrarium_scheduling.yaml b/blueprints/automation/terrarium_scheduling.yaml index af69ce92..3d4e5ac5 100644 --- a/blueprints/automation/terrarium_scheduling.yaml +++ b/blueprints/automation/terrarium_scheduling.yaml @@ -8,34 +8,43 @@ blueprint: description: A boolean input that enables/disables scheduling altogether. selector: entity: - domain: input_boolean + filter: + - domain: input_boolean day_time_entity: name: Day time input entity description: The entity representing when day time starts for this terrarium. selector: entity: - domain: input_datetime + filter: + - domain: input_datetime night_time_entity: name: Night time input entity description: The entity representing when night time starts for this terrarium. selector: entity: - domain: input_datetime + filter: + - domain: input_datetime heat_bulb_switch: name: Heat bulb + default: switch.dummy selector: entity: - domain: switch + filter: + - domain: switch heater_switch: name: Heater + default: switch.dummy selector: entity: - domain: switch + filter: + - domain: switch uv_light_switch: name: UV light + default: switch.dummy selector: entity: - domain: switch + filter: + - domain: switch initial_state: true mode: "restart" @@ -45,6 +54,10 @@ trigger: at: - !input day_time_entity - !input night_time_entity + - platform: state + entity_id: + - !input day_time_entity + - !input night_time_entity - platform: state entity_id: !input scheduling_entity from: "off" @@ -53,8 +66,9 @@ trigger: event: start variables: - day_time_entity: !input day_time_entity - night_time_entity: !input night_time_entity + heat_bulb_switch: !input heat_bulb_switch + heater_switch: !input heater_switch + uv_light_switch: !input uv_light_switch condition: - condition: state @@ -63,6 +77,7 @@ condition: action: - action: switch.turn_on + enabled: "{{ heater_switch != 'switch.dummy' }}" target: entity_id: !input heater_switch @@ -72,11 +87,19 @@ action: before: !input night_time_entity then: - action: switch.turn_on + enabled: "{{ heat_bulb_switch != 'switch.dummy' }}" + target: + entity_id: !input heat_bulb_switch + - action: switch.turn_on + enabled: "{{ uv_light_switch != 'switch.dummy' }}" target: entity_id: !input uv_light_switch else: - action: switch.turn_off + enabled: "{{ heat_bulb_switch != 'switch.dummy' }}" + target: + entity_id: !input heat_bulb_switch + - action: switch.turn_off + enabled: "{{ uv_light_switch != 'switch.dummy' }}" target: - entity_id: - - !input heat_bulb_switch - - !input uv_light_switch + entity_id: !input uv_light_switch diff --git a/dashboards/cards/livings-overview.yaml b/dashboards/cards/livings-overview.yaml index 92a235b9..d3592b9d 100644 --- a/dashboards/cards/livings-overview.yaml +++ b/dashboards/cards/livings-overview.yaml @@ -13,7 +13,7 @@ elements: state_filter: "on": sepia() saturate(350%) hue-rotate(-50deg) "off": inherit - entity: binary_sensor.slinky_requires_attention + entity: binary_sensor.lydia_requires_attention image: /local/animals/slinky_tile.jpg double_tap_action: action: navigate diff --git a/dashboards/cards/terrarium.yaml.j2 b/dashboards/cards/terrarium.yaml.j2 deleted file mode 100644 index 72cb006e..00000000 --- a/dashboards/cards/terrarium.yaml.j2 +++ /dev/null @@ -1,288 +0,0 @@ -{# Parameters: - # * image: The URL of the image to display in background. - # * problems_entity_id: Entity representing problems of this terrarium - # * switches: array - # * entity_id: Entity to be used - # * has_power_metrics: `true` if this switch has power and energy sensors - # * lock: `true` if the button should be locked to prevent accidental activations - # * name: Visible name of the entity - # * problem_key: The key that is used to reference this entity from problems_entity_id - # * show_in_footer: `true` if this switch is controllable from the footer - # * sensors[]: array - # * entity_id: Entity to be used - # * name: Visible name of the entity - # * settings[]: array - # * entity_id: Entity to be used - # * name: Visible name of the entity - #} - -{% macro detailed_switch(switch, aspect_ratio) %} -{% set object_id = switch.entity_id.split('.')[1] %} -- type: custom:button-card - name: {{ switch.name }} - entity: {{ switch.entity_id }} - {% if switch.has_power_metrics is true -%} - triggers_update: - - sensor.{{ object_id }}_power - - sensor.{{ object_id }}_energy - {%- endif %} - aspect_ratio: {{ aspect_ratio }} - show_label: {{ switch.has_power_metrics is true }} - {% if switch.lock is true -%} - lock: - enabled: true - {%- endif %} - {% if switch.has_power_metrics is true -%} - label: > - [[[ - return Math.round(states['sensor.{{ object_id }}_power'].state) - + ' ' - + states['sensor.{{ object_id }}_power'].attributes['unit_of_measurement'] - + ' ⁓ ' - + Math.round(states['sensor.{{ object_id }}_energy'].state) - + ' ' - + states['sensor.{{ object_id }}_energy'].attributes['unit_of_measurement'] - ]]] - hold_action: - action: more-info - entity: sensor.{{ object_id }}_power - {%- else -%} - hold_action: - action: more-info - entity: {{ switch.entity_id }} - {%- endif %} - styles: - name: - - font-size: 14px - - padding: 0px 5px - label: - - color: "#BDBDBD" - - font-size: 12px - - padding: 0px 5px -{% endmacro %} - -type: picture-elements -image: {{ image }} -card_mod: - style: | - .element[class~=element] { - position: relative; - transform: none; - } - ::-webkit-scrollbar { - width: 3px; - height: 3px; - } - ::-webkit-scrollbar-track { - background: rgba(0, 0, 0, 0.45); - } - ::-webkit-scrollbar-thumb { - background: rgba(0, 139, 239, 0.45); - } - ::-webkit-scrollbar-thumb:hover { - background: rgba(0, 139, 239, 1); - } -elements: - - type: custom:container-element - style: - position: absolute - top: 0 - right: 0 - left: 0 - bottom: 0 - display: flex - flex-direction: column - "--secondary-text-color": "#DADADB" - "--primary-text-color": "#DADADB" - "--paper-item-icon-color": "#DADADB" - - "--ha-card-background": "rgba(0, 0, 0, 0)" - "--ha-card-box-shadow": "none" - - "--mdc-theme-primary": "#DADADB" - "--mdc-icon-size": "40px" - "--mdc-typography-subtitle1-font-weight": "500" - - "--mdc-select-fill-color": "transparent" - "--mdc-select-outlined-idle-border-color": "transparent" - "--mdc-select-outlined-hover-border-color": "transparent" - "--mdc-select-dropdown-icon-color": "#DADADB" - "--mdc-select-label-ink-color": "#DADADB" - "--mdc-select-ink-color": "#DADADB" - "--mdc-select-idle-line-color": "#DADADB" - "--mdc-select-hover-line-color": "#DADADB" - - "--mdc-text-field-fill-color": "transparent" - "--mdc-text-field-outlined-idle-border-color": "transparent" - "--mdc-text-field-outlined-hover-border-color": "transparent" - "--mdc-text-field-ink-color": "#DADADB" - "--mdc-text-field-label-ink-color": "#DADADB" - "--mdc-text-field-idle-line-color": "#DADADB" - "--mdc-text-field-hover-line-color": "#DADADB" - - elements: - - type: custom:container-element # Content - style: - order: 1 - flex-grow: 1 - flex-shrink: 1 - display: flex - overflow: auto hidden - scroll-behavior: smooth - scroll-snap-type: x mandatory - "-webkit-overflow-scrolling": touch - "--mdc-icon-size": 24px - elements: - - type: conditional # Problem indicator - conditions: - - entity: {{ problems_entity_id }} - state: "on" - elements: - - type: icon - icon: mdi:alert-circle - title: Problems - entity: {{ problems_entity_id }} - tap_action: - action: more-info - style: - position: absolute - right: 1em - top: 1.25em - z-index: 1 - color: var(--error-color) - filter: drop-shadow(black 0 0 1px) - - - type: custom:container-element # Initial - style: &content_slide_style - display: block - width: 100% - height: 100% - flex-shrink: 0 - scroll-snap-align: start - - - type: custom:hui-element # All switches - card_type: vertical-stack - style: - <<: *content_slide_style - background-color: rgba(0, 0, 0, 0.45) - cards: - - type: horizontal-stack - cards: -{% filter indent(18) -%} -{% for switch in (switches | default([]) | list)[:3] -%} -{{ detailed_switch(switch, "1.7/1") }} -{% endfor %} -{%- endfilter %} - - type: horizontal-stack - cards: -{% filter indent(18) -%} -{% for switch in (switches | default([]) | list)[3:] -%} -{{ detailed_switch(switch, "1.2/1") }} -{% endfor %} -{%- endfilter %} - - - type: custom:hui-element # Settings - card_type: entities - show_header_toggle: false - style: - <<: *content_slide_style - background-color: rgba(0, 0, 0, 0.45) - entities: -{%- for setting in (settings | default([]) | list) %} - - entity: {{ setting.entity_id }} - name: {{ setting.name }} -{%- endfor %} - - - type: custom:container-element # Footer - style: - overflow: hidden - display: flex - order: 2 - flex-grow: 0 - flex-shrink: 0 - align-items: center - padding: 0 5px - background-color: rgba(0, 0, 0, 0.45) - color: "#D3D3D3" - height: 50px - elements: -{% for switch in switches | default([]) | selectattr('show_in_footer', 'true') %} -{% set object_id = switch.entity_id.split('.')[1] %} - - type: custom:button-card - name: {{ switch.name }} - entity: {{ switch.entity_id }} - triggers_update: - - {{ problems_entity_id }} - {% if switch.has_power_metrics is true -%} - - sensor.{{ object_id }}_power - {% endif %} - show_label: false - show_name: false - show_icon: true - - custom_fields: - warning: " " - - {% if switch.has_power_metrics is true -%} - hold_action: - action: more-info - entity: sensor.{{ object_id }}_power - {% endif %} - style: - margin-right: {% if not loop.last %}15px{% else %}auto{% endif %} - styles: - card: - - display: inline - - overflow: visible - - box-shadow: none - - background-color: transparent - grid: - - position: relative - - grid-template-areas: '"i" "badge"' - - grid-template-columns: 2rem - - grid-template-rows: 2rem 0 - img_cell: - - display: inline - icon: - - width: 100% - custom_fields: - warning: - - display: | - [[[ - return states['{{ problems_entity_id }}'].attributes['{{ switch.problem_key }}'] == "False" - ? 'block' - : 'none'; - ]]] - - position: absolute - - top: -2px - - right: -2px - - width: 10px - - height: 10px - - border-radius: 50% - - background-color: var(--error-color) -{% endfor %} - -{% for sensor in sensors | default([]) %} - - type: custom:container-element - style: - margin-left: 10px - display: flex - flex-direction: column - align-items: center - "--mdc-icon-size": 28px - elements: - - type: state-icon - entity: {{ sensor.entity_id }} - title: {{ sensor.name }} - tap_action: - action: more-info - style: - margin: -6px - - type: state-label - entity: {{ sensor.entity_id }} - title: {{ sensor.name }} - tap_action: - action: more-info - style: - margin: -8px -{% endfor %} diff --git a/dashboards/views/terrariums.yaml b/dashboards/views/terrariums.yaml index 9397cde1..2c78a758 100644 --- a/dashboards/views/terrariums.yaml +++ b/dashboards/views/terrariums.yaml @@ -1,97 +1,63 @@ -- !template - file: ../cards/terrarium.yaml.j2 - variables: - image: /local/animals/carl_card.jpg - problems_entity_id: binary_sensor.carl_requires_attention - switches: - - entity_id: input_boolean.carl_scheduled_lights - name: Scheduling - lock: true - - entity_id: switch.carl_power_strip - name: Master - has_power_metrics: true - lock: true - - entity_id: switch.carl_outlet_5 - name: Controller - has_power_metrics: true - lock: true - - entity_id: switch.carl_uv_light - name: UV light - problem_key: uv_light - has_power_metrics: true - show_in_footer: true - - entity_id: switch.carl_heater - name: Heater - problem_key: heater - has_power_metrics: true - show_in_footer: true - - entity_id: switch.carl_heat_bulb - name: Heat bulb - problem_key: heat_bulb - has_power_metrics: true - show_in_footer: true - - entity_id: switch.carl_outlet_4 - name: Mister - problem_key: mister - has_power_metrics: true - show_in_footer: true - sensors: - - entity_id: sensor.carl_temperature - name: Temperature - - entity_id: sensor.carl_basking_temperature - name: Basking temperature - - entity_id: sensor.carl_humidity - name: Humidity - settings: - - entity_id: input_datetime.carl_day_time - name: Day starts at - - entity_id: input_datetime.carl_night_time - name: Night starts at +- type: custom:terrarium-card + area: carl_s_terrarium + problems: binary_sensor.carl_requires_attention + controls: + - entity: input_boolean.carl_scheduled_lights + name: Scheduling + - entity: switch.carl_power_strip + name: Master + - entity: switch.carl_uv_light + name: UV light + footer: true + - entity: switch.carl_heater + name: Heater + footer: true + - entity: switch.carl_outlet_3 + name: Outlet 3 + settings: + - entity: input_datetime.carl_day_time + name: Day starts at + - entity: input_datetime.carl_night_time + name: Night starts at -- !template - file: ../cards/terrarium.yaml.j2 - variables: - image: /local/animals/slinky_card.jpg - problems_entity_id: binary_sensor.slinky_requires_attention - switches: - - entity_id: input_boolean.slinky_scheduled_lights - name: Scheduling - lock: true - - entity_id: switch.slinky_power_strip - name: Master - has_power_metrics: true - lock: true - - entity_id: switch.slinky_outlet_5 - name: Controller - has_power_metrics: true - lock: true - - entity_id: switch.slinky_uv_light - name: UV light - problem_key: uv_light - has_power_metrics: true - show_in_footer: true - - entity_id: switch.slinky_heater - name: Heater - problem_key: heater - has_power_metrics: true - show_in_footer: true - - entity_id: switch.slinky_heat_bulb - name: Heat bulb - problem_key: heat_bulb - has_power_metrics: true - show_in_footer: true - - entity_id: switch.slinky_outlet_4 - name: Outlet 4 - has_power_metrics: true - sensors: - - entity_id: sensor.slinky_temperature - name: Temperature - - entity_id: sensor.slinky_basking_temperature - name: Basking temperature - - entity_id: sensor.slinky_humidity - name: Humidity - settings: - - entity_id: input_datetime.slinky_day_time - name: Day starts at - - entity_id: input_datetime.slinky_night_time - name: Night starts at +- type: custom:terrarium-card + area: slinky_s_terrarium + problems: binary_sensor.lydia_requires_attention + controls: + - entity: input_boolean.lydia_scheduled_lights + name: Scheduling + - entity: switch.lydia_power_strip + energy_entity: sensor.lydia_power_strip_energy + power_entity: sensor.lydia_power_strip_power + name: Master + - entity: switch.lydia_uv_light + energy_entity: sensor.lydia_uv_light_energy + power_entity: sensor.lydia_uv_light_power + name: UV light + problem_key: uv_light + footer: true + - entity: switch.lydia_heater + energy_entity: sensor.lydia_heater_energy + power_entity: sensor.lydia_heater_power + name: Heater + problem_key: heater + footer: true + - entity: switch.lydia_heat_bulb + energy_entity: sensor.lydia_heat_bulb_energy + power_entity: sensor.lydia_heat_bulb_power + name: Heat bulb + problem_key: heat_bulb + footer: true + - entity: switch.lydia_outlet_4 + energy_entity: sensor.lydia_outlet_4_energy + power_entity: sensor.lydia_outlet_4_power + name: Outlet 4 + - entity: switch.lydia_outlet_5 + energy_entity: sensor.lydia_outlet_5_energy + power_entity: sensor.lydia_outlet_5_power + name: Outlet 5 + settings: + - entity: input_datetime.lydia_day_time + name: Day starts at + - entity: input_datetime.lydia_night_time + name: Night starts at diff --git a/packages/core/history.yaml b/packages/core/history.yaml index 95dd552b..47a14b42 100644 --- a/packages/core/history.yaml +++ b/packages/core/history.yaml @@ -41,7 +41,6 @@ recorder: - "binary_sensor.basement_bathroom_motion" - "binary_sensor.basement_bathroom_presence" - "binary_sensor.carbon_monoxide_detected" - - "binary_sensor.carl_power_strip_overload" - "binary_sensor.carl_requires_attention" - "binary_sensor.guest_bedroom_window" - "binary_sensor.guest_mode" @@ -61,8 +60,8 @@ recorder: - "binary_sensor.minecraft_server_status" - "binary_sensor.office_proxy_status" - "binary_sensor.presence_armed" - - "binary_sensor.slinky_power_strip_overload" - - "binary_sensor.slinky_requires_attention" + - "binary_sensor.lydia_power_strip_overload" + - "binary_sensor.lydia_requires_attention" - "binary_sensor.smoke_detected" - "binary_sensor.studio_window" - "binary_sensor.ups_online_status" @@ -84,15 +83,6 @@ recorder: - "sensor.bolt_ev_tire_pressure_left_rear" - "sensor.bolt_ev_tire_pressure_right_front" - "sensor.bolt_ev_tire_pressure_right_rear" - - "sensor.carl_basking_temperature" - - "sensor.carl_heat_bulb_power" - - "sensor.carl_heater_power" - - "sensor.carl_humidity" - - "sensor.carl_outlet_4_power" - - "sensor.carl_outlet_5_power" - - "sensor.carl_power_strip_power" - - "sensor.carl_temperature" - - "sensor.carl_uv_light_power" - "sensor.chris_pixel_6_wifi_connection" - "sensor.connected_clients" - "sensor.current_home_assistant_version" @@ -142,15 +132,12 @@ recorder: - "sensor.processor_temperature" - "sensor.processor_use" - "sensor.scheduled_climate_preset" - - "sensor.slinky_basking_temperature" - - "sensor.slinky_heat_bulb_power" - - "sensor.slinky_heater_power" - - "sensor.slinky_humidity" - - "sensor.slinky_outlet_4_power" - - "sensor.slinky_outlet_5_power" - - "sensor.slinky_power_strip_power" - - "sensor.slinky_temperature" - - "sensor.slinky_uv_light_power" + - "sensor.lydia_heat_bulb_power" + - "sensor.lydia_heater_power" + - "sensor.lydia_outlet_4_power" + - "sensor.lydia_outlet_5_power" + - "sensor.lydia_power_strip_power" + - "sensor.lydia_uv_light_power" - "sensor.studio_temperature" - "sensor.studio_thermostat_temperature" - "sensor.ups_battery_status" diff --git a/packages/core/zwave.yaml b/packages/core/zwave.yaml index 2a7dab4c..6b8cae99 100644 --- a/packages/core/zwave.yaml +++ b/packages/core/zwave.yaml @@ -22,7 +22,6 @@ group: - "sensor.basement_hallway_thermostat_node_status" - "sensor.basement_smoke_co_detector_node_status" - "sensor.bookshelf_light_switch_node_status" - - "sensor.carl_power_strip_node_status" - "sensor.dining_room_light_dimmer_node_status" - "sensor.dining_room_thermostat_node_status" - "sensor.downstairs_light_switch_node_status" @@ -62,7 +61,7 @@ group: - "sensor.shed_light_switch_node_status" - "sensor.shed_outdoor_light_switch_node_status" - "sensor.side_porch_sconce_dimmer_node_status" - - "sensor.slinky_power_strip_node_status" + - "sensor.lydia_power_strip_node_status" - "sensor.staircase_dimmer_node_status" - "sensor.studio_dimmer_node_status" - "sensor.studio_thermostat_node_status" diff --git a/packages/livings/aunt_lydia.yaml b/packages/livings/aunt_lydia.yaml new file mode 100644 index 00000000..e57359e7 --- /dev/null +++ b/packages/livings/aunt_lydia.yaml @@ -0,0 +1,106 @@ +homeassistant: + customize: + binary_sensor.lydia_requires_attention: + friendly_name: "Lydia requires attention" + switch.lydia_heat_bulb: + icon: "mdi:spotlight-beam" + switch.lydia_heater: + icon: "mdi:radiator" + switch.lydia_uv_light: + icon: "mdi:weather-sunny" + +input_boolean: + lydia_scheduled_lights: + name: "Automate Lydia's terrarium" + icon: "mdi:home-automation" + +input_datetime: + lydia_day_time: + name: Time at which Lydia's terrarium lights turn on + has_date: false + has_time: true + lydia_night_time: + name: Time at which Lydia's terrarium lights turn off + has_date: false + has_time: true + +template: + - binary_sensor: + - unique_id: "cca4e02a-aadf-42f1-93d6-468e78d44877" + name: "lydia_requires_attention" + device_class: "problem" + picture: "/local/animals/slinky_avatar.jpg" + attributes: + scheduling: "{{ is_state('input_boolean.lydia_scheduled_lights', 'on') }}" + heat_bulb: "{{ is_state('switch.lydia_heat_bulb', 'off') or states('sensor.lydia_heat_bulb_power') | float(0) > 1 }}" + heater: "{{ is_state('switch.lydia_heater', 'off') or states('sensor.lydia_heater_power') | float(0) > 1 }}" + uv_light: "{{ is_state('switch.lydia_uv_light', 'off') or states('sensor.lydia_uv_light_power') | float(0) > 1 }}" + state: >- + {{ not this.attributes.scheduling | default(True) + or not this.attributes.heat_bulb | default(True) + or not this.attributes.heater | default(True) + or not this.attributes.uv_light | default(True) + }} + +automation: + - id: "ca115276-80d4-4a82-bd6e-b575f6483b64" + alias: lydia_scheduling + use_blueprint: + path: "terrarium_scheduling.yaml" + input: + scheduling_entity: "input_boolean.lydia_scheduled_lights" + day_time_entity: "input_datetime.lydia_day_time" + night_time_entity: "input_datetime.lydia_night_time" + heat_bulb_switch: "switch.lydia_heat_bulb" + heater_switch: "switch.lydia_heater" + uv_light_switch: "switch.lydia_uv_light" + + - id: "bb248f37-e829-45dc-99f3-f21bf86dea5c" + alias: lydia_uv_monitoring + use_blueprint: + path: "device_stopped_consuming.yaml" + input: + delay: &power_delay 310 # Wattage report rate is 5 minutes + entity_id: "switch.lydia_uv_light" + power_sensor: "sensor.lydia_uv_light_power" + action: + - action: python_script.notify + data: + <<: &power_notification_data + audio: true + persistent: true + push_target: "household" + title: "Check Aunt Lydia" + url: "/lovelace/livings" + tag: "lydia_uv_monitoring" + message: "Aunt Lydia's UV light has burned out." + + - id: "99bb793a-f44c-4f8a-99e4-079c59056d51" + alias: lydia_heat_bulb_monitoring + use_blueprint: + path: "device_stopped_consuming.yaml" + input: + delay: *power_delay + entity_id: "switch.lydia_heat_bulb" + power_sensor: "sensor.lydia_heat_bulb_power" + action: + - action: python_script.notify + data: + <<: *power_notification_data + tag: "lydia_heat_bulb_monitoring" + message: "Aunt Lydia's heat bulb has burned out." + + - id: "97c82da0-9eed-462c-a2d5-46da5209ffb3" + alias: lydia_heater_monitoring + use_blueprint: + path: "device_stopped_consuming.yaml" + input: + delay: *power_delay + entity_id: "switch.lydia_heater" + power_sensor: "sensor.lydia_heater_power" + action: + - action: python_script.notify + data: + <<: *power_notification_data + tag: "lydia_heater_monitoring" + message: "Aunt Lydia's ceramic heater has burned out." diff --git a/packages/livings/carl.yaml b/packages/livings/carl.yaml index d2e43a4d..25610de3 100644 --- a/packages/livings/carl.yaml +++ b/packages/livings/carl.yaml @@ -2,22 +2,10 @@ homeassistant: customize: binary_sensor.carl_requires_attention: friendly_name: "Carl requires attention" - sensor.carl_basking_temperature: - friendly_name: "Carl's basking spot temperature" - sensor.carl_temperature: - friendly_name: "Carl's terrarium temperature" - sensor.carl_humidity: - friendly_name: "Carl's terrarium humidity" - switch.carl_heat_bulb: - icon: "mdi:spotlight-beam" switch.carl_heater: icon: "mdi:radiator" switch.carl_uv_light: icon: "mdi:weather-sunny" - switch.carl_outlet_4: - icon: "mdi:weather-fog" - switch.carl_outlet_5: - icon: "mdi:chip" input_boolean: carl_scheduled_lights: @@ -42,34 +30,11 @@ template: picture: "/local/animals/carl_avatar.jpg" attributes: scheduling: "{{ is_state('input_boolean.carl_scheduled_lights', 'on') }}" - heat_bulb: "{{ is_state('switch.carl_heat_bulb', 'off') or states('sensor.carl_heat_bulb_power') | float(0) > 1 }}" - heater: "{{ is_state('switch.carl_heater', 'off') or states('sensor.carl_heater_power') | float(0) > 1 }}" - uv_light: "{{ is_state('switch.carl_uv_light', 'off') or states('sensor.carl_uv_light_power') | float(0) > 1 }}" state: >- {{ not this.attributes.scheduling | default(True) - or not this.attributes.heat_bulb | default(True) - or not this.attributes.heater | default(True) - or not this.attributes.uv_light | default(True) }} - sensor: # Fake sensors until everything is ready - - unique_id: "sensor.carl_basking_temperature" - name: "carl_basking_temperature" - device_class: "temperature" - unit_of_measurement: "°C" - state: "0.0" - - unique_id: "sensor.carl_temperature" - name: "carl_temperature" - device_class: "temperature" - unit_of_measurement: "°C" - state: "0.0" - - unique_id: "sensor.carl_humidity" - name: "carl_humidity" - device_class: "humidity" - unit_of_measurement: "%" - state: "0.0" - automation: - id: "b61cbb0c-2aa9-4094-959e-a5eb20037f52" alias: carl_scheduling @@ -79,58 +44,5 @@ automation: scheduling_entity: "input_boolean.carl_scheduled_lights" day_time_entity: "input_datetime.carl_day_time" night_time_entity: "input_datetime.carl_night_time" - heat_bulb_switch: "switch.carl_heat_bulb" heater_switch: "switch.carl_heater" uv_light_switch: "switch.carl_uv_light" - - - id: "c43cd149-6639-4204-9c02-700970076d35" - alias: carl_uv_burned_out - use_blueprint: - path: "device_stopped_consuming.yaml" - input: - delay: &power_delay 310 # Wattage report rate is 5 minutes - entity_id: "switch.carl_uv_light" - power_sensor: "sensor.carl_uv_light_power" - action: - - action: python_script.notify - data: - <<: &power_notification_data - audio: true - persistent: true - push_target: "household" - url: "/lovelace/livings" - tag: "carl_uv_burned_out" - title: "Check Carl's UV Light" - message: "It appears that Carl's UV light has burned out." - - - id: "4769e5aa-adfe-4c64-a411-e9e219386dae" - alias: carl_heat_bulb_burned_out - use_blueprint: - path: "device_stopped_consuming.yaml" - input: - delay: *power_delay - entity_id: "switch.carl_heat_bulb" - power_sensor: "sensor.carl_heat_bulb_power" - action: - - action: python_script.notify - data: - <<: *power_notification_data - tag: "carl_heat_bulb_burned_out" - title: "Check Carl's Heat Bulb" - message: "It appears that Carl's heat bulb has burned out." - - - id: "f033f9a3-9d6c-4bd8-8392-fbf2eeb33e9c" - alias: carl_heater_burned_out - use_blueprint: - path: "device_stopped_consuming.yaml" - input: - delay: *power_delay - entity_id: "switch.carl_heater" - power_sensor: "sensor.carl_heater_power" - action: - - action: python_script.notify - data: - <<: *power_notification_data - tag: "carl_heater_burned_out" - title: "Check Carl's Ceramic Heater" - message: "It appears that Carl's ceramic heater has burned out." diff --git a/packages/livings/slinky.yaml b/packages/livings/slinky.yaml deleted file mode 100644 index d6f4e3f0..00000000 --- a/packages/livings/slinky.yaml +++ /dev/null @@ -1,135 +0,0 @@ -homeassistant: - customize: - binary_sensor.slinky_requires_attention: - friendly_name: "Slinky requires attention" - sensor.slinky_basking_temperature: - friendly_name: "Slinky's basking spot temperature" - sensor.slinky_temperature: - friendly_name: "Slinky's terrarium temperature" - sensor.slinky_humidity: - friendly_name: "Slinky's terrarium humidity" - switch.slinky_heat_bulb: - icon: "mdi:spotlight-beam" - switch.slinky_heater: - icon: "mdi:radiator" - switch.slinky_uv_light: - icon: "mdi:weather-sunny" - switch.slinky_outlet_4: - icon: "mdi:power-socket-us" - switch.slinky_outlet_5: - icon: "mdi:chip" - -input_boolean: - slinky_scheduled_lights: - name: "Automate Slinky's terrarium" - icon: "mdi:home-automation" - -input_datetime: - slinky_day_time: - name: Time at which Slinky's terrarium lights turn on - has_date: false - has_time: true - slinky_night_time: - name: Time at which Slinky's terrarium lights turn off - has_date: false - has_time: true - -template: - - binary_sensor: - - unique_id: "binary_sensor.slinky_requires_attention" - name: "slinky_requires_attention" - device_class: "problem" - picture: "/local/animals/slinky_avatar.jpg" - attributes: - scheduling: "{{ is_state('input_boolean.slinky_scheduled_lights', 'on') }}" - heat_bulb: "{{ is_state('switch.slinky_heat_bulb', 'off') or states('sensor.slinky_heat_bulb_power') | float(0) > 1 }}" - heater: "{{ is_state('switch.slinky_heater', 'off') or states('sensor.slinky_heater_power') | float(0) > 1 }}" - uv_light: "{{ is_state('switch.slinky_uv_light', 'off') or states('sensor.slinky_uv_light_power') | float(0) > 1 }}" - state: >- - {{ not this.attributes.scheduling | default(True) - or not this.attributes.heat_bulb | default(True) - or not this.attributes.heater | default(True) - or not this.attributes.uv_light | default(True) - }} - - sensor: # Fake sensors until everything is ready - - unique_id: "sensor.slinky_basking_temperature" - name: "slinky_basking_temperature" - device_class: "temperature" - unit_of_measurement: "°C" - state: "0.0" - - unique_id: "sensor.slinky_temperature" - name: "slinky_temperature" - device_class: "temperature" - unit_of_measurement: "°C" - state: "0.0" - - unique_id: "sensor.slinky_humidity" - name: "slinky_humidity" - device_class: "humidity" - unit_of_measurement: "%" - state: "0.0" - -automation: - - id: "ca115276-80d4-4a82-bd6e-b575f6483b64" - alias: slinky_scheduling - use_blueprint: - path: "terrarium_scheduling.yaml" - input: - scheduling_entity: "input_boolean.slinky_scheduled_lights" - day_time_entity: "input_datetime.slinky_day_time" - night_time_entity: "input_datetime.slinky_night_time" - heat_bulb_switch: "switch.slinky_heat_bulb" - heater_switch: "switch.slinky_heater" - uv_light_switch: "switch.slinky_uv_light" - - - id: "bb248f37-e829-45dc-99f3-f21bf86dea5c" - alias: slinky_uv_burned_out - use_blueprint: - path: "device_stopped_consuming.yaml" - input: - delay: &power_delay 310 # Wattage report rate is 5 minutes - entity_id: "switch.slinky_uv_light" - power_sensor: "sensor.slinky_uv_light_power" - action: - - action: python_script.notify - data: - <<: &power_notification_data - audio: true - persistent: true - push_target: "household" - url: "/lovelace/livings" - tag: "slinky_uv_burned_out" - title: "Check Slinky's UV Light" - message: "It appears that Slinky's UV light has burned out." - - - id: "99bb793a-f44c-4f8a-99e4-079c59056d51" - alias: slinky_heat_bulb_burned_out - use_blueprint: - path: "device_stopped_consuming.yaml" - input: - delay: *power_delay - entity_id: "switch.slinky_heat_bulb" - power_sensor: "sensor.slinky_heat_bulb_power" - action: - - action: python_script.notify - data: - <<: *power_notification_data - tag: "slinky_heat_bulb_burned_out" - title: "Check Slinky's Heat Bulb" - message: "It appears that Slinky's heat bulb has burned out." - - - id: "97c82da0-9eed-462c-a2d5-46da5209ffb3" - alias: slinky_heater_burned_out - use_blueprint: - path: "device_stopped_consuming.yaml" - input: - delay: *power_delay - entity_id: "switch.slinky_heater" - power_sensor: "sensor.slinky_heater_power" - action: - - action: python_script.notify - data: - <<: *power_notification_data - tag: "slinky_heater_burned_out" - title: "Check Slinky's Ceramic Heater" - message: "It appears that Slinky's ceramic heater has burned out."