I have built a setup where I have a raspberry pi with a PIR sensor connected to the GPIO. When the sensor detects movement it sends a MQTT message to another raspberry pi running Home Assistant.
This python program uses the API to sends a notification with time stamp to meshtastic when motion is detected. It also subscribes to a MQTT-topic (temperature sensor) and relays that value to meshtastic.
https://github.com/pwilen/meshtastic/blob/master/meshtastic_mqtt_pir