Dear @atwist,
first of all apologies for long delay - I was on vacation and offline.
A small disclaimer upfront: I haven’t seen your actual MQTT traffic, so the following is a hypothesis based on the log excerpt you posted. It fits the symptoms cleanly, but please verify before changing anything.
What I see in your log:
The module connects to the broker fine
It subscribes successfully to sensor/presence
[updatePresence] fires (so messages ARE arriving — otherwise you wouldn’t see those entries triggered)
But no parse error is logged, which means JSON.parse() did not throw
The result is consistently mqttPresence=false, screen turns off after the counter or even never turns on.
Most likely cause: HomeAssistant publishes the value true directly (a JSON primitive), not a JSON object like {"presence": true}.
The module currently expects an object and reads the field onfigured in mqttPayloadOccupancyField (default: “presence”). JSON.parse("true") succeeds and returns the boolean true, but true["presence"] is undefined — which evaluates to no presence.
No exception, no parse error log, just silent false.
Quick way to verify what HA actually sends:
mosquitto_sub -h 192.168.4.160 -t sensor/presence -v
That’ll print one line per message. You’ll see exactly what arrives.
If the payload turns out to be a bare value (just true, "ON", etc.), there are two paths forward:
Either:
1. Update the module — I just pushed support for bare-string payloads exactly because of this case:
cd ~/MagicMirror/modules/MMM-PresenceScreenControl
git pull
Then add to your module config:
mqttPayloadOn: "true"
(or whatever HA actually publishes — "ON", "on", etc.; check with the mosquitto_sub command above). With this set, the module compares the raw MQTT payload exactly against your string. Match → presence detected. Anything else → no presence.
Or:
2. Configure HA to publish a JSON object like {"presence": true} / {"presence": false} instead of the bare value (e.g. via the payload template of your MQTT publish action). Then your existing config works unchanged.
The new release also adds two diagnostic improvements that would have made this immediately visible:
A new [MQTT] received (field/bare mode): mqttPresence=true/false log line on every message (debug level “complex”)
The [updatePresence] line now includes mqttPresence= alongside the other sources
Sorry for the silent-fail behavior in the previous version — that’s been a documentation gap as well as a feature gap. Let me know if my hypothesis turns out to be wrong; if HA publishes something else entirely, the diagnosis would change.
Good luck.
Warmest regards,
Ralf