esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

Internal buffer full message #2981

Open seblang opened 2 years ago

seblang commented 2 years ago

The problem

I a trying to use teleinfo ESP. All is going weel but when I start my module i have a message in logs "[teleinfo:060]: Internal buffer full" and no information are sended to HA

Which version of ESPHome has the issue?

ESPHome version 2022.1.2

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

Home Assistant 2021.12.10

What platform are you using?

ESP8266

Board

esp_01s

Component causing the issue

No response

Example YAML snippet

esphome:
  name: teleinfokit
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "XXXXXXXX"
  password: "XXXXXXXX"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "TeleInfoKit"
    password: !secret ap_key

captive_portal:

# Enable logging
logger:     
  baud_rate: 0   # disable logging via UART, help to avoid numerous crash with ESP_LOGD
  level: INFO   # INFO for less log, put DEBUG to view all the linky's "étiquettes" received  in the logs
  esp8266_store_log_strings_in_flash: False     #  :doc:`recommanded for ESP8266 </components/sensor/custom>`

# Enable Home Assistant API
api:
  password: XXXXXXXXXX

ota:
  password: !secret ota_pass
  id: my_ota

uart:
  id: uart_bus
  rx_pin: GPIO3
  baud_rate: 9600
  parity: EVEN
  data_bits: 7

teleinfo:
  id: myteleinfo
  update_interval: 30s
  historical_mode: false

sensor:
  - platform: teleinfo
    tag_name: "HCHC"
    id: hchc
    name: "Index Heures Creuses"
    unit_of_measurement: "kWh"
    accuracy_decimals: 3
    icon: mdi:flash
    device_class: energy
    state_class: total_increasing
    teleinfo_id: myteleinfo
    filters:
      - multiply: 0.001
  - platform: teleinfo
    tag_name: "HCHP"
    id: hchp
    name: "Index Heures Pleines"
    unit_of_measurement: "kWh"
    accuracy_decimals: 3
    icon: mdi:flash
    device_class: energy
    state_class: total_increasing
    teleinfo_id: myteleinfo
    filters:
      - multiply: 0.001
  - platform: teleinfo
    tag_name: "PAPP"
    id: papp
    name: "Puissance Actuelle"
    unit_of_measurement: "VA"
    state_class: "measurement"
    icon: mdi:flash
    teleinfo_id: myteleinfo
  - platform: teleinfo
    tag_name: "IINST"
    id: iinst
    name: "Intensité Actuelle"
    unit_of_measurement: "A"
    device_class: current
    state_class: "measurement"
    icon: mdi:flash
    teleinfo_id: myteleinfo
  - platform: teleinfo
    tag_name: "EAIT"
    id: EAIT
    name: "Energie active injectée totale"
    unit_of_measurement: "Wh"
    state_class: "measurement"
    icon: mdi:flash
    teleinfo_id: myteleinfo
  - platform: teleinfo
    tag_name: "EAST"
    id: EAST
    name: "Energie active soutirée totale"
    unit_of_measurement: "Wh"
    state_class: "measurement"
    icon: mdi:flash
    teleinfo_id: myteleinfo
  - platform: teleinfo
    tag_name: "SINSTS"
    id: SINSTS
    name: "Puissance app. Instantanée soutirée"
    unit_of_measurement: "W"
    device_class: current
    state_class: "measurement"
    icon: mdi:flash
    teleinfo_id: myteleinfo  
  - platform: teleinfo
    tag_name: "SINSTI"
    id: SINSTI
    name: "Puissance app. Instantanée Injecté"
    unit_of_measurement: "W"
    device_class: current
    state_class: "measurement"
    icon: mdi:flash
    teleinfo_id: myteleinfo

Anything in the logs that might be useful for us?

INFO Reading configuration /config/esphome/teleinfo.yaml...
INFO Starting log output from teleinfokit.local using esphome API
INFO Successfully connected to teleinfokit.local
[20:23:08][I][app:102]: ESPHome version 2022.1.2 compiled on Jan 25 2022, 20:12:19
[20:23:32][W][teleinfo:060]: Internal buffer full

Additional information

No response

probot-esphome[bot] commented 2 years ago

Hey there @0hax, mind taking a look at this issue as it has been labeled with an integration (teleinfo) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

0hax commented 2 years ago

Hi, Thanks for reporting the issue. Does it happen with earlier versions? Like 2021.10.3 for example.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

gbrd commented 8 months ago

I have this problem with esp32 not with esp8266 (standard mode)

vytdv commented 8 months ago

Hello, I have the same problem on a nodemcuv2 after switching from history mode to standard mode. My ESPHome version is 2023.12.5.

vytdv commented 8 months ago

If it can help, here is the uart debug log that I have :

