mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-12-03 03:21:47 +00:00
Add PC lock/unlock automation and update README with new configuration details for HASS.Agent integration #Closes #160
This commit is contained in:
35
config/packages/hass_agent_homepc.yaml
Normal file
35
config/packages/hass_agent_homepc.yaml
Normal 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
|
||||
Reference in New Issue
Block a user