Skip to content

Petro31/ad_toggle_light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Home Assistant Light Toggle Automation for Appdaemon

hacs_badge
Buy Me A Coffee

Toggle Light Automation app for AppDaemon.

Simply toggles a light based on another light. You can set the light service data.

Installation

Download the toggle_light directory from inside the apps directory to your local apps directory, then add the configuration to enable the hacs module.

Example App configuration

Simple switch

office_toggle:
  module: toggle_light
  class: ToggleLight
  entity: switch.office_switch
  entities:
    - switch.office_outlet

Turn on light when TV turns on, only at night.

tv_toggle:
  module: toggle_light
  class: ToggleLight
  entity: remote.tv
  turn_off: false
  sundown: true
  entities:
    - light.living_room

Advanced

office_toggle
  module: toggle_light
  class: ToggleLight
  entity: switch.office_switch
  entities:
  - switch.office_outlet
  - entity: light.office_lamp
    service_data:
      brightness: 100
      kelvin: 2700
  - entity: light.office_mood
    service_data:
      brightness: 130
      rgb_color: [255,0,0]
  log_level: INFO

App Configuration

key optional type default description
module False string toggle_light The module name of the app.
class False string ToggleLight The name of the Class.
entity False string entity_id of light/switch/sensor etc.
entities False list A list of entity_id's or entity objects.
turn_on False bool true enables/disables the turn_on command when entity is toggled.
turn_off False bool true enables/disables the turn_off command when entity is toggled.
sundown False bool false only allows the toggle to occur when the sun is down.
log_level True 'INFO' | 'DEBUG' 'INFO' Switches log level.

Entity Object Configuration

key optional type default description
entity False string The entity_id of the switch or light.
service_data True map Turn on service data. Whenever the door turns on a light or switch, this data will be passed to the service data. Warning: Use only valid combinations. Light combinations are not validated and can cause errors in Home Assistant.