[18:22:12][D][uart_debug:114]: <<< 00:00:00:02:00:00:20:24:20:20:20:20:22:30:20:00:00:08:00:00:00:02:04:20:20:00:20:20:26:22:30:30:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:22:22:26:20:24:30:30:20:00:46:08:00:00:00:02:04:20:22:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:04:08:00:00:00:02:04:20:24:00:20:20:20:20:20:20:20:20:20:00:06:08:00:00:00:02:04:20:26:00:20:20:20:20
[18:22:12][D][uart_debug:114]: <<< 20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:00:20:20:00:20:22:20:20:20:20:30:22:20:00:30:08:00:00:00:02:00:20:20:00:20:20:20:20:30:30:20:20:20:00:40:08:00:00:00:02:00:20:22:00:20:20:20:20:20:30:26:20:22:00:00:08:00:00:00:02:00:20:20:00:20:20:22:26:20:20:22:20:20:00:32:08:02:00
[18:22:13][D][uart_debug:114]: <<< 00:08:02:20:00:20:20:22:00:20:08:00:00:00:08:02:20:00:20:22:24:00:02:08:00:00:00:00:04:00:20:30:00:00:08:00:00:02:0E:00:00:00:20:30:00:00:08:00:02:00:0C:02:00:20:00:20:20:24:20:20:00:20:08:02:02:08:00:10:0C:00:00:20:20:20:20:20:30:20:20:20:20:20:22:00:20:26:26:20:20:00:04:08:00:02:08:00:10:0C:08:20:00:00:20:20:20:20:20:30:20:20:20:20:20:20:00:20:20:22:20:20:00:00:08:00:02:42:00:02:0C:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:20:20:20:20:00
[18:22:13][D][uart_debug:114]: <<< 20:08:00:02:42:40:02:0C:08:20:00:00:20:20:20:20:20:20:20:26:22:20:20:20:00:20:20:22:26:20:00:10:08:02:00:08:0E:10:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:22:20:00:02:08:00:02:00:06:00:00:20:20:40:00:02:20:20:20:00:00:08:02:02:00:00:00:02:02:00:20:20:20:20:26:26:20:20:20:22:24:20:00:08:08:00:04:00:00:02:00:20:20:00:00:08:00:00:00:00:00:00:00:20:24:20:20:20:20:20:30:20:20:20:20:00:00:30:08:00:0C:06:00:04:00:00:00:00:08:00:00:0C:00:0E:02
[18:22:13][D][uart_debug:114]: <<< 00:00:00:42:40:20:00:18:08:00:08:00:00:00:04:00:00:00:00:00:00:00:00:00:00:08:00:40:4E:40:00:00:00:00:08:00:00:00:02:00:00:20:24:20:20:20:20:22:30:20:00:00:08:00:00:00:02:04:20:20:00:20:20:26:22:30:30:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:22:22:26:20:24:30:30:20:00:00:08:00:00:00:02:04:20:22:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20
[18:22:13][D][uart_debug:114]: <<< 00:04:08:00:00:00:02:04:20:24:00:20:20:20:20:20:20:20:20:20:00:06:08:00:00:00:02:04:20:26:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:00:20:20:00:20:22:20:20:20:20:30:22:20:00:30:08:00:00:00:02:00:20:20:00:20:20:20:20:30:30:20:20:20:00:00:08:00:00:00:02:00:20:22
[18:22:13][D][uart_debug:114]: <<< 00:20:20:20:20:20:30:26:20:22:00:00:08:00:00:00:02:00:20:20:00:20:20:22:26:20:20:22:20:24:00:38:08:00:00:02:08:02:20:00:20:20:22:00:20:08:00:00:00:08:02:20:00:20:22:20:00:02:08:00:00:00:00:04:00:20:30:00:00:08:00:00:02:0E:00:00:00:20:30:00:00:08:00:02:00:0C:02:00:20:00:20:20:24:20:20:00:08:08:00:02:48:00:10:0C:00:00:20:20:20:20:20:30:20:20:20:20:20:22:00:20:26:26:20:20:00:04:08:02:02:08:00:10:0C:08:20:00:00:20:20:20:20:20:30:20:20:20:20:20:20:00
[18:22:13][D][uart_debug:114]: <<< 20:20:22:20:20:00:00:08:00:42:42:00:02:0C:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:20:20:20:20:00:20:08:00:02:42:00:02:0C:08:20:00:00:20:20:20:20:20:20:20:26:22:20:20:20:00:20:20:22:26:20:00:10:08:02:00:08:0E:10:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:22:20:00:02:08:00:02:00:06:00:00:20:20:00:00:02:20:20:20:00:00:08:02:00:02:00:00:02:02:00:20:20:20:20:24:26:20:20:20:22:24:20:00:08:08:00:04:00:00:02:00:20:20:00:00:08:00:00:00:00
[18:22:14][D][uart_debug:114]: <<< 00:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:00:30:08:00:0C:06:00:04:00:00:00:00:4C:40:00:0C:00:0E:02:00:00:00:02:00:20:00:18:08:00:08:00:00:00:04:00:00:40:40:00:00:00:00:00:00:08:00:00:0C:40:20:20:00:00:08:00:00:00:02:00:00:20:24:20:20:20:20:22:30:20:00:00:08:00:00:00:02:04:20:20:00:20:20:26:22:30:30:20:20:20:00:44:08:00:00:00:02:04:20:20:00:20:22:22:26:20:24:30:30:20:00:00:08:00:00:00:02:04:20:22:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00
[18:22:14][D][uart_debug:114]: <<< 00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:04:08:00:00:00:02:04:20:24:00:20:20:20:20:20:20:20:20:20:00:06:08:00:00:00:02:04:20:26:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:00:20:20:00:20:22:20:20
[18:22:14][D][uart_debug:114]: <<< 20:20:30:22:20:00:30:08:00:00:00:02:00:20:20:00:20:20:20:20:30:30:20:20:20:00:00:08:00:00:00:02:00:20:22:00:20:20:20:20:20:30:26:20:22:00:00:08:00:00:00:02:00:20:20:00:20:20:22:26:20:20:22:20:24:00:38:08:00:00:02:08:02:20:00:20:20:22:00:20:08:00:00:00:08:02:20:00:20:22:20:00:02:08:00:00:00:00:04:00:20:30:00:00:08:00:00:02:0E:00:00:00:20:30:00:00:08:00:02:00:0C:02:00:20:00:20:20:24:20:20:00:08:08:02:02:08:00:10:0C:00:00:20:20:20:20:20:30:20:20:20
[18:22:14][D][uart_debug:114]: <<< 20:20:22:00:20:26:26:20:20:00:04:08:00:02:08:00:10:0C:08:20:00:00:20:20:20:20:20:30:20:20:20:20:20:20:00:20:20:22:20:20:00:00:08:00:02:42:00:02:0C:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:20:20:20:20:00:20:08:00:02:42:40:02:0C:08:20:00:00:20:20:20:20:20:20:20:26:22:20:20:20:00:20:20:22:26:20:00:10:08:02:00:08:0E:10:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:22:20:00:02:08:00:02:00:06:00:00:20:20:40:00:02:20:20:20:00:00:08:02:02:00
[18:22:14][D][uart_debug:114]: <<< 00:00:02:02:00:20:20:20:20:26:26:20:20:20:22:24:20:00:08:08:00:04:00:00:02:00:20:20:00:00:08:00:00:00:00:00:00:00:20:24:20:20:20:20:20:30:20:20:20:20:00:00:30:08:00:0C:06:00:04:00:00:00:00:08:00:00:0C:00:0E:02:00:00:00:02:40:20:00:18:08:00:08:00:00:00:04:00:00:00:00:00:00:00:00:00:00:08:00:40:4E:40:00:00:00:00:08:00:00:00:02:00:00:20:24:20:20:20:20:22:30:20:00:00:08:00:00:00:02:04:20:20:00:20:20:26:22:30:30:20:20:20:00:00:08:00:00:00:02:04:20:20
[18:22:14][W][teleinfo:060]: Internal buffer full
[18:22:15][D][uart_debug:114]: <<< 00:20:22:22:26:20:24:30:30:20:00:00:08:00:00:00:02:04:20:22:00:20:20:20:20:20:20:20:20:20:00:04:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:04:08:00:00:00:02:04:20:24:00:20:20:20:20:20:20:20:20:20:00:06:08:00:00:00:02:04:20:26:00:20
0hax commented 8 months ago

Can you try to bump MAX_BUF_SIZE to 4096 in esphome/components/teleinfo/teleinfo.h ? Also please make sure there is no garbage on the lines due to incorrect wiring. (It happens often)

vytdv commented 8 months ago

Hello, Thank you for your reply. I tried to change the MAX_BUF_SIZE value by copying the contents of the https://github.com/esphome/esphome/tree/dev/esphome/components/teleinfo folder into /config/esphome/custom_components. This did not change the error, the only difference is the number of logs before the error message.

