Accessing a Single Device from Multiple Blynk Projects?

I’ve done quite a bit of reading in the Blynk Community but haven’t found a solution to a basic need that I have. My need is to have multiple Blynk projects access a single device. I have 10 ESP8266 devices around the home, all connected to Blynk, Currently each device is accessed by its own dedicated Blynk project. I want to create a single notepad “dashboard” that shows a summary status of all devices (lights, outlets, temp. control, etc). The individual Blynk projects for each device have detailed widgets to show/control device names, MAC address, OTA buttons to initiate updates, etc. I don’t want the central Blynk dashboard project to display or access all of these detailed widgets from the individual projects. I only want the central dashboard to show a subset of widgets on the notepad.

For example, I have several ESP8266 smart switches for controlling lamps, coffee makers, etc. The individual Blynk projects have widgets to turn them on/off as well as specifying IP address, and buttons for controlling OTA updates, remote debugging etc. I want the single Blynk dashboard project to display the switch on/off status and be able to turn them on and off, but I DON’T want the dashboard project to be able to initial OTA updates, debugging, etc.

How can I accomplish this? if there was a way to access each device from multiple Blynk projects, that would solve my problem. I thought about shared projects, but it seems that is an all-or-nothing proposition.

Your words of wisdom from the community would be greatly appreciated!

This is beginning to sound like my standard response, but MQTT and Node-Red is one solution.
A Raspberry Pi can act as an MQTT/Node-Red server and this can talk to Blynk to read/write virtual pins.
In my setup, which also uses multiple ESP8266 devices dotted around the house, I don’t even run any Blynk code on the ESP’s, just Wi-Fi and MQTT code that talks the RPI server (plus any code that is needed to control the attached devices of course).
Node-Red is a graphical programming environment that is extremely powerful and easy to learn. Peter Scargill has a script that makes setting-up the server very easy and you don’t really need to know anything about RPI’s to get it up and running.

In your case you could use Node-Red to read the status of the widgets in the individual projects (provided they use virtual pins) then feed this data to widgets in a new summary project. Toggling a switch widget on the summary screen would be mirrored back to the corresponding switch on the the specific project by writing to that switch in Node-Red.

Hope this helps.

Pete.

@PeteKnight Thanks for such a speedy response. I’m familiar with MQTT and node-red and they would offer solutions to this. However, I should have also mentioned that many of my devices are modified Sonoff switches with only 1M flash, so I don’t have the luxury of utilizing high-overhead services and libraries.

My goal is to verify whether or not Blynk supports a single-device to multiple project relationship within the Blynk infrastructure. I hope this helps clarify my situation.

Closest method i can think of is via Bridge Introduction - Blynk Documentation I use it to display multiple temp/humidity readings from separate devices (each with own project) onto a single project.

That same principle should work from a single device into multiple projects displays… but their respective devices will need to be involved in the process.

I use a few Sonoff Basic and S20 devices in my system. Both have 1Mb of flash and I don’t have any problems running my MQTT and OTA code on them.

As I said earlier, you could actually use your devices running your existing code (provided you use virtual pins for your widgets) and simply install the Blynk-ws (web services) nodes in Node-Red and do the rest in Node-Red.

Pete.

I’m looking to do the same thing … multiple projects accessing the same device

e.g.
1: complex app that shows all lights and other controls around the house as well as all the devices that are online
many: simple app that turns light on and off in one room

it needs to be separate apps (not tabs) so that I can distribute the simple apps to others and keep the ‘master’ app on my phone showing everything

I don’t want to bridge on the targets that is putting a burden on the device to copy things across and makes network organisation of many device difficult and hard coded (what if the node doing the copy is not on line? what if the node I’m bridging to is not on line? the whole system stops or if bits are missing and I wont know)

When I create a new project all devices I’ve created so far could be listed for selection ? or at least let me edit a device and paste back a token for a device I’ve already used ?

I understand it may be an issue with synchronisation of many applications writing to the same virtual pin on one device

Rob

It is called multitenancy. And this what we are building for business clients right now.

@Gunner Thanks Gunner. I thought about this and may have dismissed the idea prematurely. The reason I dismissed it was because I thought it would force me to use a “proxy” MCU (ESP8266) to serve as the host for all the central summary data/widgets. I was hoping to simply place one large notepad in my family room that “sees” summary information from each of the individual devices around the house. If I use the bridge approach, wouldn’t I need to use a dedicated MCU who’s only job is to collect summary data and attach my notepad project to that MCU?

I don’t see why you need a dedicated device… a Bridge is just a simple way of one device sending data to another device(s) for the receiving device to either display on it’s App or to use for further logic processing. If you have 10 devices, each working with their own independent projects, each grabbing there own sets of data… but for some reason you want one of those data points all displayed in one of the projects, then bridge is the method to do so… the inverse also works for having one button, on one project, process an action (could be multiple different actions) on some or all of those 10 devices.

