Sate of LED not following the boutton

I have an LED connected to the esp8266 , now the issue is when I add a button on my dashboard and lets say the current state on the ESP and the dashboard both was “on”.
I unplug the esp8266 from the power and then I switch the state of the button to “off” , whenever esp8266 fires up again it follows its last state that the LED is on but now when I try to control it from the button it is working in reverse . Like instead of checking whether the button state is on or off in my dashboard it feels like as it is simply switching the state of the LED.

How do I make the ESP check the state of the button on the dashboard and only follow that. Like if the button is of irrespective of the last State the LED goes off and if the button is on the LED also goes on

Hi @amansinghaljpr, how is the code on your sketch?

#include <ThingerESP8266.h>

#define USERNAME “"
#define DEVICE_ID “tasmota”

#define SSID “Fibre”
#define SSID_PASSWORD “*****”


void setup() {

thing.add_wifi(SSID, SSID_PASSWORD);

// digital pin control example (i.e. turning on/off a light, a relay, configuring a parameter, etc)
thing[“relay”] << digitalPin(LED_BUILTIN);
// resource output example (i.e. reading a sensor value)
// thing[“millis”] >> outputValue(millis());

// more details at

void loop() {

As it is coded, it will follow the next behaviour:

The ESP8266 has inverse logic, so a LOW or FALSE state/value will turn the led ON,

The led value will not be initiated by the thinger platform, I mean, it will not consult the platform to get the current value, it will initiate as it is coded or random.

When you change the value at the dashboard is when it will send the new value to the device, regardless of the previous value at the device.

Hope this helps you understand how this works, and please, next time post the code in the right way.