After switching to Edge and using sample driver from @veonua as a template, it finally works
I’d like to iron it out a little bit adding calibration dialog in GUI, but that’s TBD. For now one needs to turn calibration mode manually, do it, and then turn it off…
Documentation for Edge libraries is terrible… some elements are not documented as all, ones that are documented - have no examples of use, types are a mess… so without working example it’s nearly impossible to create a driver
Thank you for the feedback regarding the Edge documentation. Just to have a better reference, can you provide more details, please?
Which functions did you notice missing?
What do you consider wrong about the data types?
In addition to the Edge reference documentation, did you check the ST Lua Libraries included in this section?
In the last one, you can see the code of the default handlers, and other functions that would help you understand how they work.
local cluster_base = require “st.zigbee.cluster_base”. That “cluster_base” is not documented at all. Do search in your Edge reference - nothing returns
device:send_to_component(command.component, zcl_clusters.WindowCovering.server.commands.Stop(device)) . Where, where on earth is it documented in WindowCovering ? in Edge references, it’s described as “class st.zigbee.zcl.clusters.WindowCovering.Stop”. So that “.server.commands.” complements part I can only learn/pick from examples, not from the documentation
device:send(cluster_base.write_attribute(device, data_types.ClusterId(zcl_clusters.WindowCovering.ID), attr, data_msg)) Again, why zcl_clusters.WindowCovering.ID property, which is Cluster ID, returns value with wrong data type ?! So I need to explicitly convert it to ClusterID type before I can use it ?
I guess it’s a lack of experience with Lua. Nayely’s link to the ST Lua Libraries is very useful.
local cluster_base = require “st.zigbee.cluster_base”
basically, you just load the external library made by ST team.
So I need to explicitly convert it to ClusterID type before I can use it?
this is how Lua works, it’s possible to handle other types there, but it will take much more effort. The Edge API is in Beta and it’s impossible to make everything perfect in such a short period of time.
my feedback is about documentation mostly. I understand what “require” statement does, however I
Unpacked API docs from that link - not a word about “cluster_base”. EVERY sample piece of code there loads st.zigbee.cluster_base, but where is documentation what this library does/implements ?
And yes, LUA is a strict types language, however I still find it strange that cluster number always needs to be used as ClusterID type in library functions, why same library class property returns it as uint16 ? Now, it’s just a little quirk, and perhaps too much grunt from my side, but just as an observation.
Yes, it’s beta so I’m not complaining, but rather provide feedback. Sooner or later it will be out of beta right ?
BTW, for how long has it been in beta ?
But there has been continuous development during that time, as you can tell from the release dates on the individual stock (created by Samsung) Edge Drivers.
the driver works, but there is a problem with the state.
After 15min the switch seems to be in a freeze state and I lose the state of the curtain (go to closed). To resume the switch I have to press the “up” button first and then it’s possible to command it again.
I’m not a programmer or an it expert, I can’t solve this problem…
The SmartThings tile reports the Blind as ‘Closed’ when the blind in open and visa versa. Can the coding specific to SmartWings be updated to correct this issue? There are no settings within the device settings to reverse the state of the blind.