Defang Wyze v2 MQTT Motion Event Snapshot is one image behind

Summary: A motion event triggered now shows me the payload image of the previous motion event. The next motion event will show me the image I expected to see now.

Running latest Defang Camera firmware on Wyze v2 Pan/Tilt I have OSD enable to timestamp the image taken within the image. Defang is publishing topic and image snapshot to latest Mosquitto. HA 0.118.2 is grabbing snapshot from MQTT writes it to disk. The timestamp of that file matches the time of the event (so its being updated). That image is sent to my Slack channel with timestamp in the message.

Everything is “working”… but i noticed the timestamp between image and message body do not match. The timestamp in the image is always the timestamp of the previous motion alert. I can’t figure out how my image is one behind.

alias: CAMERA Notify MOTION
description: ''
  - platform: mqtt
    topic: myhome/outside_cam/motion
    payload: 'ON'
condition: []
  - service: camera.snapshot
      filename: '/tmp/snapshot_{{ trigger.topic.split(''/'')[-2] }}.jpg'
    entity_id: camera.outside_cam_motion_snapshot
  - delay: '00:00:05'
  - service: notify.slack_notify
      message: >-
        Motion Detected by {{ trigger.topic.split('/')[-2] }} at
        {{now().strftime('%m-%d-%Y %H:%M:%S')}}
          path: '/tmp/snapshot_{{ trigger.topic.split(''/'')[-2] }}.jpg'

The filename generated will be: /tmp/snapshot_outside_cam.jpg