Αssociate a binary sensor state with a switchbot for a cover template

So, if the sensor is closed or off the switch will also be OFF and google home can tell me that.
If the sensor is open google home mini will tell the switchbot is ON

@cflev May I know how did you add the Switchbot Contact Sensor integration to HA? Thanks.

Shouldn’t the contact-sensor be set-up as a binary-sensor?

Which switchbot device are you referring to? I see a number of products listed on their web page. Which one has the contact-sensor you refer to?

This one:

They do not appear to be supported. I am not 100% sure though. Perhaps open a thread about that specific device, as this thread is about a different switchbot device.

Oh I thought the “binary door sensor” metioned by OP is Switchbot that one. Sorry for that.

I just added switchbot motion and contact sensor to my esp32 implementation

https://community.home-assistant.io/t/switchbot-bot-curtain-meter-contact-motion-mqtt-esp32-bridge-local-control

note: normally a contact sensor would be a binary open/closed, but switchbot returns “open”, "closed’, and “timeout”. so it is just a sensor with 3 possible values

I am running HA on RPi4. May you please tell me what hardware do I need in order to use your library? Thanks.

An esp32, just like it says.