TASMOTA integration - switch without a relay

I have TASMOTA installed on a NodeMCU board with a motion sensor that is configured as a switch. The docs say that the TASMOTA integration should detect the switch as a binary_sensor when SetOption114 is on.

image

However, I’m having trouble getting this binary_sensor to show up at all. The payload for the topic I’m listening for, tele/OfficeSensors/SENSOR is:

{
   "Time": "2022-02-14T21:40:22",
   "Switch1": "OFF",
   "DHT11": {
      "Temperature": 20.4,
      "Humidity": 53.0,
      "DewPoint": 10.5
   },
   "TempUnit": "C"
}

where Switch1 is my motion sensor. The temperature / humidity / dewpoint are all showing up as sensors, but the binary_sensor does not. I’ve tried several SwitchMode values, but none seem to work.

Thoughts?

I take it back! I waited about 15 minutes the first time I did this, but it didn’t show up. But I came back the next day, and the switch was there. I don’t know how long it actually took.

So after investigating, the issue wasn’t that I didn’t wait long enough, it’s that SetOption114 doesn’t re-send the discovery MQTT message, and Home Assistant is none the wiser. If you reboot the device, you’ll get the discovery message, and I happened to issuing other commands at the time as well, such as SetOption30, which does cause the discovery message to get re-sent.

So either reboot the device, or send SetOption30 again; either way, problem solved!