On tente de coder et brancher une led pour qu’elle s’allume selon une certaine température (ici celle d’un doigt) grâce à un capteur thermique
Code :
wifi:
ssid: EcologiesNumeriques
password: econum24
output:
- id: light_output
platform: gpio
pin: GPIO2
light:
- platform: binary
id: LED
output: light_output
i2c:
sda: 22
scl: 23
sensor:
- platform: tmp117
id: temperature_sensor
name: "Temperature"
update_interval: 10s
on_value_range:
- above: 31
then:
- light.turn_on: LED
- below: 31
then:
- light.turn_off: LED