[18:46:50][D][uart_debug:114]: <<< 20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:00:20:20:00:20:22:20:20:20:20:30:22:20:00:30:08:00:00:00:02:00:20:20:00:20:20:20:20:30:30:20:20:20:00:00:08:00:00:00:02:00:20:22:00:20:20:20:20:24:30:30:20:30:00:00:08:00:00:00:02:00:20:20:00:20:20:22:26:22:20:20:26:30:00
[18:46:50][D][uart_debug:114]: <<< 00:08:00:00:00:08:02:20:00:20:20:22:00:20:08:00:00:00:08:02:20:00:20:22:20:00:00:08:00:00:00:00:04:00:20:30:00:00:08:00:00:02:0E:00:00:00:20:30:00:00:08:00:02:00:0C:02:00:20:00:20:20:26:24:20:00:24:08:02:02:08:00:10:0C:00:00:20:20:20:20:20:20:20:20:20:26:20:30:00:20:20:26:30:30:00:20:08:02:02:08:00:10:0C:08:20:00:00:20:20:20:20:20:30:20:20:20:20:20:22:00:20:26:26:20:20:00:00:08:00:42:42:00:02:0C:00:00:20:20:20:20:20:20:20:30:22:20:20:20:00:20:20
[18:46:50][D][uart_debug:114]: <<< 20:30:24:00:3C:08:00:02:42:00:02:0C:08:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:20:24:20:20:00:00:08:02:00:08:0E:10:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:22:20:00:00:08:00:02:00:06:00:00:20:20:00:00:02:20:20:20:00:00:08:02:00:02:00:00:02:02:00:20:20:20:20:24:26:20:20:20:22:24:20:00:08:08:00:04:00:00:02:00:20:20:00:00:08:00:00:00:00:00:00:00:20:20:20:20:20:20:20:30:20:24:20:26:00:00:00:08:00:0C:06:00:04:00:00:00:00:0C:40:00
[18:46:50][D][uart_debug:114]: <<< 0C:00:0E:02:00:00:00:02:00:20:00:18:08:00:08:00:00:00:04:00:00:40:40:00:00:00:00:00:00:08:00:00:0C:40:20:20:00:00:08:00:00:00:02:00:00:20:24:20:20:22:20:20:26:30:00:08:08:00:00:00:02:04:20:20:00:20:20:26:20:20:30:24:20:20:00:44:08:00:00:00:02:04:20:20:00:20:22:22:26:20:20:24:24:22:00:02:08:00:00:00:02:04:20:22:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20
[18:46:51][D][uart_debug:114]: <<< 20:20:20:20:00:04:08:00:00:00:02:04:20:24:00:20:20:20:20:20:20:20:20:20:00:06:08:00:00:00:02:04:20:26:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:00:20:20:00:20:22:20:20:20:20:30:22:20:00:30:08:00:00:00:02:00:20:20:00:20:20:20:20:30:30:20:20:20:00:00:08:00:00:00
[18:46:51][D][uart_debug:114]: <<< 02:00:20:22:00:20:20:20:20:24:30:30:20:30:00:00:08:00:00:00:02:00:20:20:00:20:20:22:26:22:20:20:26:30:00:00:08:00:00:42:08:02:20:00:20:20:22:00:20:08:00:00:00:08:02:20:00:20:22:20:00:00:08:00:00:00:00:04:00:20:30:00:00:08:00:00:02:0E:00:00:00:20:30:00:00:08:00:02:00:0C:02:00:20:00:20:20:26:24:20:00:24:08:02:02:08:00:10:0C:00:00:20:20:20:20:20:20:20:20:20:26:20:30:00:20:20:26:30:30:00:20:08:02:02:08:00:10:0C:08:20:00:00:20:20:20:20:20:30:20:20:20
[18:46:51][D][uart_debug:114]: <<< 20:20:22:00:20:26:26:20:20:00:00:08:00:42:42:00:02:0C:00:00:20:20:20:20:20:20:20:30:22:20:20:20:00:20:20:20:30:24:00:3C:08:00:02:42:00:02:0C:08:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:20:24:20:20:00:00:08:02:00:08:0E:10:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:22:20:00:00:08:00:02:00:06:00:00:20:20:00:00:02:20:20:20:00:00:08:02:00:02:00:00:02:02:00:20:20:20:20:24:26:20:20:20:22:24:20:00:08:08:00:04:00:00:02:00:20:20:00:00:08
[18:46:51][D][uart_debug:114]: <<< 00:00:00:00:00:00:00:20:20:20:20:20:20:20:30:20:24:20:30:00:00:00:08:00:0C:06:00:04:00:00:00:00:0C:40:00:0C:00:0E:02:00:00:00:02:00:20:00:18:08:00:08:00:00:00:04:00:00:40:40:00:00:00:00:00:00:08:00:00:0C:40:20:20:00:00:08:00:00:00:02:00:00:20:24:20:20:22:20:20:26:30:00:08:08:00:00:00:02:04:20:20:00:20:20:26:20:20:30:24:20:20:00:44:08:00:00:00:02:04:20:20:00:20:22:22:26:20:20:24:24:22:00:02:08:00:00:00:02:04:20:22:00:20:20:20:20:20:20:20:20:20:00
[18:46:51][D][uart_debug:114]: <<< 00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:04:08:00:00:00:02:04:20:24:00:20:20:20:20:20:20:20:20:20:00:06:08:00:00:00:02:04:20:26:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:00:20:20:00
[18:46:52][D][uart_debug:114]: <<< 20:22:20:20:20:20:30:22:20:00:30:08:00:00:00:02:00:20:20:00:20:20:20:20:30:30:20:20:20:00:00:08:00:00:00:02:00:20:22:00:20:20:20:20:24:30:30:20:30:00:00:08:00:00:00:02:00:20:20:00:20:20:22:26:22:20:20:26:30:00:00:08:00:00:42:08:02:20:00:20:20:22:00:20:08:00:00:00:08:02:20:00:20:22:20:00:00:08:00:00:00:00:04:00:20:30:00:00:08:00:00:02:0E:00:00:00:20:30:00:00:08:00:02:00:0C:02:00:20:00:20:20:26:30:20:00:20:08:02:02:08:00:10:0C:00:00:20:20:20:20:20
[18:46:52][D][uart_debug:114]: <<< 20:20:20:20:26:20:30:00:20:20:26:30:30:00:20:08:02:02:08:00:10:0C:08:20:00:00:20:20:20:20:20:30:20:20:20:20:20:22:00:20:26:26:20:20:00:00:08:00:42:42:00:02:0C:00:00:20:20:20:20:20:20:20:30:22:20:20:20:00:20:20:20:30:24:00:3C:08:00:02:42:00:02:0C:08:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:20:24:20:20:00:00:08:00:00:08:0E:10:20:00:00:20:24:20:20:20:20:20:30:20:20:20:20:00:20:22:20:00:00:08:00:02:00:06:00:00:20:20:00:00:02:20:20:20:00:00
[18:46:52][D][uart_debug:114]: <<< 08:02:00:02:00:00:02:02:00:20:20:20:20:24:26:20:20:20:22:24:20:00:08:08:00:04:00:00:02:00:20:20:00:00:08:00:00:00:00:00:00:00:20:20:20:20:20:20:20:30:20:24:20:30:00:00:00:08:00:0C:06:00:04:00:00:00:00:0C:40:00:0C:00:0E:02:00:00:00:02:00:20:00:18:08:00:08:00:00:00:04:00:00:40:40:00:00:00:00:00:00:08:00:00:0C:40:20:20:00:00:08:00:00:00:02:00:00:20:24:20:20:22:20:20:26:30:00:08:08:00:00:00:02:04:20:20:00:20:20:26:20:20:30:24:20:20:00:44:08:00:00:00
[18:46:52][D][uart_debug:114]: <<< 02:04:20:20:00:20:22:22:26:20:20:24:24:22:00:02:08:00:00:00:02:04:20:22:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:04:08:00:00:00:02:04:20:24:00:20:20:20:20:20:20:20:20:20:00:06:08:00:00:00:02:04:20:26:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20
[18:46:52][D][uart_debug:114]: <<< 20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:00:20:20:00:20:22:20:20:20:20:30:22:20:00:30:08:00:00:00:02:00:20:20:00:20:20:20:20:30:30:20:20:20:00:00:08:00:00:00:02:00:20:22:00:20:20:20:20:24:30:30:20:30:00:00:08:00:00:00:02:00:20:20:00:20:20:22:26:22:20:20:26:30:00:00:08:00:00:42:48:02:20:00:20:20:22:00:20:08:00:00:00:08:02:20:00:20:22:20:00:00:08:00:00:00:00:04:00:20:30:00:00:08:00:00:02:0E:00:00
[18:46:52][D][uart_debug:114]: <<< 00:20:30:00:00:08:00:02:00:0C:02:00:20:00:20:20:26:26:20:00:20:08:00:02:48:00:10:0C:00:00:20:20:20:20:20:20:20:20:20:26:20:30:00:20:20:26:30:30:00:20:08:02:02:08:00:10:0C:08:20:00:00:20:20:20:20:20:30:20:20:20:20:20:22:00:20:26:26:20:20:00:00:08:00:42:02:00:02:0C:00:00:20:20:20:20:20:20:20:30:22:20:20:20:00:20:20:20:30:24:00:3C:08:00:42:42:00:02:0C:08:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:20:24:20:20:00:00:08:02:00:08:0E:10:20:00:00
[18:46:53][D][uart_debug:114]: <<< 20:20:20:20:20:20:20:30:20:20:20:20:00:20:22:20:00:00:08:00:02:00:06:00:00:20:20:00:00:02:20:20:20:00:00:08:02:02:02:00:00:02:02:00:20:20:20:20:24:26:20:20:20:22:24:20:00:08:08:00:04:00:00:02:00:20:20:00:00:08:00:00:00:00:00:00:00:20:20:20:20:20:20:20:30:20:24:20:30:00:00:00:08:00:0C:06:00:04:00:00:00:00:08:40:00:0C:00:0E:02:00:00:00:02:40:20:00:18:08:00:08:00:00:00:04:00:00:00:40:00:00:00:00:00:00:08:00:00:0C:40:20:20:00:00:08:00:00:00:02:00:00
[18:46:53][D][uart_debug:114]: <<< 20:24:20:20:22:20:20:26:30:00:08:08:00:00:00:02:04:20:20:00:20:20:26:20:20:30:24:20:20:00:00:08:00:00:00:02:04:20:20:00:20:22:22:26:20:20:24:24:22:00:02:08:00:00:00:02:04:20:22:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:04:08:00:00:00:02:04:20:24:00:20:20:20:20:20:20:20:20:20:00:06:08:00:00:00:02:04:20:26:00:20:20:20:20:20:20:20:20:20:00
[18:46:53][D][uart_debug:114]: <<< 00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:00:20:20:00:20:22:20:20:20:20:30:22:20:00:30:08:00:00:00:02:00:20:20:00:20:20:20:20:30:30:20:20:20:00:00:08:00:00:00:02:00:20:22:00:20:20:20:20:24:30:30:20:30:00:00:08:00:00:00:02:00:20:20:00:20:20:22:26:22:20:20:26:30:00:00:08:00:00:02:08:02:20:00:20
[18:46:53][D][uart_debug:114]: <<< 20:22:00:20:08:00:00:00:08:02:20:00:20:22:20:00:00:08:00:00:00:00:04:00:20:30:00:00:08:00:00:02:0E:00:00:00:20:30:00:00:08:00:02:00:0C:02:00:20:00:20:20:26:26:20:00:20:08:00:02:48:00:10:0C:00:00:20:20:20:20:20:20:20:20:20:26:20:30:00:20:20:26:30:30:00:20:08:02:02:08:00:10:0C:08:20:00:00:20:20:20:20:20:30:20:20:20:20:20:22:00:20:26:26:20:20:00:00:08:00:42:42:00:02:0C:00:00:20:20:20:20:20:20:20:30:22:20:20:20:00:20:20:20:30:24:00:3C:08:00:02:42:00
[18:46:53][D][uart_debug:114]: <<< 02:0C:08:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:20:24:20:20:00:00:08:02:00:08:0E:10:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:22:20:00:00:08:00:02:00:06:00:00:20:20:00:00:02:20:20:20:00:00:08:02:00:02:00:00:02:02:00:20:20:20:20:24:26:20:20:20:22:24:20:00:08:08:00:04:00:00:02:00:20:20:00:00:08:00:00:00:00:00:00:00:20:20:20:20:20:20:20:30:20:24:20:20:00:00:00:08:00:0C:06:00:04:00:00:00:00:08:00:00:0C:00:0E:02:00:00:00:02:00:00
[18:46:54][D][uart_debug:114]: <<< 00:18:08:00:08:00:00:00:04:00:00:00:00:00:00:00:00:00:00:08:00:00:0E:00:00:00:00:00:08:00:00:00:02:00:00:20:24:20:20:22:20:20:26:30:00:08:08:00:00:00:02:04:20:20:00:20:20:26:20:20:30:24:20:20:00:44:08:00:00:00:02:04:20:20:00:20:22:22:26:20:20:24:24:22:00:42:08:00:00:00:02:04:20:22:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:04:08:00:00:00
[18:46:54][D][uart_debug:114]: <<< 02:04:20:24:00:20:20:20:20:20:20:20:20:20:00:06:08:00:00:00:02:04:20:26:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:00:20:20:00:20:22:20:20:20:20:30:22:20:00:30:08:00:00:00:02:00:20:20:00:20:20:20:20:30:30:20:20:20:00:40:08:00:00:00:02:00:20:22:00:20:20:20:20:24
[18:46:54][D][uart_debug:114]: <<< 30:30:20:30:00:00:08:00:00:00:02:00:20:20:00:20:20:22:26:22:20:20:26:30:00:00:08:00:00:00:08:02:20:00:20:20:22:00:20:08:00:00:00:08:02:20:00:20:22:20:00:00:08:00:00:00:00:04:00:20:30:00:00:08:00:00:02:0E:00:00:00:20:30:00:00:08:00:02:00:0C:02:00:20:00:20:20:26:26:20:00:20:08:02:02:08:00:10:0C:00:00:20:20:20:20:20:20:20:20:20:26:20:30:00:20:20:26:30:30:00:20:08:02:02:08:00:10:0C:08:20:00:00:20:20:20:20:20:30:20:20:20:20:20:22:00:20:26:26:20:20:00
[18:46:54][D][uart_debug:114]: <<< 00:08:00:42:42:00:02:0C:00:00:20:20:20:20:20:20:20:30:22:20:20:20:00:20:20:20:30:24:00:3C:08:00:02:42:00:02:0C:08:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:20:24:20:20:00:00:08:02:00:08:0E:10:20:00:00:20:20:20:20:20:20:20:30:20:20:20:20:00:20:22:20:00:00:08:00:02:00:06:00:00:20:20:00:00:02:20:20:20:00:00:08:02:00:02:00:00:02:02:00:20:20:20:20:24:26:20:20:20:22:24:20:00:08:08:00:04:00:00:02:00:20:20:00:00:08:00:00:00:00:00:00:00:20:20:20
[18:46:54][D][uart_debug:114]: <<< 20:20:20:20:30:20:24:20:20:00:00:02:08:00:0C:06:00:04:00:00:00:00:08:00:00:0C:00:0E:02:00:00:00:02:00:00:00:18:08:00:08:00:00:00:04:00:00:00:00:00:00:00:00:00:00:08:00:00:0E:00:00:00:00:00:08:00:00:00:02:00:00:20:24:20:20:22:20:20:26:30:00:08:08:00:00:00:02:04:20:20:00:20:20:26:20:20:30:24:20:20:00:44:08:00:00:00:02:04:20:20:00:20:22:22:26:20:20:24:24:22:00:42:08:00:00:00:02:04:20:22:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00
[18:46:54][D][uart_debug:114]: <<< 20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:04:08:00:00:00:02:04:20:24:00:20:20:20:20:20:20:20:20:20:00:06:08:00:00:00:02:04:20:26:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:30:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:04:20:20:00:20:20:20:20:20:20:20:20:20:00:00:08:00:00:00:02:00:20:20:00:20:22:20:20:20:20:30:22:20:00
[18:46:55][D][uart_debug:114]: <<< 30:08:00:00:00:02:00:20:20:00:20:20:20:20:30:30:20:20:20:00:40:08:00:00:00:02:00:20:22:00:20:20:20:20:24:30:30:20:30:00:00:08:00:00:00:02:00:20:20:00:20:20:22:26:22:20:20:26:30:00:00:08:00:00:42:08:02:20:00:20:20:22:00:20:08:00:00:00:08:02:20:00:20:22:20:00:00:08:00:00:00:00:04:00:20:30:00:00:08:00:00:02:0E:00:00:00:20:30:00:00:08:00:02:00:0C:02:00:20:00:20:20:26:26:20:00:20:08:02:02:08:00:10:0C:00:00:20:20:20:20:20:20:20:20:20:26:20:30:00:20:20
[18:46:55][W][teleinfo:060]: Internal buffer full
[18:46:55][D][uart_debug:114]: <<< 26:30:30:00:20:08:02:02:08:00:10:0C:08:20:00:00:20:20:20:20:20:30:20:20:20:20:20:22:00:20:26:26:20:20:00:00:08:00:42:42:00:02:0C:00:00:20:20:20:20:20:20:20:30:22:20:20:20:00:20:20:20:30

