If your switch is activating itself, you may need to run the following commands to decouple the sensors from the relay.
Once the switch is communicating via MQTT and is in Home Assistant, you’ll want to rename the sensors, currently listed as Switch1 and Switch2. Rename Switch1 as “<device name> Motion” and set the “Show as” field to Motion. Do the same thing for Switch2, the light sensor.
Home Assistant Entities