The Dallas Semiconductor (later Maxim and now Analog Devices) DS18B20 is used in your Sonoff and a lot of other industry devices. Been around for ever. Robust and often stainless steel capped and shrink wrapped to make the sensor end waterproof.
The datasheet and application notes for the DS18B20 discuss long cable runs and topology, and how you have to add a biasing pullup resistor for reliability for longer runs. This boosts the parasite power onboard.
A resistor value of around 4.7k should do if one is not already present. Cheapest you can find is ok. Any wattage should be fine.
The 1-wire is a misnomer - most DS18B20’s come with three wires inside a black protective sheath, often three feet/1 metre long with pigtails or a three pin connector. Wires are black for ground, usually yellow for data, and usually red for optional power. Sometimes these colors are mixed up, often cheap Chinese factory manufacturing rejects. Best check from your supplier to make sure.
The 1-wire protocol is neat, both power and data travelling down the same wire. If not enough reaches the other end or there is electrical interference, it becomes unreliable, as you have observed. 1-wire data clashes and retransmission protocol are handled on chip.
For commercial or extremely long runs in the hundreds of meters, active boosters are used. For hobby and home use, a resistor should be used for runs of ten metres or more.
Having said all that above, the external temperature probe of the Sonoff is already 1.5 metres long and the circuit board it is connected to internally already has a resistor connected.
Putting another external one in parallel with it is only going to reduce the overall resistance, not increase it, possibly improving the reliability and parasitic power being transmitted slightly. Maybe go for a higher value externally to prevent saturation.
The solution? Roll your own. Read the Dallas Semiconductor data and application notes. Go buy a cheap ESP32, add the resistor and DS18B20 yourself and just use the standard ESPHome solution Dallas Temperature Sensor - ESPHome - Smart Home Made Simple to measure whatever you need at the end of the long cable.