I don't know if my method for changing the value of MAX_BUF_SIZE is right.

vytdv commented 8 months ago

I've just tried it with an ESP32 C3 and another teleinfo module, and I have exactly the same problem. The one with nodemcuv2 was this one.

gbrd commented 8 months ago

I found 2 ideas that I didn't had time to test here : https://forum.hacf.fr/t/teleinfo-via-wifi/1077/286

gbrd commented 8 months ago

https://github.com/esphome/esphome/pull/3855

0hax commented 8 months ago

Can you share your yaml config ?

gbrd commented 8 months ago

Here is my yaml config : It work perfectly with my wemos d1 mini, not with a wemos esp32

esphome:
  name: 22-teleinfo
  friendly_name: Teleinfo

esp8266:
  board: d1_mini

# esp32:
#   board: esp32dev
#   framework:
#     type: arduino

# Enable logging
logger:
  #hardware_uart: UART1
  baud_rate: 0
  level: DEBUG
  #esp8266_store_log_strings_in_flash: False

# Enable Home Assistant API
api:
  encryption:
    key: "xxxx"

ota:
  password: "yyy"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  manual_ip:
    static_ip: 192.168.1.172
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    dns1: 192.168.1.254

uart:
  id: uart_0
  #tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 9600 
  parity: EVEN
  data_bits: 7
  stop_bits: 1
  #debug: 
  #  direction: RX
  #  dummy_receiver: false
  #  after:
  #    delimiter: "\n"
  #  sequence:
  #    - lambda: UARTDebug::log_string(direction, bytes);

