I wanted to be able to customize every button press and option myself. Most of the buttons will do just like youâd expect, to improve WAF (wife approval factor). But, I also wanted the option to have a âhidden featureâ or something like that. For example, off long press will trigger my home security alarm. This way if my wife wants to carry the remote around to make her feel more safe she can trigger the alarm like a panic button.
blueprint:
name: 'Sengled Smart Light Switch (Model: E1E-G7F) ZHA'
author: noblewolf
homeassistant:
min_version: 2021.2.1
description: Use your Sengled E1E-G7F four button zigbee remote on ZHA.
domain: automation
input:
remote:
name: Sengled Smart Light Switch
description: 'Sengled Smart Light Switch (Model: E1E-G7F)'
selector:
device:
integration: zha
manufacturer: sengled
model: E1E-G7F
on_short_press:
name: On Button Short Press
description: 'Actions to run when you do a short press of the "on" button.'
default: []
selector:
action: {}
on_long_press:
name: On Button Long Press
description: 'Actions to run when you do a press and hold the "on" button.'
default: []
selector:
action: {}
on_double_press:
name: On Button Double Press
description: 'Actions to run when you do a quick double press of the "on" button.'
default: []
selector:
action: {}
off_short_press:
name: Off Button Short Press
description: 'Actions to run when you do a short press of the "off" button.'
default: []
selector:
action: {}
off_long_press:
name: Off Button Long Press
description: 'Actions to run when you do a press and hold the "off" button.'
default: []
selector:
action: {}
off_double_press:
name: Off Button Double Press
description: 'Actions to run when you do a quick double press of the "off" button.'
default: []
selector:
action: {}
up_short_press:
name: Up Button Short Press
description: 'Actions to run when you do a short press of the "up" or "brighten" button.'
default: []
selector:
action: {}
up_long_press:
name: Up Button Long Press
description: 'Actions to run when you do a long press of the "up" or "brighten" button. When you press and hold the remote always sends a single press then the following will be "long" press until you release. This could be used to increment in larger steps.'
default: []
selector:
action: {}
down_short_press:
name: Down Button Short Press
description: 'Actions to run when you do a short press of the "down" or "dim" button.'
default: []
selector:
action: {}
down_long_press:
name: Down Button Long Press
description: 'Actions to run when you do a long press of the "down" or "dim" button. When you press and hold the remote always sends a single press then the following will be "long" press until you release. This could be used to increment in larger steps.'
default: []
selector:
action: {}
mode: parallel
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
action:
- variables:
command: '{{ trigger.event.data.command }}'
value: '{{ trigger.event.data.args }}'
- choose:
- conditions:
- '{{ command == ''on'' }}'
sequence: !input 'on_short_press'
- conditions:
- '{{ command == ''on_double'' }}'
sequence: !input 'on_double_press'
- conditions:
- '{{ command == ''on_long'' }}'
sequence: !input 'on_long_press'
- conditions:
- '{{ command == ''off'' }}'
sequence: !input 'off_short_press'
- conditions:
- '{{ command == ''off_double'' }}'
sequence: !input 'off_double_press'
- conditions:
- '{{ command == ''off_long'' }}'
sequence: !input 'off_long_press'
- conditions:
- '{{ command == ''step'' and value == [0,1,0] }}'
sequence: !input 'up_short_press'
- conditions:
- '{{ command == ''step'' and value == [0,2,0] }}'
sequence: !input 'up_long_press'
- conditions:
- '{{ command == ''step'' and value == [1,1,0] }}'
sequence: !input 'down_short_press'
- conditions:
- '{{ command == ''step'' and value == [1,2,0] }}'
sequence: !input 'down_long_press'
Actions that I use for this Blueprint
See the first comment. I couldnât put a second set of âcodeâ in the postâs body here otherwise the blueprint wouldnât properly import.
Changelog
2021, Mar 3
Added My Home Assistant import link
2021, Feb 4 #2
Initial commit was a rewrite I was testing and wasnât ready. Iâve replace with the real final blueprint.
To use my actions⌠After you create the blueprint, chose your remote then save the automation. After that, click the Automation menu button in the top-right and choose âEdit with YAMLâ, paste the below, then you can switch back to âEdit with UIâ.
Paste this below âremoteâ after you create the automation from the blueprint:
Notice for the brighten and dim actions that I use âbrightness_stepâ instead of âbrightness_step_pctâ because âbrightness_stepâ seems to be quicker.
One note, though: Since the Up and Down buttons are intended for dimming, they always send one command immediately, and then if you keep holding them, they send a similar command with different arguments, and they continue sending the second command again every second or so until you release them. That means you may get some unexpected results with this Blueprint for those buttons if you are using short and long presses to do different things. Itâs not possible to trigger the long press without also triggering a short press first, and the long press action will trigger repeatedly if you keep holding down the button. That only applies to the Up and Down buttons, though. On and Off work as expected.
After updating to the latest HA im getting this error with the 4 button switches:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/bellows/ezsp/__init__.py", line 297, in handle_callback
handler(*args)
File "/usr/local/lib/python3.8/site-packages/bellows/zigbee/application.py", line 219, in ezsp_callback_handler
self._handle_frame(*args)
File "/usr/local/lib/python3.8/site-packages/bellows/zigbee/application.py", line 264, in _handle_frame
self.handle_message(
File "/usr/local/lib/python3.8/site-packages/zigpy/application.py", line 223, in handle_message
return sender.handle_message(
File "/usr/local/lib/python3.8/site-packages/zigpy/device.py", line 279, in handle_message
return endpoint.handle_message(
File "/usr/local/lib/python3.8/site-packages/zigpy/endpoint.py", line 217, in handle_message
handler(hdr, args, dst_addressing=dst_addressing)
File "/usr/local/lib/python3.8/site-packages/zigpy/zcl/__init__.py", line 201, in handle_message
self.handle_cluster_request(hdr, args, dst_addressing=dst_addressing)
TypeError: handle_cluster_request() got an unexpected keyword argument 'dst_addressing'
could you point me in the right direction on this please?
It worked perfectly before.
there are still errors in the Log about the blueprint generating invalid yaml, but that only happens on creation of automation.
The actual automation works great!
Is the delay common on the Remotes? My Remote take more than 10 to 15 seconds to be able to connect back to HA, it is a pain. Is there any work around? Also sometimes it never connects and just go into pairing mode and drain the whole battery in just a couple of hours. Thanks for the blueprint is awesome
Yea, unfortunately, this is a recognized issue with the Sengled E1E-G7F hardware and isnât due to the ZHA integration or blueprint. My guess is because it allows a push-and-hold and double-tap the delay is how Sengled figures out if youâre doing a single or double-prep. I donât have a Hue switch, but Iâve read they operate much faster.
Hi @Fullauto2009 . 2 things to check. #1 do you have the same model of remote? Check the picture in the first post and the model number. #2 Are you using the Zigbee Home Automation - Home Assistant or another ZigBee integration, like Zigbee2mqtt?
This Blueprint only works with that combo.
If youâre using both please reply with a screenshot of the blueprint and weâll see what we can do.
Thatâs so odd. I just checked and mine is working.
Something you could try is go into the blueprint and modify/remove the selector qualifications. I added the model number and vendor to make sure it only worked with this remote.
Go into the âFile Editorâ then find this file: /config/blueprints/automation/Noblewolf/sengled_faster.yaml
Then remove line 13, and/or line 12, save the file, then reload automations/blueprints. Let me know if removing lines 12/13 worksâŚ