Skip to content

Commit d4545c8

Browse files
committed
fix(sensors): never fall back to another probe for a mapped role
When the configured ROM of a role was missing, resolveFilter() picked the device at the default index and marked the role valid. On the shared NORVI bus this could feed the pool probe into the solar role. A mapped role now accepts only its own ROM: it reports NaN and keeps addressing the configured ROM, so it recovers once that sensor responds again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012JY8RZscs5W8tLQMuZB95K
1 parent d49ebbf commit d4545c8

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

‎docs/norvi-ae01-r.de.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,11 @@ Die 8-Byte-ROM-Adresse jedes Sensors wird im NVS gespeichert (Preferences-Namesp
171171
`ds18b20`, Keys `solar_adr` und `pool_adr`). Bei jedem folgenden Boot sucht die
172172
Firmware auf dem Bus nach einem Gerät mit der gespeicherten Adresse. Wird es
173173
gefunden, wird es unabhängig von der Scan-Reihenfolge verwendet. Wird es nicht
174-
gefunden (z. B. nach Austausch), erscheint eine Warnung und der Standard-Index
175-
kommt zum Einsatz.
174+
gefunden (z. B. nach Austausch), erscheint eine Warnung und die Rolle meldet
175+
einen ungültigen Wert (NaN), statt einen anderen Sensor zu lesen. Die Firmware
176+
spricht weiter die gespeicherte ROM an, sodass die Rolle wieder gültig wird,
177+
sobald dieser Sensor antwortet. Nach einem Austausch muss der neue Sensor im
178+
Sensor-Setup zugeordnet werden.
176179
177180
---
178181

‎docs/norvi-ae01-r.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,10 @@ The 8-byte ROM address of each sensor is stored in NVS (Preferences namespace
172172
`ds18b20`, keys `solar_adr` and `pool_adr`). On every subsequent boot, the
173173
firmware scans the bus for a device matching the stored address. If found, that
174174
device is used — regardless of its bus scan position. If the stored sensor is
175-
not found (e.g., it was replaced), the firmware prints a warning and falls back
176-
to the default device index.
175+
not found (e.g., it was replaced), the firmware prints a warning and reports
176+
that role as invalid (NaN) instead of reading another sensor. It keeps
177+
addressing the stored ROM, so the role recovers as soon as that sensor responds
178+
again. After replacing a sensor, assign the new one in the sensor setup.
177179
178180
---
179181

‎src/DallasTemperatureNode.cpp‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,13 @@ bool DallasTemperatureNode::resolveFilter() {
111111
}
112112
}
113113

114-
LOG_ERROR(" ✖ %s: filter address not found on bus! Falling back to device index %d\n", _id, deviceIndex_);
115-
if (activeSensor->getAddress(deviceAddress_, deviceIndex_)) {
116-
publishSelectedAddress();
117-
_sensorFound = true;
118-
return true;
119-
}
120-
121-
memset(deviceAddress_, 0, sizeof(deviceAddress_));
114+
// An explicitly mapped role accepts only its own ROM. Falling back to the
115+
// device index could hand the pool probe to the solar role on a shared bus.
116+
// Keep addressing the configured ROM so it is read again once it responds.
117+
char adr[18];
118+
address2String(filter, adr, sizeof(adr));
119+
LOG_ERROR(" ✖ %s: configured sensor [%s] not found on bus\n", _id, adr);
120+
memcpy(deviceAddress_, filter, sizeof(DeviceAddress));
122121
publishSelectedAddress();
123122
_sensorFound = false;
124123
return false;

0 commit comments

Comments
 (0)