teleinfo:
  id: myteleinfo
  uart_id: uart_0
  update_interval: 10s
  historical_mode: false 

sensor:
  - platform: teleinfo #Heures Creuses Jours Bleus
    id: teleinfo_hc_blue
    tag_name: "EASF01"
    name: "HC bleu"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo
    on_value:
      - component.update: teleinfo_hc_blue_kwh
  - platform: template
    id: teleinfo_hc_blue_kwh
    state_class: total_increasing
    device_class: energy
    name: "HC bleu kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hc_blue).state / 1000); 

  - platform: teleinfo # Heures Pleines Jours Bleus
    id: teleinfo_hp_blue
    tag_name: "EASF02"
    name: "HP bleu"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
    on_value:
      - component.update: teleinfo_hp_blue_kwh
  - platform: template
    id: teleinfo_hp_blue_kwh
    state_class: total_increasing
    device_class: energy
    name: "HP bleu kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hp_blue).state / 1000); 

  - platform: teleinfo # Heures Creuses Jours Blancs
    id: teleinfo_hc_white
    tag_name: "EASF03"
    name: "HC blanc"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo   
    on_value:
      - component.update: teleinfo_hc_white_kwh
  - platform: template
    id: teleinfo_hc_white_kwh
    state_class: total_increasing
    device_class: energy
    name: "HC blanc kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hc_white).state / 1000); 

  - platform: teleinfo # Heures Pleines Jours Blancs
    id: teleinfo_hp_white
    tag_name: "EASF04"
    name: "HP blanc"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo   
    on_value:
      - component.update: teleinfo_hp_white_kwh
  - platform: template
    id: teleinfo_hp_white_kwh
    state_class: total_increasing
    device_class: energy
    name: "HP blanc kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hp_white).state / 1000); 

  - platform: teleinfo # Heures Creuses Jours Rouges
    id: teleinfo_hc_red
    tag_name: "EASF05"
    name: "HC rouge"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
    on_value:
      - component.update: teleinfo_hc_red_kwh
  - platform: template
    id: teleinfo_hc_red_kwh
    state_class: total_increasing
    device_class: energy
    name: "HC rouge kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hc_red).state / 1000); 

  - platform: teleinfo # Heures Pleines Jours Rouges
    id: teleinfo_hp_red
    tag_name: "EASF06"
    name: "HP rouge"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
    on_value:
      - component.update: teleinfo_hp_red_kwh
  - platform: template
    id: teleinfo_hp_red_kwh
    state_class: total_increasing
    device_class: energy
    name: "HP rouge kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hp_red).state / 1000); 

  # Puissance app. Instantanée soutirée 
  - platform: teleinfo
    id: teleinfo_power
    tag_name: "SINSTS"
    name: "power"
    unit_of_measurement: "VA"
    icon: mdi:flash
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_pcoup
    tag_name: "PCOUP"
    name: "Puissance app de coupure"
    unit_of_measurement: "VA"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
    filters:
      - multiply: 1000

  - platform: teleinfo
    id: teleinfo_pref
    tag_name: "PREF"
    name: "Puissance app de référence"
    unit_of_measurement: "kVA"
    icon: mdi:flash
    teleinfo_id: myteleinfo

  # Energie active soutirée totale
  - platform: teleinfo
    id: teleinfo_EAST
    tag_name: "EAST"
    name: "Energie active soutirée totale"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_EASD01
    tag_name: "EASD01"
    name: "Energie active soutirée Distributeur, index 01"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
  - platform: teleinfo
    id: teleinfo_EASD02
    tag_name: "EASD02"
    name: "Energie active soutirée Distributeur, index 02"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
  - platform: teleinfo
    id: teleinfo_EASD03
    tag_name: "EASD03"
    name: "Energie active soutirée Distributeur, index 03"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
  - platform: teleinfo
    id: teleinfo_EASD04
    tag_name: "EASD04"
    name: "Energie active soutirée Distributeur, index 04"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    

  - platform: teleinfo
    id: teleinfo_IRMS1
    tag_name: "IRMS1"
    name: "Courant efficace"
    unit_of_measurement: "A"
    icon: mdi:flash
    teleinfo_id: myteleinfo    

  - platform: teleinfo
    id: teleinfo_URMS1
    tag_name: "URMS1"
    name: "Tension efficace"
    unit_of_measurement: "V"
    icon: mdi:flash
    teleinfo_id: myteleinfo    

  - platform: teleinfo
    id: teleinfo_UMOY1
    tag_name: "UMOY1"
    name: "Tension moy"
    unit_of_measurement: "V"
    icon: mdi:flash
    teleinfo_id: myteleinfo    

  - platform: teleinfo
    id: teleinfo_SMAXSN
    tag_name: "SMAXSN"
    name: "Puissance app. max. soutirée n"
    unit_of_measurement: "VA"
    icon: mdi:flash
    teleinfo_id: myteleinfo   

