Après m'être battu pendant quelque temps avec un D1 mini 8266, le wemos shield et ESPHome, le D1 rebootant de manière aléatoire, voici ma config ESPHome enfin stable.
Spoiler : j'avais récupéré d'une autre config teleinfo la ligne "tx_pin: GPIO1", une fois commentée, la configuration est stable.
Disclaimer : Tous les informations disponibles dans le mode standard du Linky ne sont pas reprises dans la config ci-dessous. La config est pour un Linky monophasé.
esphome:
name: "esp82-01"
esp8266:
board: nodemcuv2 #d1_mini
# Enable logging
logger:
level: DEBUG
hardware_uart: UART1
#baud_rate: 0
# Enable Home Assistant API
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp82-01"
password: !secret wifi_fallback_password
captive_portal:
uart:
id: uart_bus
rx_pin: GPIO13
#tx_pin: GPIO1 # Was crashing when tx_pin was set
baud_rate: 9600
parity: EVEN
data_bits: 7
teleinfo:
id: myteleinfo
update_interval: 15s
historical_mode: false
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 60s
unit_of_measurement: dB
accuracy_decimals: 0
force_update: false
icon: mdi:wifi
- platform: uptime
id: uptime_seconds
name: "Uptime Sensor"
update_interval: 60s
unit_of_measurement: s
accuracy_decimals: 0
force_update: false
icon: mdi:timer
- platform: teleinfo
tag_name: "IRMS1"
name: "Intensite Inst."
unit_of_measurement: "A"
icon: mdi:current-ac
teleinfo_id: myteleinfo
- platform: teleinfo
tag_name: "URMS1"
name: "Tension Inst."
unit_of_measurement: "V"
icon: mdi:current-ac
teleinfo_id: myteleinfo
- platform: teleinfo
tag_name: "SINSTS"
name: "Puissance Inst."
device_class: power
unit_of_measurement: "VA"
icon: mdi:flash
teleinfo_id: myteleinfo
- platform: teleinfo
tag_name: "EASF01"
name: "Index heures creuses"
unit_of_measurement: "kWh"
accuracy_decimals: 3
device_class: energy
state_class: "total_increasing"
icon: mdi:gauge
teleinfo_id: myteleinfo
id: heures_creuses
filters:
- multiply: 0.001
- platform: teleinfo
tag_name: "EASF02"
name: "Index heures pleines"
unit_of_measurement: "kWh"
accuracy_decimals: 3
device_class: energy
state_class: "total_increasing"
icon: mdi:gauge
teleinfo_id: myteleinfo
id: heures_pleines
filters:
- multiply: 0.001
text_sensor:
- platform: template
name: Uptime
update_interval: 30s
icon: mdi:clock-start
lambda: |-
int seconds = (id(uptime_seconds).state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
if ( days ) {
return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else if ( hours ) {
return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else if ( minutes ) {
return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else {
return { (String(seconds) +"s").c_str() };
}
- platform: teleinfo
tag_name: "LTARF"
name: "Tarif en cours"
icon: mdi:clock-time-nine-outline