Repository navigation
Description
Im new to github, I dunno how to use it so I'll leave this here, hope it helps someone.
This is an AI Generated guide, I did my best to put all the information I followed to get this working.
Configuring Moes ZS-EUB_1gang (Custom Firmware) for Detached Button Actions in Home Assistant (Zigbee2MQTT)
This guide provides a step-by-step process to configure the Moes ZS-EUB_1gang switch (Model: Moes TS0011, Manufacturer: _TZ3000_hhiodade), specifically with a custom firmware (like romasku's tuya-zigbee-switch), to act as a detached button controller in Home Assistant via Zigbee2MQTT. This allows you to use the physical button presses to trigger automations without controlling a local relay.
Tested Versions:
- Zigbee2MQTT: 2.4.0
- Zigbee2MQTT Frontend: 1.0.2
- zigbee-herdsman-converters: 23.53.0
- zigbee-herdsman: 4.1.0
- Home Assistant Core: 2025.5.3
- Home Assistant Supervisor: 2025.05.5
- Home Assistant Operating System: 15.2
- Zigbee Coordinator: Home Assistant SkyConnect (Firmware: EmberZNet Zigbee 7.4.4.1)
- Device Model: Moes ZS-EUB_1gang (Moes TS0011, Manufacturer: _TZ3000_hhiodade)
- Device Firmware: Custom firmware (e.g., romasku/tuya-zigbee-switch) installed on Moes ZS-EUB_1gang.
Step-by-Step Guide
Part 1: Pairing and Initial Zigbee2MQTT Configuration
1. Ensure Zigbee2MQTT is Running with Debug Logging:
- To edit your
configuration.yamlfor Zigbee2MQTT, it's recommended to use Studio Code Server or access the file system directly rather than the Home Assistant Add-on section for a more reliable configuration.
Add or modify the log_level to debug:
YAML
log_level: debug
- Restart your Zigbee2MQTT add-on/service to apply changes.
2. Pair Your Moes ZS-EUB_1gang Switch:
- Put your Zigbee2MQTT into pairing mode (e.g., via the UI or
permit_join: true). - To put your Moes ZS-EUB_1gang switch into pairing mode, press the physical button 5-6 times quickly. The indicator light on the switch should then flash rapidly, indicating it's in pairing mode.
- Once paired the device should successfully complete the "interview" process.
3. Verify Device Settings in Zigbee2MQTT UI:
- Go to the Zigbee2MQTT UI.
- Select your newly paired "Switch" device.
- Go to the "Exposes" tab.
- Verify that
Switch modeis set tomomentary. - Verify that
Switch relay modeis set todetached. - Press the physical button a few times. You should observe the "Switch press action" value changing from
releasedtopressedand back. This confirms the device is sending the button press information to Z2M.
Part 2: Activating State action for MQTT Publication
This is a critical step for the action event to be published via MQTT, which Home Assistant uses.
1. Navigate to Device Specific Settings:
- In the Zigbee2MQTT UI, select your generic "Moes Switch" device.
- Go to the "Settings (specific)" tab.
2. Enable "State action":
- Find the option labeled "State action". Its description should state: "State actions will also be published as 'action' when true (default false)."
- Toggle this option from
FalsetoTrue. - Click "Save" to apply the change.
3. Restart Zigbee2MQTT:
It's crucial to restart your Zigbee2MQTT add-on/service for this setting to take full effect.
4. Verify MQTT Publication:
- Go to Home Assistant > Developer Tools > Events.
- In "Listen to events", type
mqtt_messageand click "START LISTENING". - Press the physical button on your Moes switch.
- You should now see
mqtt_messageevents appearing. Specifically, look for messages on topiczigbee2mqtt/YourGenericSwitchName/actionwithpayload on_relay.You will also see a message ontopic 'zigbee2mqtt/YourGenericSwitchName'with a payload containing"action":"on_relay".
Note: The action published by this specific custom firmware is on_relay (and potentially off_relay or others, depending on how it's released or configured), even if the "Exposes" tab shows "press" and "long_press".
Part 3: Home Assistant Automation Configuration
Since the device reports its button press as a state change to a sensor in Home Assistant, we'll use a state trigger instead of an event trigger for the automation.
1. Access Home Assistant Automations:
- Go to Home Assistant > Settings > Automations & Scenes.
- Click "Create new automation" or edit an existing one.
2. Configure the Automation in YAML Mode:
- Click the three dots in the top right corner and select "Edit in YAML".
- Use the following YAML syntax, ensuring proper indentation:
YAML
alias: Control Light with Detached Switch
description: 'Toggles a light when the detached Moes switch button is pressed.'
trigger:
- platform: state
entity_id: sensor.yourswitchname_switch_press_action_switch # This entity is created by Z2M, Replace yourswitchname with the actual name
to: 'press' # The state to listen for
condition: []
action:
- service: light.toggle
target:
entity_id: light.your_light_entity_id # REPLACE with your light's entity_id
mode: single
-
Explanation of the trigger:
-
platform: state: Triggers when an entity's state changes. -
entity_id: sensor.yourgenericswitchname_switch_press_action_switch: Home Assistant creates a sensor for theswitch_press_action_switch attribute. This sensor's state changes topresswhen the button is physically pushed. -
to: 'press': Ensures the automation only fires when the sensor's state becomespress(and not when it changes back toreleased).
3. Save and Test:
- Click "Save" in the bottom right.
- Press the physical button on your Moes ZS-EUB_1gang switch. Your configured light should now toggle.
Activity
MnM001 commentedon Jun 18, 2025
Hi,
Does this work when you use the light switch OR you turn on/off a light from HA only?
Also what happens with the light switch led? Does it work too (goes on or off as required)?
lorta commentedon Jun 18, 2025
I will work with both the light switch and HA. The thing is, power will always flow to the lights, and now the control of the smart lights is via an event being sent to HA to turn off/on the lights when you press the light switch.
About the light switch, it is always on as I configured it that way.