New OneWire Integration w. ESPHome (2024.6)

I’m running an ESP8266 with two DS18B20 temperature sensors and a
‘template’ based sensor:

  • platform: template
    name: “Differenztemperatur”
    unit_of_measurement: “°C”
    device_class: “temperature”
    state_class: “measurement”
    lambda: return (Temp2->get_temp_c() - Temp1->get_temp_c() + 0.0);

This doesn’t work any longer since former get_temp_c() is no longer
available and (new) get_temp_c_() is declared ‘protected’. What can I do?

  1. Read the release notes

  2. If you want someone to read your code, post it as code.

i have similar issue

/config/esphome/espmax.yaml:774:31: error: ‘float esphome::dallas_temp::DallasTemperatureSensor::get_temp_c_()’ is protected within this context
if (id(tkotel).get_temp_c_() < id(nasosoff).state){