Last active
June 20, 2024 19:49
-
-
Save hobbe/ed3b9d51d4f7c1491b8d11edd6ed018b to your computer and use it in GitHub Desktop.
TéléInfo Linky sur ESPHome
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
| # # TeleInfo sensors on ESPHome # | |
| # | |
| # Use of the `teleinfo` component provided by ESPHome: | |
| # [teleinfo](https://esphome.io/components/sensor/teleinfo.html) | |
| # | |
| # To create the TeleInfo adapter, see articles at: | |
| # | |
| # - <https://github.com/schmurtzm/Teleinfo-TIC-with-ESPhome> | |
| # - <http://hallard.me/libteleinfo> | |
| # | |
| # ## secrets.yaml ## | |
| # | |
| # wifi_ssid: HomeWifi | |
| # wifi_password: Pa$$w0rd | |
| substitutions: | |
| devicename: "esplinky" | |
| friendly_name: "ESP Linky" | |
| esphome: | |
| name: ${devicename} | |
| friendly_name: ${friendly_name} | |
| comment: Linky TeleInfo reader | |
| project: | |
| name: Linky.TeleInfo | |
| version: "1.2.0" | |
| min_version: 2024.6.0 | |
| esp8266: | |
| board: nodemcuv2 | |
| logger: | |
| level: WARN # DEBUG to view Linky tags | |
| baud_rate: 0 # Disable logging via UART to avoid crashes with ESP_LOGD on NodeMCU, else 115200 | |
| hardware_uart: UART1 # Use UART1 if UART logging required on NodeMCU | |
| esp8266_store_log_strings_in_flash: false # Disable logging to flash on NodeMCU | |
| wifi: | |
| ssid: !secret wifi_ssid | |
| password: !secret wifi_password | |
| fast_connect: false # Disable fast connect on NodeMCU | |
| ap: | |
| ssid: "${friendly_name} Hotspot" | |
| password: "${devicename}" | |
| uart: | |
| rx_pin: D7 # Lolin NodeMCU | |
| baud_rate: 1200 # Linky mode historique | |
| parity: EVEN # Linky mode historique | |
| data_bits: 7 # Linky mode historique | |
| ota: | |
| platform: esphome | |
| api: | |
| # captive_portal: | |
| teleinfo: | |
| id: espteleinfo | |
| update_interval: 60s | |
| historical_mode: true | |
| binary_sensor: | |
| - platform: status | |
| name: "Status" | |
| - platform: template | |
| # Flag 'heures creuses' | |
| name: "HC" | |
| id: "hc" | |
| lambda: |- | |
| return (id(ptec).state == "HC.."); | |
| - platform: template | |
| # Flag 'heures pleines' | |
| name: "HP" | |
| id: "hp" | |
| lambda: |- | |
| return (id(ptec).state == "HP.."); | |
| sensor: | |
| - platform: uptime | |
| name: "Uptime" | |
| - platform: wifi_signal | |
| name: "WiFi Signal" | |
| disabled_by_default: true | |
| device_class: signal_strength | |
| update_interval: 60s | |
| - platform: teleinfo | |
| # Index option Heures Creuses | |
| teleinfo_id: espteleinfo | |
| tag_name: "HCHC" | |
| id: "hchc" | |
| name: "HCHC" | |
| icon: mdi:counter | |
| unit_of_measurement: "kWh" | |
| accuracy_decimals: 0 | |
| device_class: energy | |
| state_class: total_increasing | |
| filters: | |
| - multiply: 0.001 | |
| - platform: teleinfo | |
| # Index option Heures Pleines | |
| teleinfo_id: espteleinfo | |
| tag_name: "HCHP" | |
| id: "hchp" | |
| name: "HCHP" | |
| icon: mdi:counter | |
| unit_of_measurement: "kWh" | |
| accuracy_decimals: 0 | |
| device_class: energy | |
| state_class: total_increasing | |
| filters: | |
| - multiply: 0.001 | |
| - platform: teleinfo | |
| # Puissance apparente | |
| teleinfo_id: espteleinfo | |
| tag_name: "PAPP" | |
| id: "papp" | |
| name: "PAPP" | |
| icon: mdi:flash | |
| unit_of_measurement: "VA" | |
| device_class: apparent_power | |
| state_class: measurement | |
| - platform: teleinfo | |
| # Intensité instantanée | |
| teleinfo_id: espteleinfo | |
| tag_name: "IINST" | |
| id: "iinst" | |
| name: "IINST" | |
| icon: mdi:current-ac | |
| unit_of_measurement: "A" | |
| device_class: current | |
| state_class: measurement | |
| - platform: teleinfo | |
| # Intensité maximale appelée | |
| teleinfo_id: espteleinfo | |
| tag_name: "IMAX" | |
| id: "imax" | |
| name: "IMAX" | |
| icon: mdi:current-ac | |
| unit_of_measurement: "A" | |
| device_class: current | |
| state_class: measurement | |
| entity_category: "diagnostic" | |
| filters: | |
| - sliding_window_moving_average: | |
| window_size: 10 | |
| send_every: 10 | |
| - platform: teleinfo | |
| # Intensité souscrite | |
| teleinfo_id: espteleinfo | |
| tag_name: "ISOUSC" | |
| id: "isousc" | |
| name: "ISOUSC" | |
| icon: mdi:current-ac | |
| unit_of_measurement: "A" | |
| device_class: current | |
| state_class: measurement | |
| entity_category: "diagnostic" | |
| filters: | |
| - sliding_window_moving_average: | |
| window_size: 10 | |
| send_every: 10 | |
| - platform: template | |
| # Sensor for usage load in % (IINST/ISOUSC) | |
| id: iusage | |
| name: "Usage Load" | |
| icon: mdi:gauge | |
| unit_of_measurement: "%" | |
| accuracy_decimals: 0 | |
| lambda: |- | |
| return (id(iinst).state / id(isousc).state * 100); | |
| button: | |
| - platform: restart | |
| name: "Restart" | |
| text_sensor: | |
| - platform: wifi_info | |
| ip_address: | |
| name: "IP" | |
| icon: mdi:ip-network | |
| disabled_by_default: true | |
| mac_address: | |
| name: "MAC" | |
| icon: mdi:network | |
| disabled_by_default: true | |
| filters: | |
| to_upper: | |
| - platform: teleinfo | |
| # Adresse du compteur | |
| teleinfo_id: espteleinfo | |
| tag_name: "ADCO" | |
| id: "adco" | |
| name: "ADCO" | |
| icon: mdi:tag-text | |
| entity_category: "diagnostic" | |
| - platform: teleinfo | |
| # Option tarifaire choisie | |
| teleinfo_id: espteleinfo | |
| tag_name: "OPTARIF" | |
| id: "optarif" | |
| name: "OPTARIF" | |
| icon: mdi:tag-heart | |
| entity_category: "diagnostic" | |
| - platform: teleinfo | |
| # Période Tarifaire en cours | |
| teleinfo_id: espteleinfo | |
| tag_name: "PTEC" | |
| id: "ptec" | |
| name: "PTEC" | |
| icon: mdi:timeline-check | |
| entity_category: "diagnostic" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment