Relay control using Ubidots Dashboard


#1

Hi All,

I want to control relay from ubidots dashboard. I created variable and assigned a switch widget to it. I uploaded following code in NodeMCU.

I do get my device online and the variable also is showing online but when i toggle the switch in ubidots seems doing nothing, i can not see any change of the relay contacts, could anyone help on this context.

subscribe-ubidots.ino (1.9 KB)


#2

Hi there, add this line to your setup() function

client.ubidotsSetBroker("industrial.api.ubidots.com");

For more information, please refer to the library docs.

All the best