MQTT state updates are not received in openhab

I have the following configuration in the item

Switch PowerLED "BED LIGHT" {mqtt=">[broker:openhab/bedlight/setpower:command:ON:ON], >[broker:openhab/bedlight/setpower:command:OFF:OFF], <[broker:openhab/bedlight/setpowerstate:state:*:default]"}
Color TVLedLight  "Bed Color" <colorlight> (All)
String TVLedLightColor (All) {mqtt=">[broker:openhab/bedlight/setcolor:command:*:default]"}

In the ESP8266 code whenever the color is set i do this

client.publish("openhab/bedlight/setpowerstate", "ON");

The color setting, powering on, powering off works fine. But whenever i set the color to the light, i was hoping that the openhab would read the incoming message on the state topic from MQTT and set the power button to on automatically. But it does not. Does it not work that way? or is something wrong in my setup

I’m still new to Openhab but I struggle to figure out what you are trying to accomplish. I would change the item to

Switch PowerLED {mqtt=">[broker:openhab/bedlight/setpower:command:ON:ON], >[broker:openhab/bedlight/setpower:command:OFF:OFF],<[broker:openhab/bedlight/setpower:state:ON:ON],<[broker:openhab/bedlight/setpower:state:OFF:OFF]"}

Now the state of PowerLED will be “ON” or “OFF”. If your idea was to do something with this information you can use it in a rule. if (PowerLED.state == ON) … Do something.

Hope this helps.

That did not work either. At the moment i have moved away from this configuration. I am not getting much help from people over here.