ZHA - Ecosmart 4 button remote - control 3 devices/scenes/etc

Summary
This blueprint allows you to easily control multiple devices/scenes using an Ecosmart 4 button Remote from Home Depot.

This blueprint is influenced by @SteveHome’s Ecosmart 4 button Circadian Lighting blueprint.

Notes
The 4th (bottom) button is not able to be programmed. It sends multiple ZHA events, which frequently (but not always) will trigger whatever you have mapped to the third button as well as the unique event for the 4th button. I have spoken with @SteveHome about this and we both think it’s possible that it may be able to configure it to work using an input boolean, but we have not investigated this possibility as of yet. Help would be welcomed on this issue.

The blueprint is configured such that you can set up the 4th button, but be advised that it is not reliably functional. I chose to leave the configuration in so that the blueprint is easily modified if someone figures out how to make it work, or for the person who has a use case where triggering the third button may not be terrible (such as a turn on the ceiling lights AND lamps type of use scenario)

This blueprint is for the ZHA integration.

Potential further development
As mentioned above, the 4th button is not functional. The dilemma with it is as follows:

The 4th button frequently (but not always) sends 2 events: “move_to_level_with_on_off” which is unique to this button and “move_to_color_temp”, which is the same as the event triggered by the third button.

It always sends the “move_to_level_with_on_off” event, and sends the “move_to_color_temp” event most of the time (probably 3 out of 4 pushes).

This means it can’t do anything reliably, because it will generally, but not consistently also trigger whatever is bound to the 3rd button as well as it’s unique event.

It’s possible that this could be overcome with a virtual switch/input boolean, but I do not have enough experience to figure this out myself. I’d love community input to get it working.

Blueprint

blueprint:
  name: ZHA - Ecosmart 4 button remote - control 3 devices/scenes/etc
  description: Control devices with an Ecosmart 4-button Zigbee remote
  domain: automation
  input:
    device_ieee:
      name: Remote ID
      description: To find this, listen for zha_event in Developer Tools > Events, then press a button on your remote and identify the value of "device_ieee". It should look like "xx:xx:xx:xx:xx:xx:xx:xx"
    light_target_1:
      name: Button 1
      description: Select which light or light group you wish to control with button 1
      default: []
      selector:
        action: {}
    light_target_2:
      name: Button 2
      description: Select which light or light group you wish to control with button 2
      default: []
      selector:
        action: {}
    light_target_3:
      name: Button 3
      description: Select which light or light group you wish to control with button 3
      default: []
      selector:
        action: {}
    light_target_4:
      name: Button 4
      description: Select which light or light group you wish to control with button 4
      default: []
      selector:
        action: {}
mode: restart
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_ieee: !input device_ieee
condition: []
action:
- variables:
    command: '{{ trigger.event.data.command }}'
    args: '{{ trigger.event.data.args }}'
- choose:
  - conditions:
    - condition: or
      conditions:
      - condition: template
        value_template: '{{ command == ''on'' }}'
      - condition: template
        value_template: '{{ command == ''off'' }}'
    sequence: !input 'light_target_1'
  - conditions:
    - condition: template
      value_template: '{{ command == ''move_to_level'' }}'
    sequence: !input 'light_target_2'
  - conditions:
    - condition: template
      value_template: '{{ command == ''move_to_color_temp'' }}'
    sequence: !input 'light_target_3'
  - conditions:
    - condition: template
      value_template: '{{ command == ''move_to_level_with_on_off'' }}'
    sequence: !input 'light_target_4'
4 Likes

I can’t get this Blueprint to import. I’m getting “No valid blueprint found in the topic. Blueprint syntax blocks need to be marked as YAML or no syntax.”

The issue is the three backticks at the end ( ``` ). Once removed, the blueprint works.

1 Like

Edited to correct and remove the backticks. No idea how I managed to add them into the post. Thanks for the help!

@alfi33 sorry for the slow response. Hopefully you were able to resolve your issue with elecrobento’s help, but if not, import should work now.

1 Like

Thanks for this! I recently picked up two of these remotes. I also mapped the second button press and hold on release with
“command: stop”
and the third button press and hold on release with
“command: move_color_temp
args: [0,0,153,370]”

I’ve made virtual switches for motion detection so I think you are right about getting the 4th button to work. When the fourth button is pressed, the first zha command flips the virtual switch to ‘on’ and executes the action for the fourth button, the third button command looks for the state of that virtual switch before executing, on = do not execute and off = execute. Then the virtual switch is turned back off.

OK! I’ve got this working fairly reliably. THe virtual switch is slow so I had to introduce a delay. The third button press logic needs a little extra magic in your blueprint if you wanted to incorporate it. I’ll probably take a stab at updating your blueprint later this week with the press and hold buttons and 4th button.

I have two remotes, I tested on the second remote. Change the names as needed for your environment.

Create a switch to track the state.

This is the “button 3 single press” automation logic to check the state of the switch and toggle the entity. You can fiddle with the delay to fine tune for your network.

alias: Remote 2 Button 3 press
description: ''
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_ieee: YOUR_DEVICE_MAC_HERE
      command: move_to_color_temp
condition: []
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - condition: state
    entity_id: input_boolean.remote2button4status
    state: 'off'
  - service: light.toggle
    data: {}
    target:
      entity_id: YOUR_BUTTON_3_ENTITY_HERE
mode: single

This is the “button 4 single press” automation logic.

alias: Remote 2 Button 4 press
description: ''
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_ieee: YOUR_DEVICE_MAC_HERE
      command: move_to_level_with_on_off
condition: []
action:
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id: input_boolean.remote2button4status
  - service: light.toggle
    data: {}
    target:
      entity_id: YOUR_BUTTON_4_ENTITY_HERE
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 500
  - service: input_boolean.turn_off
    data: {}
    target:
      entity_id: input_boolean.remote2button4status
mode: single

reviving an old thread here, but i just got my remote working! Im usuing the current blueprint as it is, so i havent even tried implemnting the 4th button yet. Do ijust need to make two input booleans and edit the blueprint with the bit you provided to get the 4th button to work? Does long press or multiple clicks work?

Hey!
I use the template for buttons 1 and 2 toggle.
I made separate automations for:
button 2 press and hold
button 3 toggle
button 3 press and hold
and finally one for button 4 toggle.

I kept meaning to try to learn how to incorporate my separate automations into the blueprint but once it was working I moved on to other things :wink:

Do you mind sharing your blueprint setup with the holds as an option? I just got my remote paired but unable to bind buttons to 4 different bulbs. Looking forward to any support, thanks!