我原来也不行,后来google一下代码,实装可用,但测量出来温度总是±0.3℃,你参考一下
sensor:
- platform: ntc
sensor: resistance_sensor
calibration:
b_constant: 3950
reference_temperature: 25°C
reference_resistance: 10kOhm
name: NTC Temperature B Constant
- platform: resistance
id: resistance_sensor
sensor: source_sensor
configuration: DOWNSTREAM
resistor: 10kOhm
name: Resistance Sensor
- platform: adc
id: source_sensor
pin:
number: GPIO06
mode:
input: true
pullup: true
attenuation: auto
interval:
- interval: 10s
then:
- switch.turn_on: ntc_vcc
- component.update: source_sensor
- switch.turn_off: ntc_vcc
switch:
- platform: gpio
pin:
number: GPIO15
mode:
output: true
id: ntc_vcc
|