Switch state

Hello,

I have a switch which turn itself off automatically after some seconds.
But my configured mqtt switch does not recognize it.
What has to be done that the switch entity shows the turned off?