Why have you limited the binary sensor to “integration: mqtt”? (I just would have thought it easier to any device_class: motion).
Anyway I don’t have any experience playing around with mqtt (I want to tho). But maybe this will solve your problem?
blueprint:
name: Z2M - Motion lights
description: Motion sensor triggered lights with night mode
domain: automation
input:
sensor:
name: Motion sensor to use
description: Something something binary_sensor
selector:
entity:
domain: binary_sensor
device_class: motion
target_light:
name: Light (day)
description: The light to turn on during the day
selector:
target:
entity:
domain: light
trigger:
- platform: state
entity_id: !input sensor
to: "on"
action:
- service: light.turn_on
target: !input target_light
Use the Studio Code Server Integration, (if you don’t already) it makes finding bugs easier.