/GoodnightT

Appdaemon script for Home-Assistant to dim light until it is off in X minutes.

Primary LanguagePythonMIT LicenseMIT

hacs_badge

Description

This App will dim your lights for X minutes until it's finally off.

Requirements

You need an Xiaomi Mijia Smart Switch. I think it will work with others too as long as they have two different event codes and the event comes via deconz.

Device Events

Action Code Description
SINGLE_CLICK 1002 start diming
DOUBLE_CLICK 1004 stop diming

Configuration

This is an example for your apps.yaml following entries are possible:

  • module (required)
  • class (required)
  • light_ids (required) - comma separated if you which more lights to be controlled
  • switch_id (required)
  • switch_single_click_event_code (optional) - single click event code
  • switch_double_click_event_code (optional) - double click event code
  • durationInSeconds (optional) - default are 120 seconds
  • start_birghtness (optional) - an integer which can go from 0 to 254. While 0 means off and 254 means maximum
goodnightt:
  module: Goodnight
  class: Goodnight
  light_ids: light.osramlightbedroom,light.osramlightstrip02
  switch_id: round02
  switch_single_click_event_code: 1002
  switch_double_click_event_code: 1004
  durationInSeconds: 600 # 10 min (default 120 - 2min)
  start_brightness: 254