[SOLVED] Change the status of the mqtt switch

by the way, how can I control the inbound default state for a switch?

Switch qLDbed "LD Bed" (gESP8266) {mqtt="
                >[broker:/pucon/haus/licht/control:command:*:MAP(ON1OFF0.map)],            
                <[broker:/pucon/haus/licht/state:state:default]" }

here the state:default. I want one switch item to display the inverted state. This is because I control a relay in Normal Closed state and want to have displayed it correctly.

What does your ESP send back?

It sents:

pubMessage( T_IOBED S_STATE, digitalRead(IO_LDBED) ? "ON" : "OFF" ); 

I could change my code, but I want to learn to do it in OH.

So the ESP sends ON when it’s ON and OFF when it’s OFF.
What excatly do you want to achieve?

I only want the switch icons displayed in the inverted order.
(Like in the ON state). Note that all code behind is in OFF state, this because the relay is in NO (normal open) state what means light is turned on.

You can’t tell OH that something if OFF when it’s ON

Use another item and a rule
Change the other item to OFF when dLDBed on ON and vice-versa

Even in the item visualization? What are the other options for :state:default ?

I have lamp connected to a relay in the NC (normal closed) mode. If there is no power at the relay the lamp is TURNED ON. If I apply powef to the relay (turn the relay on) the lamp is TURNED OFF. This is necessary for the case of a power failure. - the lamp is connected to an auxiliary power.

In MQTT and OH the real state is OFF (lamp is turned on). This is the reason I want to have the switch item in the ON status (green), even if my logic behind is OFF.