Blynk with Rpi as gateway

Hi Guys,

I conceptually understand Blynk, but am not sure if my idea project would work. I have not begun to work with Blynk so just exploring possibilities before I go down the path…

Imagine, I have a bunch of RESTful devices around the house. LED on esp8266, button attached to a Spark Photon, Sonos speaker, household lightbuld, all these devices can be controlled through their REST protocols.

Can I use the Bylnk app to connect Blynk server on a RPI to send out RESTful POST/GET commands to the above end devices? Use case would put all control buttons on iphone blynk app, and then control such things as SONOS speakers?

if I would be able through, would I assign the controls on the app to “vitrual pins” and REST commands for those “virtual pin”, id so, is this done in javascript?

Sorry if this is basic question but just exploring without ever doing a project on blynk…

Simplest way would be to connect those devices directly with Blynk (upload blynk sketches). But in case you want exactly RESTful API - yes this is doable. However it will require from you some coding skills. You have to create websocket client as possible option. So when you press button - request goes to server - from server to websocket client and after that you can call necessary REST url from websocket client.

thanks for the quick reply, Yes I need to do RESTful as such end devices as Sonos speakers are not configurable. So I believe what you suggested is what I am looking for, do you know of an example or tutorial I can follow for such a project. I am not not afraid to coding, just figuring out the right path or environment before I go bumping against too many walls.!

Maybe look at the node-red? There is a Blynk plugin and you can create any flow you like.

Hi. There’s a much easier way - just install Node.JS blynk library on your RPi and code the virtual pins to control your hardware locally.
You can also add internal logics :wink: