Hi, everyone = )
I hope everyone enjoyed the holidays and is having fun here!
Back to the purpose of this thread, in the last weeks I’ve been having a great time developing a few drivers for a set of bulbs and outlets for my house and decided to take a shot to integrate something “underground” i.e. something that is not officially supported, and in this context I bought a MOES 4-Button Scene Switch, and at the first moment I had a hard time to understand the flow of the integration because taking in consideration the zigbee-button official driver, it seems that every manufacturer integrates the button events in different ways.
I just translated the references into Lua, which looks like this (a bit hardcoded):
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) -- UNSUPPORTED_ATTRIBUTE local onoff_custom_attr = cluster_base.build_cluster_attribute(clusters.OnOff, 0x8004, "OnOffSomething", data_types.Enum8, true) -- Send ZigbeeMesssageTx device:send(custom_cluster) -- UNSUPPORTED_ATTRIBUTE device:send(onoff_custom_attr:read(device)) -- SUCCESS device:send(clusters.PowerConfiguration.attributes.BatteryPercentageRemaining:read(device)) -- BatteryPercentageRemaining device:send(clusters.PowerConfiguration.attributes.BatteryVoltage:read(device)) -- BatteryVoltage device:send(onoff_custom_attr:write(device, 0x30)) -- Switch into Scene Mode??!! device:send(onoff_custom_attr:read(device))
Note: this process must happen at
doConfigure and it may take a few discovery tries (it took me two tries).
So, I’m really excited that I finally got the events and I hope to finish the driver in the upcoming days.