I keep reading comments about “load on devices” and what if something fails, etc… well, so what?.. those situations apply to the whole infrastructure, not just Bridge; When you have multiple points of potential failure of anything in a system, you plan and code for a degree of redundancy and/or fault management and carry on :wink:

I think I have some homework to do on Bridging… I’ll circle back after some experimentation. @Dmitriy, I inferred from your comment, that the key feature being discussed here is not available but is under development for business customers. Would you agree with @Gunner’s comments on using the Bridge widget to accomplish this (multiple projects accessing a single device)? If so, what’s the difference between what’s under development and using Bridging? Your insights would be appreciated.

hummm

working with this again last night and I’ve got another good reason to ask again for the same device across multiple projects … (putting aside bridging etc to communicate with multiple device)

I have a device with code running nicely
I have an app which I’m quite happy with and consider ‘stable’ and will use for now

now I want to develop a new app for the same device … I cant do it without pulling the old app apart because I cant define the same device in a new app ;-(

I would prefer to develop this way stable version to new stable version.

You will make more money from me because I need to ‘clone’ the whole app including the important device links and ‘pay’ for all the widgets again. Of course some will then be recycled and replaced in teh new app as I develop it … but it makes my development cycle much nicer as I keep a stable old working app and work on the new one in parallel talking to the same device

Rob

@Robj which MCU are you using?

Isn’t the answer just to buy multiple MCU’s? Working app stays with one MCU and your WIP with another MCU? I believe that’s what other Blynkers are doing.

its an ESP8266 which is easy enough to OTA but my point is the application running on the board is stable. Yes its cheap enough to have a few of those but not the additional hardware its connected to.

I want to be able to have one stable application for use now and one I can tinker with for look and feel or adding and testing new things

ultimately I may finish the project with 2 apps a ‘simple user’ one and an ‘expert’ one I don’t see why I cant just duplicate an app to allow me to redevelop it or reuse a device auth key in a new app

Remember it is NOT just the App, but rather a combo of App, Server, and MCU that makes a total project.

So, with that fact in mind… how can you have a stable setup while working on a totally different App… but expect to have both using the same MCU and sensors? These little things don’t support virtualization ya know :wink: Cause them to have multiple personality disorders and you bring the whole IoT uprising upon us :stuck_out_tongue:

I think you seriously need to reconsider the $5 dollars or so for a new MCU or two, or at least swap sketches on your one as you develop other Apps… While the Developers may very well have this thing called multitenancy, whatever that is, it may not be what you seem to need it to be.

and what about ‘expert’ app showing more controls and maybe a diagnostic terminal and ‘user’ app showing just simple controls on the same single device ?

it is a valid use case to have multiple apps and one device

But you can, you simply clone the good working app that you already have.
The unique token is an excellent way of distinguishing between one version of a project and another.
All you have to do is swap out the MCU, you don’t need duplicates of the hardware that connects to the MCU.

Similar requests along those lines have already been made a few times… basically locking out tabs and/or widgets for different users. And that is probably easier done then redesigning the whole system.

And in actuality, something like that can already be done with Terminal Widget for PIN codes and coding that “locks” out certain widget controls (even visually with Blynk.setProperty(vPin, “property”, value) ). then have that “root” access on a timer so that other uses can’t take advantage of that if you forget to lock it out again. And you could start making that right now, no Developer intervention needed.

@Gunner You said something that intrigued me. You said “… basically locking out tabs…”. I didn’t know there was a way to do that. In fact, I didn’t know there were any widget properties for a tab. Or are you simply saying you can lock out all of the widgets on a tab by writing code to require a PIN for all widgets on a particular tab?

there does not appear to be any properties to hide/lock a tab the only properties in documentation link are about colours and labels on widgets and menu selections etc. So I can see how that can be used to make dynamic widgets based on hardware state (signalled back on a Vpin) but that is not useful for customising the same hardware for different users in one household. The hardware cant signal back who is currently using it to alter the app appearance ?

whats the difference here …

  1. I make some hardware and 1 app and distribute it to say 4 people
    so you technically have 1 device 4 apps (all the same)

  2. I make some hardware and provide different types of access to 4 people so I write 4 apps
    so you technically you still have 1 device 4 apps (some apps are a subset of a bigger one)

I can already do 1, I’m just asking to be able to do 2 by re-using a device auth token in a new app you definitely make more money out of me if I can choose the second method as I duplicate widgets on each new project as well as the ‘share project link’ for each of those projects

When you say distribute it do you mean share or clone?
Sharing will be 1 device
Cloning will be 4 devices

Make even more if you sign up as a business user for multitenancy.