#Puissance app max. soutirée n-1 SMAXSN-1 
  - platform: teleinfo
    id: teleinfo_SMAXSNm1
    tag_name: "SMAXSN-1"
    name: "Puissance app. max. soutirée n-1"
    unit_of_measurement: "VA"
    icon: mdi:flash
    teleinfo_id: myteleinfo   

text_sensor:
  - platform: teleinfo
    id: teleinfo_NTARF
    tag_name: "NTARF"
    name: "Numéro de l’index tarifaire en cours"
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_NJOURF
    tag_name: "NJOURF"
    name: "Numéro du jour en cours"
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_NJOURFp1
    tag_name: "NJOURF+1"
    name: "Numéro du prochain jour"
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_NGTF
    tag_name: "NGTF"
    name: "calendrier tarifaire"
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_LTARF
    tag_name: "LTARF"
    name: "tarif en cours"
    teleinfo_id: myteleinfo
0hax commented 8 months ago

Here is my yaml config : It work perfectly with my wemos d1 mini, not with a wemos esp32

esphome:
  name: 22-teleinfo
  friendly_name: Teleinfo

esp8266:
  board: d1_mini

# esp32:
#   board: esp32dev
#   framework:
#     type: arduino

# Enable logging
logger:
  #hardware_uart: UART1
  baud_rate: 0
  level: DEBUG
  #esp8266_store_log_strings_in_flash: False

# Enable Home Assistant API
api:
  encryption:
    key: "xxxx"

ota:
  password: "yyy"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  manual_ip:
    static_ip: 192.168.1.172
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    dns1: 192.168.1.254

uart:
  id: uart_0
  #tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 9600 
  parity: EVEN
  data_bits: 7
  stop_bits: 1
  #debug: 
  #  direction: RX
  #  dummy_receiver: false
  #  after:
  #    delimiter: "\n"
  #  sequence:
  #    - lambda: UARTDebug::log_string(direction, bytes);

teleinfo:
  id: myteleinfo
  uart_id: uart_0
  update_interval: 10s
  historical_mode: false 

