#------------------------------------------- # @CCOSTAN # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig # HASS.Agent Home PC - Office lamp follows CARLO-HOMEPC session state. #------------------------------------------- ###################################################################### ## Locks/monitors PC activity via HASS.Agent; Sleep Number triggers live 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