TAG not allowing Widgets to set vPins that are already in use


I’m trying to turn ON/OFF at the same time various lamps connected each one of them to different Nodemcu.
I have one button created for each one to turn ON/OFF. Works OK.
Now I want to have a button to TURN ON/OFF all at the same time, the problem I discovered is that TAG works ok, with Digital Pins, meaning that if you select in a button the TAG created and then select for example Digital pin D1, then it will send ON/OFF to all devices at the same time for D1. I’m using Virtual Pins to turn ON/OFF devices, every device has the same Virtual Pins used, so I thought that TAG could send ON/OFF to all for examples V5, but It can’t, I says its already in use.

Thanks in advance,

You are correct, i tried and got the same thing… and I don’t think that is the way it is meant to be.

I changed your category to Issues and Errors, and modified the title to better suit the issue.

Meanwhile I found a workaround… Create another device (I just used generic) and when setting up your “shared” Button Widget, target the Generic device, set your vPin, then switch target from Generic to your Tag. It should work after that as “normal”. You will get the “One of your devices is offline” error, just ignore it, or if you are done setting up tags then remove that Generic device.

Hi Gunner,
Thank you for your answer!, I’ve tried the workaround but when changing device, Pin resets to PIN 0.
Any thoughts?

I’m using IOS if it mattersp

Hmm, it didn’t change on me and I tried with two different widgets (Button and Slider)… but then I am using Android, so who knows?

EDIT - By pin 0 do you mean V0? Changing devices may reset Digital and Analog pins, but my workaround (and your original issue) is in reference to Virtual Pins.

No, it resets to “PIN” as when you first create a button and PIN is not defined yet, it doesent keep the last PIN selected like in your example.

Well that bytes… I guess it is an IOS App thing… well, I guess you have to await a Developer’s input. Sorry.

This is general widget limitation. We’re not planning to change this right now as this require many changes. As workaround you may create separate handler for tag button (V6, for example).

Can you clarify how this works? If the OP’s devices all use V5 for whatever functions he wishes them to activate, how will setting the Tagged button to V6 be able to process them?

@Gunner if V5 is used by some widget, you may clone V5 handler to V6 just for tag widget.

//this one used for some button

//this one is used for TAG button

Yes, code is always a solution to some desired App/widget function… and the path I usually take anyhow… I just thought you had secret App based solution :wink:

Thank you,
Yes, doing code was what I was triying to avoid, as I have to open all nodemcu cases that are installed on various wall. I’ll see if maybe using the app in an android phone and using Gunner aproach.

I confirm, Gunner aproach worked correctly.
Thank you so much!, it helped a lot!!!

1 Like

You should look into adding basic OTA programming to your sketches.