Turning sonoff minir2 into thermostat


Trace to S_OUT were cut and stripped to make pads for resistor taken from R8. Wire is 0.14mm²

I tweaked the resistor value to 1.04kOhm for more accurate results.

  - platform: adc
    id: adc_sensor
    pin: A0
    update_interval: never

  - name: resistance
    platform: resistance
    entity_category: diagnostic
    id: resistance_sensor
    sensor: adc_sensor
    resistor: 1.04kOhm
    configuration: UPSTREAM

  - platform: ntc
    name: 'Temperature'
    id: temperature
    sensor: resistance_sensor
    calibration:
      b_constant: 3380
      reference_temperature: 25°C
      reference_resistance: 10kOhm

Note, sensor terminals are not galvanic isolated from the mains power!