Bonjour
besoin d’in petit coup de pouce sur du code « esphom »
plus bas le code pour un nodemcu de surveillance de ma chaudière (2 dallas + 1 TC type K + 1 analog A0 + 1 Pixel WS21812 - ça marche déja pas mal
j’ai un pixel indicateur d’état qui commence rouge puis passe vert quand il a le wifi a la fin du boot
je voudrais tester toutes les 5 minutes pour le mettre rouge si j’ai plus de wifi
QQun a déja fait ça, ? j’ai commençé mais tout commenté car je trouve pas la syntaxe
esphome:
name: n175_chaudiere
platform: ESP8266
board: nodemcuv2
on_boot:
- priority: 600.0 # after sensor setup, before WIFI initialization
then:
- light.turn_on:
id: n175_pixel
brightness: 25%
red: 100%
green: 0%
blue: 0%
- priority: 250.0 #after wifi initialized
then:
if:
condition:
wifi.connected:
then:
- light.turn_on:
id: n175_pixel
brightness: 25%
red: 0%
green: 50%
blue: 0%
wifi:
ssid: "xxxxx"
password: "yyyyy"
manual_ip:
static_ip: 192.168.1.175
gateway: 192.168.1.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "n179_a1b2c3d4"
password: "a1b2c3d4"
captive_portal:
web_server:
port: 80
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
########################### Déclaration protocoles DALLAS + SPI
dallas:
- pin: D5 #GPIO14 - Sensor IOT
update_interval: 30s
spi: ####################### SPI : RGB Header : +V - CLK=C0 - CS=D1 - SO=D2 - GND
miso_pin: D2
clk_pin: D0
##### declaration DS18B20 1 et 2 + TC Max 6675 + Analog A0 + Pixel WS2812 D4
switch:
- platform: restart
name: "n175_Restart"
sensor:
- platform: dallas
address: 0x0D8000001F97B428 #index: 0
name: "n175_temp_Chaudiere Depart"
id: "n175_temp_depart"
- platform: dallas
address: 0x048000001F8F3C28 #index: 1
name: "n175_temp_Chaudiere Retour"
id: "n175_temp_retour"
- platform: max6675
name: "n175_temp_Chaudiere_Burleur"
id: "n175_temp_bruleur"
cs_pin: D1
update_interval: 30s
- platform: adc
pin: A0
name: "n175_ADC A0"
id: "n175_a0"
update_interval: 30s
light:
- platform: fastled_clockless
chipset: WS2812
pin: D4
num_leds: 1
rgb_order: GRB
name: "n175_pixel Chaudiere"
id: "n175_pixel"
#time:
# - platform: homeassistant
# id: homeassistant_time
# on_time:
# # Every 5 minutes
# - seconds: 0
# minutes: /5
# then:
# - if:
# condition:
# wifi.connected: # la faut trouver le NOT() pour faire "not connected"
# then:
# - light.turn_on:
# id: n175_pixel
# brightness: 25%
# red: 100%
# green: 50%
# blue: 0%