For the sketch change, keep the last tripped state and only send V_TRIPPED when motion changes; add a millis() timer to resend the current state once an hour as a heartbeat. That avoids 'no movement' spam while keeping HA from treating the sensor as stale. The battery 0 entity is likely just because no battery level is being sent; if the NANO is USB-powered, you can ignore it or set it explicitly only if your node really reports battery.
M
michaelwilson
@michaelwilson
Posts
-
Help needed with connecting MySensors node to Home Assistant -
Suddenly after an HA update i get no sensor data anymoreBefore moving to MQTT, enable MY_DEBUG on the affected sensor node and on the gateway, then force that child value to report. If the node never prints the missing value, the issue is in the sketch, sensor read, or send interval, and MQTT will not help. If the node prints it but the gateway does not, focus on the radio/transport or serial path. The occasional garbage also makes me suspect baud, cable, or power noise; confirm both ends use the same baud and try a short, well-connected USB cable.