🧯 Zigbee2MQTT - ZemiSmart ZM-RM02 Controller

(18 actions!!) This Blueprint uses the Z2M (Zigbee2MQTT) imported Action sensor to sort out the 18 commands from the 6 buttons of a ZemiSmart ZM-RM02 Controller. The split out of functions gives you the ability to assign local scripts or functions to do the things you want the remote to do. Functions that are left empty will simply do nothing.

:bookmark_tabs: Changelog

  • 2023-08-07: Updates for Home Assistant 2023.8
    • Selector syntax change
    • Condition Selector addition (where applicable)
    • MQTT Discovery name changes (where applicable)
    • Clean-up code formatting
  • 2023-07-17: Adjust trigger-to statement
  • 2023-03-01: Add Author Tag. Bump HA required Version to 2023-3-0
  • 2022-12-12: Add Update Method Note, minor code change.
    • Name of Blueprint may have changed meaing you have to re-download with a new link.
    • If name changed, it is similar. Variables have not changed.
  • 2022-05-05: Updated for 2022.5.0 HA. Added Markdown to !input Descriptions.
  • 2022-04-17: :tada: :control_knobs: :battery: New Blueprint!

:crystal_ball: About this blueprint

Type of blueprint: AUTOMATION

What if I am having problems getting it going?

You can contact me for help, see the links below.

Why do I need this?

This Blueprint uses the Z2M (Zigbee2MQTT) imported Action sensor to sort out the 18 commands from the 6 buttons of a ZemiSmart ZM-RM02 Controller. The split out of functions gives you the ability to assign local scripts or functions to do the things you want the remote to do. Functions that are left empty will simply do nothing.

:wrench: Configuration

Requirements

  • My ‘suggestion’ is that you do separate scripts for most, if not all of the actions you generate here. If you are using the UI editor for the simple things you are fine, but for more complicated things scripts may work better for you. This is my opinion and how I am using it, to each their own. Building functions within the uI is also available if you are more comfortable with that.
  • To make the Blueprint work you will need a functional RM02 integrated to Home Assistant thru Zigbee2MQTT and find the sensor entity in the Home Assistant Device tab that Z2M imported which is named similar this:
    • sensor.xxDevice_Namexx_action
    • Open your Home Assistant instance and show your devices.

If you do not see that sensor, ‘LegacyAPI’ might not be selected in the Zigbee2MQTT settings - settings - advanced menu. Please find and check/select that setting like so:

Z2M Menu Screen

– SCROLL DOWN –

Legacy API Selected Screen

:card_index_dividers: Input fields

remote/name: Remote
    The entity to put here is the sensor that Z2M imported that is
    named like this ->  ```sensor.XXYour_HameXX_action```'

additional_conditions:
    Extra conditions you may want to add to this automation 
    (Example: Home occupied, TV on, etc)

tap_1:
  name: Single click on Button 1 action

doubletap_1:
  name: Double click on Button 1 action

hold_1:
  name: LongPress on Button 1 action

tap_2:
  name: Single click on Button 2 action

doubletap_2:
  name: Double click on Button 2 action

hold_2:
  name: LongPress on Button 2 action

tap_3:
  name: Single click on Button 3 action

doubletap_3:
  name: Double click on Button 3 action

hold_3:
  name: LongPress on Button 3 action

tap_4:
  name: Single click on Button 4 action

doubletap_4:
  name: Double click on Button 4 action

hold_4:
  name: LongPress on Button 4 action

tap_5:
  name: Single click on Button 5 action

doubletap_5:
  name: Double click on Button 5 action

hold_5:
  name: LongPress on Button 5 action

tap_6:
  name: Single click on Button 6 action

doubletap_6:
  name: Double click on Button 6 action

hold_6:
  name: LongPress on Button 6 action

:wrench: It won’t work… Are my Button presses working?

There is sample code to make the template sensor in the help file on GitHub Repo.

Within this blueprint there is an event handler that will latch the last command that the blueprint finds and sends that to the event buss. From there a simple Template sensor can grab it and show you the last action sent. This will help when setting up new functions and to troubleshoot strange behaviors. Add an entity card in your dashboard for sensor.cube_last_action to see what actions occur as you press the buttons.

Yaml file that contains the sample code here

:sun_with_face: :snowflake: Troubleshooting tip

If you are troubleshooting and you want to see more traces back when doing so, here is a TIP I’ve found.
Manually edit the automation created with the ui editor (or manually with a text editor) and add the following to have this automation contain 10 traces instead of the normal 5. Then if the automation is triggering often, you can see the last 10 traces to help you decide what the issue is.
HA Docs on this here.

trace:
  stored_traces: 10

:envelope_with_arrow: Version Updates

Updates will be published on my GIT repository with the rest of my Home Assistant Blueprint collection.

:envelope_with_arrow: There is not an official version control system for Blueprints. However I have found something that comes pretty close. It is not perfect, but for MOST Blueprints, it does just fine. I encourage you to check this script out and use it to easily check if I have updated this blueprint. :link:koter84 Blueprint Update Script

Please Click the :orange_heart: at the end of this top Post if you find this Useful

:calling: Software to Download :floppy_disk:

HA link to download blueprint: Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Direct link to download Blueprint: https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Zigbee2MQTT-ZemiSmart_ZM-RM02_Controller.yaml

:globe_with_meridians: All My Blueprints

Link to ALL my Blueprints

https://github.com/SirGoodenough/HA_Blueprints/blob/master/README.md

:man_juggling:t5: Contact Links or see my other work

What are we Fixing Today Homepage / Website: https://www.WhatAreWeFixing.Today/

Channel Link URL: (WhatAreWeFixingToday) https://bit.ly/WhatAreWeFixingTodaysYT

Discord Guild: (Sir_Goodenough#9683) WhatAreWeFixingToday?

:cheese: If you want to support me

Buy me Coffee: https://www.buymeacoffee.com/SirGoodenough

PayPal one-off donation link: PayPal.Me

#WhatAreWeFixingToday

#SirGoodEnough

@DMcG
I prefer to answer in the main thread as opposed to DM…
The sensor will be in Home Assistant, not the Z2M control page.
Find the switch in Devices and you should see the sensor name there.
Open your Home Assistant instance and show your devices.

Thank you for this. I had looked in the devices tab and it wasn’t there. However, seeing your MQTT logo on the screenshot pointed me in the correct direction. I had set MQTT up when I started with HA a few weeks ago and hadn’t properly configured it (as didn’t really need it at the time). Deleted and reconfigured MQTT, restarted HA and I can see everything now.

Thank you so much.

1 Like

NEW UPDATE