How lucmeynkens/dwaalspoor works
Dwaalspoor is a care-facility monitoring prototype for supporting residents with dementia who wander. Its main workflow sends sensor detections over MQTT; the core updates zone, person and time-of-day context, decides whether to follow a moving resident at night, and can publish a light command for an actuator. The tree also exposes position sensing and AI-related topic conventions, but the sampled code does not establish their full runtime behavior. Relationships below are limited to shown calls or documented topic conventions.
Main entry points: dwaalspoor_core.py Core event handler · mqtt_manager.py MQTT manager · topics.py Topic conventions · sensor.py Presence sensor
Components 16
Runtime and messaging
- Application entry
main.py - MQTT manager
communication/mqtt_manager.py - Topic conventions
communication/topics.py
Sensor input
- Presence sensor
devices/sensors/sensor.py - Combined sensor
devices/sensors/combisensor.py - Sensor simulator
devices/sensors/simulator.py
Resident context and decisions
- Core event handler
core/dwaalspoor_core.py - Zone state
models/zone.py - Resident movement
models/person.py - Movement context
models/context.py - Decision engine
core/decision_engine.py
Actuation and integrations
- Light actuator
devices/actuators/actuator.py - Actuator simulator
devices/actuators/simulator.py - AI simulator
devices/ai/simulator.py
Other components
- Sensor device
- MQTT broker
Connections 25
- Sensor device → Presence sensor: provides detections
- Application entry → MQTT manager: creates and connects
main.py - Application entry → Core event handler: starts core
main.py - Application entry → MQTT manager: starts message loop
main.py - MQTT manager → MQTT broker: connects and exchanges
communication/mqtt_manager.py - Presence sensor → Topic conventions: uses presence topic
devices/sensors/sensor.py - Presence sensor → MQTT manager: publishes detection
devices/sensors/sensor.py - Combined sensor → Topic conventions: uses input topics
devices/sensors/combisensor.py - Combined sensor → MQTT manager: publishes detections
devices/sensors/combisensor.py - Sensor simulator → Presence sensor: simulates input
devices/sensors/simulator.py - Sensor simulator → MQTT manager: connects broker
devices/sensors/simulator.py - Core event handler → MQTT manager: subscribes and publishes
core/dwaalspoor_core.py - Core event handler → Topic conventions: uses subscription and output topics
core/dwaalspoor_core.py - Core event handler → Zone state: updates presence
core/dwaalspoor_core.py - Core event handler → Resident movement: updates location
core/dwaalspoor_core.py - Core event handler → Movement context: updates context
core/dwaalspoor_core.py - Movement context → Resident movement: reads movement fields
models/context.py - Core event handler → Decision engine: requests action
core/dwaalspoor_core.py - Decision engine → Movement context: checks movement and night
core/decision_engine.py - Core event handler → Light actuator: publishes light command
core/dwaalspoor_core.py - Light actuator → Topic conventions: uses light topic
devices/actuators/actuator.py - Light actuator → MQTT manager: subscribes to commands
devices/actuators/actuator.py - Actuator simulator → Light actuator: starts actuator
devices/actuators/simulator.py - Actuator simulator → MQTT manager: connects broker
devices/actuators/simulator.py - AI simulator → Topic conventions: possible AI topics