How do I send a Slider numeric value over Wifi and read it in Arduino/ESP32?

I've searched for this and can't find any resources. I want to send a Slider's thumbPosition over Wifi and have it read in my Arduino/ESP32 code as a byte value. I can send the value using 'set Web1.URL' to 'get thumbPosition', but this just sends it as a random String. I want to identify this string as an important value and assign it to a byte variable in my Arduino code.

  1. How do you send and receive numeric values like this, and differentiate them from other strings (like 'ButtonAWasPressed")? Numbers have different importance from Strings. fyi, I'm using 'client.readStringUntil('\r')' in my Arduino code to get the string value after the IP address.
  2. It seems like the only variable type you can send and receive are generic Strings, which means you have to identify the meaning of the String inside the String itself (like "ButtonAWasPressed"). Is the only way to identify numeric values to parse these strings, and therefore I need to add "identifiers" inside the strings in order to separate them into things like "Color Value" or "Brightness"? (Is this making sense??). It's weird because you can send a String value like "ButtonAWasPressed", and know exactly how to interpret it. But if you send a random number like "47", how do you know how to interpret it in the code?? :thinking: Thank you for any insight.

Encode your data as JSON text with appropriate tags identifying the data values.

OK thank you. So basically you can only send Strings to the MCU, and need to include identifiers in order to parse the data. :+1:

You may get a "random string" because the Slider is moving too fast. Use a Clock to send the data in 1 second intervals, for example.

BTW, here we have a code to move a Slider from a web page, not the Slider component.