esphome:
  name: linkymaison
  platform: ESP8266
  board: nodemcuv2

# Enable logging
logger:
  baud_rate: 0
  level: INFO 
  esp8266_store_log_strings_in_flash: False

# Enable Home Assistant API
api:
  password: ""

ota:
  password: ""

wifi:
  ssid: "LBMerle9"
  password: "TurdusMerula"
  fast_connect: true
  manual_ip:
    static_ip: 192.168.1.150
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    dns1: 192.168.1.1

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Linkymaison Fallback Hotspot"
    password: "f1Nh0HPpmz3A"

captive_portal:
# Pour les abonnements au tarif HEURE BASE
uart:
  id: uart_bus
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 1200
  parity: EVEN
  data_bits: 7

teleinfo:
  id: linkymaison
  update_interval: 60s
  historical_mode: true

sensor:
  - platform: teleinfo
    tag_name: "BASE"
    name: "Wattstunden"
    unit_of_measurement: "Wh"
    icon: mdi:flash
    teleinfo_id: linkymaison
    
  - platform: teleinfo
    tag_name: "PAPP"
    name: "Verbrauch"
    unit_of_measurement: "W"
    icon: mdi:flash
    teleinfo_id: linkymaison


text_sensor:
  - platform: teleinfo
    tag_name: "OPTARIF"
    name: "optarif"
    teleinfo_id: linkymaison