sensor:
  - platform: teleinfo #Heures Creuses Jours Bleus
    id: teleinfo_hc_blue
    tag_name: "EASF01"
    name: "HC bleu"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo
    on_value:
      - component.update: teleinfo_hc_blue_kwh
  - platform: template
    id: teleinfo_hc_blue_kwh
    state_class: total_increasing
    device_class: energy
    name: "HC bleu kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hc_blue).state / 1000); 

  - platform: teleinfo # Heures Pleines Jours Bleus
    id: teleinfo_hp_blue
    tag_name: "EASF02"
    name: "HP bleu"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
    on_value:
      - component.update: teleinfo_hp_blue_kwh
  - platform: template
    id: teleinfo_hp_blue_kwh
    state_class: total_increasing
    device_class: energy
    name: "HP bleu kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hp_blue).state / 1000); 

  - platform: teleinfo # Heures Creuses Jours Blancs
    id: teleinfo_hc_white
    tag_name: "EASF03"
    name: "HC blanc"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo   
    on_value:
      - component.update: teleinfo_hc_white_kwh
  - platform: template
    id: teleinfo_hc_white_kwh
    state_class: total_increasing
    device_class: energy
    name: "HC blanc kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hc_white).state / 1000); 

  - platform: teleinfo # Heures Pleines Jours Blancs
    id: teleinfo_hp_white
    tag_name: "EASF04"
    name: "HP blanc"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo   
    on_value:
      - component.update: teleinfo_hp_white_kwh
  - platform: template
    id: teleinfo_hp_white_kwh
    state_class: total_increasing
    device_class: energy
    name: "HP blanc kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hp_white).state / 1000); 

  - platform: teleinfo # Heures Creuses Jours Rouges
    id: teleinfo_hc_red
    tag_name: "EASF05"
    name: "HC rouge"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
    on_value:
      - component.update: teleinfo_hc_red_kwh
  - platform: template
    id: teleinfo_hc_red_kwh
    state_class: total_increasing
    device_class: energy
    name: "HC rouge kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hc_red).state / 1000); 

  - platform: teleinfo # Heures Pleines Jours Rouges
    id: teleinfo_hp_red
    tag_name: "EASF06"
    name: "HP rouge"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
    on_value:
      - component.update: teleinfo_hp_red_kwh
  - platform: template
    id: teleinfo_hp_red_kwh
    state_class: total_increasing
    device_class: energy
    name: "HP rouge kWh"
    unit_of_measurement: "kWh"
    icon: mdi:flash
    lambda: |-
      return (id(teleinfo_hp_red).state / 1000); 

  # Puissance app. Instantanée soutirée 
  - platform: teleinfo
    id: teleinfo_power
    tag_name: "SINSTS"
    name: "power"
    unit_of_measurement: "VA"
    icon: mdi:flash
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_pcoup
    tag_name: "PCOUP"
    name: "Puissance app de coupure"
    unit_of_measurement: "VA"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
    filters:
      - multiply: 1000

  - platform: teleinfo
    id: teleinfo_pref
    tag_name: "PREF"
    name: "Puissance app de référence"
    unit_of_measurement: "kVA"
    icon: mdi:flash
    teleinfo_id: myteleinfo

  # Energie active soutirée totale
  - platform: teleinfo
    id: teleinfo_EAST
    tag_name: "EAST"
    name: "Energie active soutirée totale"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_EASD01
    tag_name: "EASD01"
    name: "Energie active soutirée Distributeur, index 01"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
  - platform: teleinfo
    id: teleinfo_EASD02
    tag_name: "EASD02"
    name: "Energie active soutirée Distributeur, index 02"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
  - platform: teleinfo
    id: teleinfo_EASD03
    tag_name: "EASD03"
    name: "Energie active soutirée Distributeur, index 03"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    
  - platform: teleinfo
    id: teleinfo_EASD04
    tag_name: "EASD04"
    name: "Energie active soutirée Distributeur, index 04"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: myteleinfo    

  - platform: teleinfo
    id: teleinfo_IRMS1
    tag_name: "IRMS1"
    name: "Courant efficace"
    unit_of_measurement: "A"
    icon: mdi:flash
    teleinfo_id: myteleinfo    

  - platform: teleinfo
    id: teleinfo_URMS1
    tag_name: "URMS1"
    name: "Tension efficace"
    unit_of_measurement: "V"
    icon: mdi:flash
    teleinfo_id: myteleinfo    

  - platform: teleinfo
    id: teleinfo_UMOY1
    tag_name: "UMOY1"
    name: "Tension moy"
    unit_of_measurement: "V"
    icon: mdi:flash
    teleinfo_id: myteleinfo    

  - platform: teleinfo
    id: teleinfo_SMAXSN
    tag_name: "SMAXSN"
    name: "Puissance app. max. soutirée n"
    unit_of_measurement: "VA"
    icon: mdi:flash
    teleinfo_id: myteleinfo   

#Puissance app max. soutirée n-1 SMAXSN-1 
  - platform: teleinfo
    id: teleinfo_SMAXSNm1
    tag_name: "SMAXSN-1"
    name: "Puissance app. max. soutirée n-1"
    unit_of_measurement: "VA"
    icon: mdi:flash
    teleinfo_id: myteleinfo   

text_sensor:
  - platform: teleinfo
    id: teleinfo_NTARF
    tag_name: "NTARF"
    name: "Numéro de l’index tarifaire en cours"
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_NJOURF
    tag_name: "NJOURF"
    name: "Numéro du jour en cours"
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_NJOURFp1
    tag_name: "NJOURF+1"
    name: "Numéro du prochain jour"
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_NGTF
    tag_name: "NGTF"
    name: "calendrier tarifaire"
    teleinfo_id: myteleinfo

  - platform: teleinfo
    id: teleinfo_LTARF
    tag_name: "LTARF"
    name: "tarif en cours"
    teleinfo_id: myteleinfo

What is the UART config you are using when running it with esp32? I have decoded the debug dump you pasted in a previous post and it all looks garbage. It's like the UART is not correctly configured.

vytdv commented 8 months ago
esphome:
  name: linky

esp8266:
  board: nodemcuv2

# Enable logging
logger:
  baud_rate: 0
  level: VERBOSE

# Enable Home Assistant API
api:
  encryption:
    key: !secret linky_api_encryption_key

ota:
  password: !secret linky_ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: !secret linky_wifi_ap_ssid
    password: !secret linky_wifi_ap_password

captive_portal:

web_server:

status_led:
  pin:
    number: D0
    inverted: true

# Linky

uart:
  id: uart_bus
  rx_pin: GPIO3 # Pin Rx
  baud_rate: 9600
  parity: EVEN
  data_bits: 7
  debug:

binary_sensor:
  - platform: status
    name: "Teleinfo Status"

teleinfo:
  id: myteleinfo
  update_interval: 60s
  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: "ADCO"
    name: "Adresse du compteur"
    unit_of_measurement: ""
    icon: mdi:eye
    teleinfo_id: myteleinfo

#   - platform: teleinfo
#     tag_name: "IMAX"
#     name: "Intensité max"
#     unit_of_measurement: "A"
#     icon: mdi:current-ac
#     teleinfo_id: myteleinfo

#   - platform: teleinfo
#     tag_name: "ISOUSC"
#     name: "Intensité souscrite"
#     unit_of_measurement: "A"
#     icon: mdi:current-ac
#     teleinfo_id: myteleinfo

#   - platform: teleinfo
#     tag_name: "IINST"
#     name: "Intensité"
#     unit_of_measurement: "A"
#     icon: mdi:current-ac
#     id: linky_amps
#     teleinfo_id: myteleinfo

#   - platform: teleinfo
#     tag_name: "HCHC"
#     name: "Index heures creuses"
#     unit_of_measurement: "kWh"
#     icon: mdi:gauge
#     teleinfo_id: myteleinfo
#     id: heures_creuses
#     filters:
#       lambda: return x / 1000;
#     device_class: "energy"
#     state_class: "total_increasing"
#     accuracy_decimals: 3 

