Problem with LWT options

Hello, I have a sonoff with Tasmota firmware and I have configure with this items:

Switch SonoffRoom11_Unreach "Room 11 unreachable" <siren> (Unreach_Group)  { mqtt="<[DomoBroker:tele/sonoff-Room-11/LWT:state:MAP(unreach.map)]" }

How can test the LWT state? How can I simulate an offline state?

thanks

In a rule:
I don’t know what you map file looks like but it would go something like this:

rule "LWT"
when
    Item SonoffRoom11_Unreach changed
then
    if (SonoffRoom11_Unreach.state == OFF) {
        // Do something
    }
end

By using the REST API

I change the question, how can check if my devices are correctly connected? LWT is a correct way? Can you suggest me the API to use for simulate disconnection (exactly command)? Actually I use only the console…I’m beginner sorry…

The REST API

Or the console


With runtime commands

Since it’s just a Sonoff, just unplug it. After a few seconds or so the LWT message should be generated.

I try it but it doesn’t work…I have created an item in habpanel with type Switch and String but both not update if I switched off the sonoff

Have you configured the Sonoff to use the LWT?

Have you confirmed the topic configured on the Sonoff exactly matches the one on the Item?

Use a third party MQTT client like MQTT.fx to subscribe to that topic and see if a message is being published and OH is just not getting them.

Sure! With MQTT.fx is see offline message but it not receive to my items and change the status…maybe I wrong the type of items?

Have you configured the Sonoff to use the LWT?

There are some step to do to enable it?

If you are getting the Offline message to that topic then the LWT is already configured.

Do you see anything in the logs? Perhaps there is a problem with unreach.map. If it isn’t returning ON for Online and OFF for Offline then it isn’t returning a valid state for a Switch Item.

Always look in the logs for errors.

I don’t have unreach.map how it should be configured?

Make sure to install the Map transform.

It wasn’t. I have just installed now. I have to configure it?

See the links above

It’s seems work now! Before appear NULL now OFF and it’s correct! Before I use network ping as workround…

Thank you !