This is the autodiscovery topic. Meaning, the payload that is published to this topic was for the purpose of having HA auto-create a device and all its entities in HA. Since it appears that the appropriate payload was published here, you shouldn’t need to do anything. The device should get created instantly. And the payload that is published to this topic (which you showed) shouldn’t ever change. It gets published once then that’s it.
This is the topic where the switchbot will publish information about its current state, and the payload here should change each time the switchbot has new information about its state:
It appears you are trying to create a new binary sensor that should be driven off the MQTT information published by the switchbot. Therefore, you want the state topic to be switchbot/FF11FF22FF33/status and not the autodiscovery topic.
You will likely need to specify avalue_template to extract the correct information from the payload, and you should be able to just copy the autodiscovery value template: "value_template": "{{ value_json['lockState'] if (value_json['lockState'] is defined and value_json['lockState'] is not none) else states('sensor.both_lockState_FF11FF22FF33') }}"
All that being said, it would have been waaay easier to just create a template sensor helper. Integrations → helpers → template → binary sensor
@mekaneck Thanks for the explanation, it makes lot of sense!
The integration was working earlier and had a binary_sensor that showed the correct state but something got broken through the updates and I was trying to fix it. After reading your explanation, I removed the integration and re-installed after a clean reboot and all the sensors are automatically created now!
Thanks for saving me from an over-engineered solution!!