New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Reply To: Twenty DS18B20 probes on one Pi: dropouts past eight sensors and how to name the keys

James has the wiring right. Two buses, 2.2k each, and you’ll be fine. We run 14 probes per bus in a pump house that way.

85.0 is the power-on value of the DS18B20, it means the read happened before a conversion finished, usually a brown-out on the bus. Drop it in code, never send it.

On the keys, change it now before you have history. Keys count as distinct names across the whole organisation (Starter caps you at 250), so ROM ids per sensor will eat that fast once you build a second cellar. Name them by position, keep a map from ROM id to position in a file on the Pi, and send all 20 in one message. One message with 20 points costs the same quota as one with one.

import glob, json, paho.mqtt.client as mqtt
MAP = {"28-0316a2794bff": "rack1.top", "28-0316a27a11ff": "rack1.mid"}  # etc
vals = {}
for p in glob.glob("/sys/bus/w1/devices/28-*/temperature"):
    rom = p.split("/")[-2]
    t = int(open(p).read()) / 1000
    if rom in MAP and t != 85.0:
        vals["cellar." + MAP[rom]] = round(t, 2)
c.publish("v1/telemetry", json.dumps(vals), qos=1)

Key rules are on Telemetry keys.

QoS 1 and a lot of patience.
Accepted solution♥ 2