#   - platform: teleinfo
#     tag_name: "HCHP"
#     name: "Index heures pleines"
#     unit_of_measurement: "kWh"
#     icon: mdi:gauge
#     teleinfo_id: myteleinfo
#     id: heures_pleines
#     filters:
#       lambda: return x / 1000;
#     device_class: "energy"
#     state_class: "total_increasing"
#     accuracy_decimals: 3

#   - platform: teleinfo
#     tag_name: "PAPP"
#     name: "Puissance"
#     unit_of_measurement: "VA"
#     icon: mdi:flash
#     teleinfo_id: myteleinfo

# text_sensor:
#   - platform: teleinfo
#     tag_name: "OPTARIF"
#     name: "Type d'abonnement"
#     icon: mdi:handshake
#     teleinfo_id: myteleinfo

#   - platform: teleinfo
#     tag_name: "PTEC"
#     name: "Tarif en cours"
#     icon: mdi:clock-time-nine-outline
#     teleinfo_id: myteleinfo
0hax commented 8 months ago
esphome:
  name: linky

esp8266:
  board: nodemcuv2

This is the esp8266 config which works right?

gbrd commented 8 months ago

What is the UART config you are using when running it with esp32?

I think it's just the same, I will have to retry to confirm

I have decoded the debug dump you pasted in a previous post and it all looks garbage. It's like the UART is not correctly configured.

Warning, it is my not my debug dump but the one of @vytdv
It seems we both have the same problem (or a similar one), I'm just trying to give info to help.

0hax commented 8 months ago

Warning, it is my not my debug dump but the one of @vytdv It seems we both have the same problem (or a similar one), I'm just trying to give info to help.

Ah sorry for the confusion. To debug further, it would be great if one of you can rebuild esphome with a different MAX_BUF_SIZE To do so, you need to clone https://github.com/esphome/esphome Checkout the most recent tag, edit esphome/components/teleinfo/teleinfo.h to change MAX_BUF_SIZE And then rebuild esphome using pip install . for example. Better if you do it in a virtualenv. Once done, you can reflash your board.

I have 2 setups here, one in historical mode and one with standard mode. Both works since years but I may have less data in the standard mode one as it's for solar panel.

gbrd commented 8 months ago

I did that with MAX_BUF_SIZE=4096 => same result. Other note : I had to use another io (IO32), because I was not able to receive any byte on IO3 (RX)

gbrd commented 8 months ago

I added some logs. The code is just waiting for char 0x03 (frame separator) and never finds it. Maybe it's a hardware problem (my optocoupler/resistors stuff would work with esp8266 but not with esp32 ?!)

gbrd commented 8 months ago

Ok. I just enabled logs on my esp8266 to compare and I understood what you said about garbage :) I did not realised that I used log_string (and not log hex) and I shoud see readable text... Thus 2 possible causes I think :

I should try to build another "adapter" using a LTV814 (I will read again https://hallard.me/utinfo/ ... )

gbrd commented 8 months ago

@vytdv @0hax what kind of electronic adapter do you use ? (with esp32 standard mode on linky) ? What optocoupler, resistors values, schematic?

vytdv commented 8 months ago

@vytdv @0hax what kind of electronic adapter do you use ? (with esp32 standard mode on linky) ? What optocoupler, resistors values, schematic?

I tried with the following adapters :

vytdv commented 8 months ago

I've just tried to read the Linky meter information with the PiTinfo module and the output is totally unreadable. Maybe the problem is more with my Linky meter.

pi@raspberrypi:~ $ sudo screen /dev/ttyAMA0 9600,cs7,parenb,-parodd,-cstopb
 $IB    &@   @ B@$0@J@ @$px @ $ bA @LA H BD      @20   @0 0" BD
                                                              $B 0      | @`
                                                                            $BB   @2B@"  " BL` @>P @20 ` B 0@"BD
                                                                                                                 &Ba
                                                                                                                    $ BB    @2B@"B        
px @BL`  @20B  C 0@"D  B        &Ba BB    @2B@$B        R       $| @@ HB @20B  ` @
                                                                                   0 "B "@BB@$B0"BL` @A0@ HB @20   A0 @0"0"""@BHIq B @&
                                                                                                                                       @2 @2B"B   R$"B    H` @ HB @20 `   @0"0" "@BH |$I 0"  @B)&Bq
                                                         $ BB    @2"
                                                                         px @B)H` @@#
                                                                                    c@@ H0       @20   `   @0@B `Bx  ` @$       |$"B)& B $&B@"     p| @BL` @@#
                   s@@ H0        @2 D ` C 00" "   @@
                                                    $B   @2B@"B          #BBL`| @#\ H0B @2  ` @
                                                                                               | @0"L$   @ @@2BB@   @B@$B       R         
vytdv commented 8 months ago

From what I can see on this forum post, the creator of my PiTinfo adapter indicates that the problem could be solved by changing a resistor on it. So I'd be curious to see which adapter @0hax uses !

gbrd commented 8 months ago

This one seems to be the latest https://github.com/hallard/WeMos-TIC

(with 220 ohm resistor) I built it, I will test

gbrd commented 8 months ago

It works !... but I'have a lot of "bad crc" messages like this :

[E][teleinfo:038]: bad crc: got XX except YY
0hax commented 8 months ago

@vytdv @0hax what kind of electronic adapter do you use ? (with esp32 standard mode on linky) ? What optocoupler, resistors values, schematic?

You can see exactly what I use here https://0hax.github.io/post/teleinformation/ (and in french :))

vytdv commented 8 months ago

I've just tried with a lolin_c3_mini, the Wemos TIC module and the MAX_BUF_SIZE at 4096, no difference, still the same error. @gbrd, how did you get it to work?

gbrd commented 8 months ago

I've just tried with a lolin_c3_mini, the Wemos TIC module and the MAX_BUF_SIZE at 4096, no difference, still the same error. @gbrd, how did you get it to work?

@vytdv you should check the value of the resistor between the linky and the optocoupler. Mine is 220. @0hax .. 0 :)

I understood that it should be 4.7k (?) to be enedis compliant, hallard made a big work to build a compliant module but finally reduced the value to 220 ohm in the very last version... and @0hax has none. I think the only drawback is it eats all the signal and you could not add something else on TIC plug.

vytdv commented 8 months ago

Okay, thanks for the explanation.

After checking, I do have the latest version of hallard's WeMos-TIC module (the 1.1) with the 220 ohm resistor, but it doesn't seem to be more functional.

gbrd commented 8 months ago

After checking, I do have the latest version of hallard's WeMos-TIC module (the 1.1) with the 220 ohm resistor, but it doesn't seem to be more functional.

@vytdv What do see you with log string debug on uart ?

  debug: 
    direction: RX
    dummy_receiver: false
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);

You could try another gpio, short circuit the 220 resistor, or using a wemos D1 mini on your WeMos tic (because on my side it worked better with D1 mini, your lolin is esp32 and it did not work for me Rx pin of esp32)... but not sure if it's the same problem