Hi everyone!
I hope you’re all doing well and enjoying the journey of enhancing your smart homes. I wanted to share my recent experience integrating a MOES 4-Button Scene Switch with my Zigbee setup. While it was a bit of a challenge at first, it turned out to be a rewarding project!
The Challenge
I purchased this switch, which wasn’t officially supported by SmartThings, so I decided to take the plunge and develop a custom driver. At first, I was a bit overwhelmed because different manufacturers handle button events differently. I scoured through forums and GitHub repositories, eventually finding a helpful thread and some code snippets that provided the foundation I needed.
The Solution
After some trial and error, I managed to adapt the code into Lua, which works seamlessly with Hubitat. Here’s a simplified version of what I did:
lua
local cluster_base = require “st.zigbee.cluster_base”
local data_types = require “st.zigbee.data_types”
local device_mgmt = require “st.zigbee.device_management”
– Build custom Cluster and
– custom OnOff Attribute
local custom_cluster = cluster_base.read_manufacturer_specific_attribute(device, 0xE001, 0xD011, 1)
– Send ZigbeeMesssageTx
local onoff_custom_attr = cluster_base.build_cluster_attribute(clusters.OnOff, 0x8004, “OnOffSomething”, data_types.Enum8, true)
device:send(custom_cluster)
device:send(onoff_custom_attr:read(device))
device:send(clusters.PowerConfiguration.attributes.BatteryPercentageRemaining:read(device))
device:send(clusters.PowerConfiguration.attributes.BatteryVoltage:read(device))
device:send(onoff_custom_attr:write(device, 0x30))
device:send(onoff_custom_attr:read(device))
The Outcome
After a few attempts, the switch started responding perfectly! The button events were registered correctly, and I could finally control my lights and scenes with ease. It was such a relief to see everything working smoothly!
Sharing the Love
If you’re interested in trying this driver, you can find the supported models and enroll in the necessary channels via the GitHub link provided in the original thread. I’d love to hear if anyone else has success with this setup or if there are improvements I can make!
Final Thoughts
This project taught me the value of persistence and the importance of community support. Without the helpful resources and code snippets from others, I wouldn’t have been able to pull this off. If anyone has questions or needs assistance with similar projects, feel free to reach out—I’m happy to help!
Cheers to all the DIY enthusiasts out there! ![]()