GL-S200 Automations Webhook JSON Variables?

With the new v4.7.0-0500 firmware in the S200, I'm wanting to test the Automations and do some testing.

I can see how to create the Webhook from a device, and select JSON, but then how do I reference the values of the human interaction or sensor?

For example, with the User Action -> Turning the Knob how can I send in the JSON how much the knob was turned? How can I get the position of the knob, or the number of "clicks" that it was turned so that I can report that in the JSON?

@lancer any thoughts on this?

Hi @Humancell ,

You could use rpc to get some informations of devices like I said in GL-S200 Code Example - Access Denied - #3 by Barry

But actually our GL Thread Dev Board would not record its own position of knob, and the number of "clicks". :smiling_face_with_tear:

Oh no … this is so broken! :slight_smile:

The developers must fix this … it has been broken for so long. This is such a great product, but the developers have not finished the code to make it useful. :frowning:

Hello @Barry ,

Can you ask the developers: If I use the example code for the knob, I see that it says "It listens for events reported when the user operates the knob."

Does this mean that I will get an event for each and every click in either direction?

Or will I get an event that simply means "there have been some number of clicks in this direction"?

I'm curious how accurate the events are. I'm working on this script now.

Hello @Humancell ,

The script will report an event when you press the knob once or when you turn the knob, but it would not report the number of clicks or the position of knob. :smiling_face_with_tear:

You may need to count it by yourself. :no_mouth:

Hello @dennis65 ,

Thank you for joining the conversation! Do you currently own the GL-S200? Are you also doing work and coding with the device and sensors?

The Thread Development Boards actually contain a rotary encoder knob that includes the knob press switch also. Because of this it would require specific code within the board firmware to keep track of the position, something I realize they are not currently doing. In addition, it seems they are not accurately tracking the "clicks" or individual steps of rotation to be able to report them in a deterministic way. From my testing, I get events within the GL-S200 every 3 or 4 clicks and so it is not easy to "count" the clicks in a deterministic way. This difference in "click" counting appears to be caused by the reverse of direction in rotation.

This could be improved via several methods within the sensor board code, if they chose to do so. I have not been able to review their code to make the changes myself, nor to understand if they are reading the encoder via polling or interrupts.

@Barry is the Thread Development Board source code now published somewhere publicly for review? I could not find it in Github.

In addition, they are not actually generating any webhooks. They appear to be using a lower level Thread protocol to communicate the sensor data and events to the GL-S200.

As for submitting a feature request, I provided GL.iNet with a comprehensive document that outlined many of the current limitations of this product to GL.iNet management back in November of 2023 when I began extensive work with the product. They have made some progress since then, but have still not addressed many of the issues. I continue to have dialog with the management of GL.iNet about this.

Yes ... someday the firmware updates might progress to make this a much more useful product. This is exactly what I am pushing for.

Also, I did release one of my scripts that does produce webhooks from their sample code. I just started a thread here, sharing that code:

If you have a device, please install and experiment with my current script ... I'd love feedback on this!

Hi @Humancell ,

Yes, source code of the Thread Development Board is published in github and you could do some change yourself. BTW, the source code is based on gl-nrf-sdk, so you also need to download it like it said in here.
And we will follow up on the bugs you said, but...sorry, before we finish handling that, you may have to do it yourself first. :smiling_face_with_tear: