Hello everyone,
I’m facing a very strange and persistent issue with my MySensors Serial Gateway setup, and I’ve completely hit a wall after many hours of extensive troubleshooting. I would be incredibly grateful for any insights or help.
The Problem:
My Arduino Mega node successfully connects to Home Assistant as a serial gateway. The debug logs clearly show the node connecting, the sketch info being received, and then the presentation messages for all 25 child sensors being received and processed as “Node update” events.
However, despite the logs confirming the presentation, Home Assistant only creates a single entity for the node itself (sensor.node_0_battery
). None of the 25 child sensors (which should be switch
entities) are ever created or registered. The integration page stubbornly shows “1 device, 1 entity”.
My Setup:
- Home Assistant Core Version: 2024.6.2
- Installation Type: Home Assistant OS
- Hardware: Raspberry Pi 4
- Gateway Hardware: Arduino Mega 2560
- Radio Type: NRF24L01+ (connected directly to Arduino)
- Connection Type: Serial Gateway via USB
Key Log Snippets Showing the Contradiction:
The logs show a perfect “clean slate” startup after deleting the integration and all persistence files.
First, HA confirms the persistence file is gone: WARNING (SyncWorker_1) [mysensors.persistence] File does not exist or is not readable: /config/mysensors_...json
Then, the gateway connects successfully and presents its sketch info (5.0-Final-Corrected
): INFO (MainThread) [mysensors.transport] Connected to Serial<...>
DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;12;5.0-Final-Corrected
Then, HA successfully receives the presentation for all 25 children. It acknowledges them as updates, but never registers the entities:
DEBUG (MainThread) [mysensors.transport] Receiving 0;1;0;0;3; DEBUG (MainThread) [homeassistant.components.mysensors.gateway] Node update: node 0 child 1 DEBUG (MainThread) [mysensors.transport] Receiving 0;2;0;0;3; DEBUG (MainThread) [homeassistant.components.mysensors.gateway] Node update: node 0 child 2 ... DEBUG (MainThread) [mysensors.transport] Receiving 0;25;0;0;3; DEBUG (MainThread) [homeassistant.components.mysensors.gateway] Node update: node 0 child 25
The only entity that ever gets registered is the default battery sensor for the node itself: INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.mysensors entity: sensor.none_0_battery
Troubleshooting Steps Already Taken (with no success):
We have tried an exhaustive list of solutions:
- Full “Clean Slate” Procedure: This has been done multiple times: deleting the MySensors integration, deleting all
mysensors_*.json
files from/config
, restarting HA, re-adding the integration, and then resetting the Arduino node. - Verified Connection: The logs confirm a successful connection on the correct port (
/dev/serial/by-id/...
) and baud rate (115200
). - Added Presentation Delay: A
delay(50);
was added in the Arduinopresentation()
loop to prevent message flooding. - Cleared Arduino EEPROM: A dedicated sketch was used to completely wipe the Arduino’s EEPROM to ensure no old states were stored on the device.
- Attempted Static Node ID: We tried setting
#define MY_NODE_ID 1
in the sketch. However, the logs confirmed that withMY_GATEWAY_SERIAL
defined, the node always presents as Node 0. - Corrected
receive()
logic: We ensured thereceive()
function in the sketch only acts onC_SET
commands to avoid any conflicts with presentation messages. - Browser Cache: Hard-refreshed (
Ctrl+F5
) and cleared the browser cache completely.
Despite all this, the result is always the same: the backend logs the “Node update” for all children, but the entities are never created in the registry.
My Question:
Has anyone encountered a situation where Node update
is logged for children, but the entities are not created? Could this be a deeper bug in the entity registry or the MySensors component’s interaction with it, specifically concerning children of the gateway node (Node 0)?
I feel like I’m at the absolute end of the road for what can be debugged from a user perspective. Any help or insight would be immensely appreciated.
Thank you!