Skip to content

Instantly share code, notes, and snippets.

@MRezaNasirloo
Last active July 22, 2023 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MRezaNasirloo/d6eb0c32eea596266b4932d253f5fcdb to your computer and use it in GitHub Desktop.
Save MRezaNasirloo/d6eb0c32eea596266b4932d253f5fcdb to your computer and use it in GitHub Desktop.
blueprint:
name: IKEA Tradfri Switch Control with Dimming
description: Control IKEA Tradfri Switch (Square with 1/0 buttons) using zigbee2mqtt with dimming functionality.
domain: automation
input:
tradfri_switch_entity:
name: IKEA Tradfri Switch
description: The entity ID of the Tradfri Switch in Home Assistant.
selector:
entity:
domain: sensor
dim_step:
name: Dimming Step
description: The percentage step to dim the light when the switch is held (e.g., 10, 5, 2).
default: 5
dim_delay:
name: Dimming Delay
description: The delay in seconds between dimming steps when the switch is held.
default: 0.5
light_entity:
name: Light Entity
description: The entity ID of the light to control.
selector:
entity:
domain: light
variables:
switch_state: 'off'
dimming_active: false
trigger:
platform: state
entity_id: !input tradfri_switch_entity
action:
# Rest of the blueprint remains unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment