Add PC lock/unlock automation and update README with new configuration details for HASS.Agent integration #Closes #160

This commit is contained in:
Carlo Costanzo
2025-11-24 11:22:21 -05:00
parent 8afd560b99
commit a36f1032ac
4 changed files with 53 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ Live collection of plug-and-play Home Assistant packages. Each YAML file in this
| [phynplus.yaml](phynplus.yaml) | Tie the Phyn Plus smart shutoff into HA notifications, automations, and valve overrides. | `valve.phyn_shutoff_valve`, `binary_sensor.phyn_leak_test_running`, `script.notify_engine_two_button` |
| [powerwall.yaml](powerwall.yaml) | Track Tesla Powerwall grid status and shed loads automatically when off-grid. | `binary_sensor.powerwall_grid_status`, `sensor.powerwall_*`, `script.notify_engine` |
| [vacuum.yaml](vacuum.yaml) | Dreame (ex-Neato) vacuum orchestration with maintenance reminders and reset helpers. | `sensor.l10s_vacuum_task_status`, `sensor.l10s_vacuum_sensor_dirty_left`, `button.l10s_vacuum_reset_sensor` |
| [hass_agent_homepc.yaml](hass_agent_homepc.yaml) | Mirrors PC lock/unlock state from HASS.Agent to the office lamp for instant desk presence cues. | `sensor.carlo_homepc_carlo_homepc_sessionstate`, `switch.office_lamp_switch` |
| [finance.yaml](finance.yaml) | Yahoo Finance sensor bundle for portfolio glances and Lovelace cards. | `sensor.tsla`, `sensor.aapl`, `sensor.amzn`, `sensor.msft` |
### Blog & video deep dives

View File

@@ -0,0 +1,35 @@
#-------------------------------------------
# Control the office lamp based on CARLO-HOMEPC session state via HASS.Agent.
# Sleep Number bed-triggered PC lock/monitor sleep lives in config/packages/sleepiq.yaml.
# Docs: https://hassagent.readthedocs.io/en/latest/
#-------------------------------------------
automation:
- alias: "Office Lamp - Follow CARLO-HOMEPC Session"
id: 7b3f9e14-55b1-44aa-a6eb-2e0873a4c2bb
mode: single
trigger:
- platform: state
entity_id: sensor.carlo_homepc_carlo_homepc_sessionstate
to: 'Locked'
id: locked
- platform: state
entity_id: sensor.carlo_homepc_carlo_homepc_sessionstate
to: 'Unlocked'
id: unlocked
action:
- choose:
- conditions:
- condition: trigger
id: locked
sequence:
- service: switch.turn_off
target:
entity_id: switch.office_lamp_switch
- conditions:
- condition: trigger
id: unlocked
sequence:
- service: switch.turn_on
target:
entity_id: switch.office_lamp_switch

View File

@@ -49,6 +49,19 @@ group:
- sensor.sleepnumber_carlo_stacey_sleepnumber
# - sensor.Stacey_sleep_hours
##############################################################################
### Automations - Detect when things are not right. Like any Good Watchdog.
##############################################################################
automation:
- alias: "CARLO-HOMEPC - Lock PC and Sleep Monitors When Carlo Is in Bed"
id: 25c69640-4c38-46a2-82ae-5a32c3c6f1b4
mode: single
trigger:
- platform: state
entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed
from: 'off'
to: 'on'
action:
- service: button.press
target:
entity_id: button.carlo_homepc_carlo_homepc_lock
- service: button.press
target:
entity_id: button.carlo_homepc_carlo_homepc_monitorsleep