Ok, are you trying to simply find out the state of a physical switch (230V) over MQTT ?
If so what sort of switch is it ?
Do you want to be able to control the 230v remotely (from Home Assistant) of simply just monitor the state of the switch ?
Im not sure that something off the shelf exists for your needs but it’s fairly easy to build. What you’d need is a ESP8266 (a microcontroller with wifi capabilities), a temporary push button and a relay. The push button would be connected to an input pin of the 8266 and monitored by the microcontroller. When pushed, the state of the relay would change. The program should also monitor MQTT publications from HA to change the state accordingly to what is sent.
The relay would be connected to an output pin of the 8266 (,using a transistor would be safer).
At last, the 8266 should sent through MQTT the state of the relay TO HA.
Yes it’s the easiest and indeed it’s in a wall, I cannot change the wiring to 3.3V as not possible. Currently I have a 230V AC Main and I want to keep using that.
Indeed but the switch isn’t, I have to rewire the complete switch. I also have a motion detection outdoor how acts as switch there for it has to be able to handle 230v.
maybe you will have to draw a circuit diagram, I don’t really understand what it is you are looking for or how you want to integrate it into your HASS set up
So you want a 230v input to control the electronics that switches another 230v circuit? That is an odd requirement, most of us use a low voltage to switch a mains voltage. Maybe you need to rethink your design.
For example, change your outdoor sensor to wifi/zwave/zigbee.