Last active
January 2, 2024 12:12
-
-
Save haade-administrator/1a1dcda522d69522b4ab4a70e771d262 to your computer and use it in GitHub Desktop.
configuration téléinfo esphome avec homeassistant et Pitinfo plus wemos d1 heure pleine et heure creuse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
substitutions: | |
devicename: TELEINFO-PiTinfo | |
friendly_name: téléinformation home-assistant | |
device_description: remontée des infos compteur électrique avec PiTinfo | |
esphome: | |
name: $devicename | |
comment: ${device_description} | |
platform: ESP8266 | |
board: d1_mini | |
# Connection réseau wifi | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_password | |
# Activer le point d'accès de secours (portail captif) en cas d'échec de la connexion wifi | |
ap: | |
ssid: "${friendly_name} Fallback AP" | |
password: "!secret fallback_ap_password" | |
ota: | |
password: !secret ota_password | |
# Activer la journalisation | |
logger: | |
baud_rate: 0 | |
level: INFO | |
esp8266_store_log_strings_in_flash: False | |
captive_portal: | |
# Pour les abonnements au tarif HEURE PLEINE et HEURE CREUSE | |
uart: | |
id: uart_bus | |
rx_pin: GPIO3 # Pin Rx | |
baud_rate: 1200 | |
parity: EVEN | |
data_bits: 7 | |
binary_sensor: | |
- platform: status | |
name: "Teleinfo Status" | |
teleinfo: | |
update_interval: 30s | |
historical_mode: true | |
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: "ADCO" | |
name: "Adresse du compteur" | |
unit_of_measurement: "" | |
icon: mdi:eye | |
- platform: teleinfo | |
tag_name: "IMAX" | |
name: "Intensite max" | |
unit_of_measurement: "A" | |
icon: mdi:current-ac | |
- platform: teleinfo | |
tag_name: "ISOUSC" | |
name: "Intensite souscrite" | |
unit_of_measurement: "A" | |
icon: mdi:current-ac | |
- platform: teleinfo | |
tag_name: "IINST" | |
name: "Intensite" | |
unit_of_measurement: "A" | |
icon: mdi:current-ac | |
- platform: teleinfo | |
tag_name: "HCHC" | |
name: "Index heures creuses" | |
unit_of_measurement: "Wh" | |
icon: mdi:gauge | |
id: heures_creuses | |
- platform: teleinfo | |
tag_name: "HCHP" | |
name: "Index heures pleines" | |
unit_of_measurement: "Wh" | |
icon: mdi:gauge | |
id: heures_pleines | |
- platform: teleinfo | |
tag_name: "PAPP" | |
name: "Puissance" | |
unit_of_measurement: "VA" | |
icon: mdi:flash | |
- platform: teleinfo | |
tag_name: "EAIT" | |
name: "Energie active injectee totale" | |
unit_of_measurement: "Wh" | |
icon: mdi:gauge | |
text_sensor: | |
- platform: template | |
name: Uptime | |
update_interval: 60s | |
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: "OPTARIF" | |
name: "Type abonnement" | |
icon: mdi:handshake | |
- platform: teleinfo | |
tag_name: "PTEC" | |
name: "Tarif en cours" | |
icon: mdi:clock-time-nine-outline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment