Advice for binary sensor for physical light switch (i.e. Shelly without relay)

Hello,
Has anyone encountered any off-the-shelf sensors which can be used to detect position of a wall switch? I mean sensors which can be mounted inside the electric box of a wall switch, similar to the Shelly modules but without relay. All thats needed is info about switch state - I want to control fan when light is on, but without physical wiring between fan and light switch.

Thanks,
JO

You could use a Shelly switch as the binary sensor (as below):

binary_sensor:
  - platform: mqtt
    name: "Garage North"
    state_topic: "shellies/shelly1-59DD95/relay/0"
    payload_on: "on"
    payload_off: "off"
    qos: 0
    device_class: power