Created
September 1, 2026 16:40
-
-
Save CrazyCoder/42f95292486a604982400f9972c12b3b to your computer and use it in GitHub Desktop.
Sengled light switch (Zigbee2MQTT) - Home Assistant blueprint for the Sengled E1E-G7F smart light switch / dimmer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: Sengled light switch (Zigbee2MQTT) | |
| description: 'Control anything using Sengled E1E-G7F smart light switch / dimmer. | |
| Customizable actions for each press. | |
| Supported actions: on, on_double, on_long, up, up_long, down, down_long, off, off_double, off_long. | |
| Note: up/down actions always trigger before up_long/down_long. This is not the case for on/off actions. | |
| ' | |
| domain: automation | |
| input: | |
| controller_device: | |
| name: Sengled Light Switch | |
| description: Select the Sengled E1E-G7F smart light switch device | |
| selector: | |
| device: | |
| filter: | |
| - integration: mqtt | |
| manufacturer: Sengled | |
| model: Smart switch | |
| automation_mode: | |
| name: Automation mode | |
| description: >- | |
| Leave this alone unless an action in this automation runs for longer | |
| than about a second. The device sends several events for one gesture, | |
| about a second apart, and with 'restart' a later event cancels the | |
| action that an earlier event started. A long action belongs in a script | |
| that you call with 'script.turn_on', which no mode can interrupt. | |
| default: queued | |
| selector: | |
| select: | |
| mode: dropdown | |
| options: | |
| - single | |
| - restart | |
| - queued | |
| - parallel | |
| on_press: | |
| name: On press | |
| description: Action to run | |
| default: [] | |
| selector: | |
| action: {} | |
| on_double_press: | |
| name: On double press | |
| description: Action to run | |
| default: [] | |
| selector: | |
| action: {} | |
| on_long_press: | |
| name: On long press | |
| description: Action to run | |
| default: [] | |
| selector: | |
| action: {} | |
| up_press: | |
| name: Up press | |
| description: Action to run | |
| default: [] | |
| selector: | |
| action: {} | |
| up_long_press: | |
| name: Up long press | |
| description: Action to run | |
| default: [] | |
| selector: | |
| action: {} | |
| down_press: | |
| name: Down press | |
| description: Action to run | |
| default: [] | |
| selector: | |
| action: {} | |
| down_long_press: | |
| name: Down long press | |
| description: Action to run | |
| default: [] | |
| selector: | |
| action: {} | |
| off_press: | |
| name: Off press | |
| description: Action to run | |
| default: [] | |
| selector: | |
| action: {} | |
| off_double_press: | |
| name: Off double press | |
| description: Action to run | |
| default: [] | |
| selector: | |
| action: {} | |
| off_long_press: | |
| name: Off long press | |
| description: Action to run | |
| default: [] | |
| selector: | |
| action: {} | |
| source_url: https://gist.github.com/CrazyCoder/42f95292486a604982400f9972c12b3b | |
| mode: !input automation_mode | |
| max_exceeded: silent | |
| trigger: | |
| - trigger: device | |
| id: 'on' | |
| domain: mqtt | |
| device_id: !input controller_device | |
| type: action | |
| subtype: 'on' | |
| - trigger: device | |
| id: on_double | |
| domain: mqtt | |
| device_id: !input controller_device | |
| type: action | |
| subtype: on_double | |
| - trigger: device | |
| id: on_long | |
| domain: mqtt | |
| device_id: !input controller_device | |
| type: action | |
| subtype: on_long | |
| - trigger: device | |
| id: up | |
| domain: mqtt | |
| device_id: !input controller_device | |
| type: action | |
| subtype: up | |
| - trigger: device | |
| id: up_long | |
| domain: mqtt | |
| device_id: !input controller_device | |
| type: action | |
| subtype: up_long | |
| - trigger: device | |
| id: down | |
| domain: mqtt | |
| device_id: !input controller_device | |
| type: action | |
| subtype: down | |
| - trigger: device | |
| id: down_long | |
| domain: mqtt | |
| device_id: !input controller_device | |
| type: action | |
| subtype: down_long | |
| - trigger: device | |
| id: 'off' | |
| domain: mqtt | |
| device_id: !input controller_device | |
| type: action | |
| subtype: 'off' | |
| - trigger: device | |
| id: off_double | |
| domain: mqtt | |
| device_id: !input controller_device | |
| type: action | |
| subtype: off_double | |
| - trigger: device | |
| id: off_long | |
| domain: mqtt | |
| device_id: !input controller_device | |
| type: action | |
| subtype: off_long | |
| action: | |
| - choose: | |
| - conditions: | |
| - condition: trigger | |
| id: 'on' | |
| sequence: !input on_press | |
| - conditions: | |
| - condition: trigger | |
| id: on_double | |
| sequence: !input on_double_press | |
| - conditions: | |
| - condition: trigger | |
| id: on_long | |
| sequence: !input on_long_press | |
| - conditions: | |
| - condition: trigger | |
| id: up | |
| sequence: !input up_press | |
| - conditions: | |
| - condition: trigger | |
| id: up_long | |
| sequence: !input up_long_press | |
| - conditions: | |
| - condition: trigger | |
| id: down | |
| sequence: !input down_press | |
| - conditions: | |
| - condition: trigger | |
| id: down_long | |
| sequence: !input down_long_press | |
| - conditions: | |
| - condition: trigger | |
| id: 'off' | |
| sequence: !input off_press | |
| - conditions: | |
| - condition: trigger | |
| id: off_double | |
| sequence: !input off_double_press | |
| - conditions: | |
| - condition: trigger | |
| id: off_long | |
| sequence: !input off_long_press |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist is new. The blueprint file used to declare the Aqara wireless switch gist as its
source_url, which was a copy and paste error. Home Assistant fetchessource_urlwhen you press Re-import blueprint. A re-import would therefore have replaced this blueprint with the Aqara one, and broken every automation built on it. Thesource_urlnow points here.The blueprint also has a new
automation_modeinput. The default isqueued, which is what the blueprint used before, so an existing automation keeps its behaviour.Change it only if an action in one branch runs for longer than about a second. One gesture produces several events, and
upanddownalways arrive beforeup_longanddown_long. Withrestarta later event cancels the action that an earlier event started.For a long action, call a script with
action: script.turn_onand atarget:. Home Assistant runs it in its own task, outside the caller's cancellation scope, so no mode can cancel it.script.turn_offstill stops it when you want to abort.