Slider read/write with HTTP

I have a 3rd party device that can be set/read from HTTP call. I have managed to use Blynk slider to set the value (0-100) with HTTP call via virtual pin and webhook. When I move the slider, the value on the device is changed accordingly.

However, the value on the device can also be controlled elsewhere (not only from Blynk). When I open the Blynk app on the phone, the slider value is outdated (it’s the last value that was sent from blynk and not the actual value on the device, of course).

I would like Blynk to be able to read the value of the device on startup (via HTTP) and update the value of the slider on the screen. How can I do that? I’m running local server.

Thanks everyone for ideas.

I guess there are quite a few options.
You could use the webhook widget to get the current value from your device, but this wouldn’t update automatically. You could add a refresh button to the app, but that’s a bit clunky. I guess if you were using the Android app you could use the Eventor widget to keep the setting up to date, but I’m an iOS user so that’s just a guess on my part.

If you have any physical device linked to your Blynk project then that could be used to poll the HTTP API of the device and update the value on the Blynk server.

My approach would be to install Node-Red on the Blynk local server and use that to monitor the API and update Blynk.

Pete.

1 Like

Tnx for your reply. This is exactly what I did. Python script & cron to regularly monitor and update blynk status.

1 Like

a tutorial will be welcome to inform other users :wink: