Error compiling yaml with version > 2023.3.2

Hello, I have a couple boards from Kincony with a customized yaml.

It was fine untile version 2023.3.2 and every version of esphome after that fails to compile.

This is the yaml:

esphome:
  name: kc868-e16s-1


esp32:
  board: esp32dev
  framework:
    type: arduino


# Enable logging
logger:

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

ota:
  password: !secret ota

ethernet:
  domain: ".snoopy.lan"
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

  # IP statico
  manual_ip:
    static_ip: 192.168.82.201
    gateway: 192.168.82.1
    subnet: 255.255.255.0  
  
  

# Abilita Bluetooth
#esp32_ble_tracker:
#bluetooth_proxy:

# Enable Web server (optional).
web_server:
  port: 80
  auth:
    username: !secret web_username
    password: !secret web_password
    
# Enable i2c
i2c:
  sda: 16
  scl: 15
  scan: true
  id: bus_a

sensor:
  - platform: uptime
    name: ${device_name} Uptime 


text_sensor:
# Text sensors with general information.
  # Expose ESPHome version as sensor.
  - platform: version
    name: ${device_name} ESPHome Version
    # Riporta IP del device
  - platform: ethernet_info
    ip_address:
      name: ${device_name} IP


# Example configuration entry
pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-8
    address: 0x21

  - id: 'pcf8574_hub_out_2'  # for output channel 9-16
    address: 0x25

  - id: 'pcf8574_hub_in_1'  # for input channel 1-8
    address: 0x22

  - id: 'pcf8574_hub_in_2'  # for input channel 9-16
    address: 0x24

# individual lights

light:
  - platform: binary
    id: e16s_output1_light
    name: "Entrata 1p Ambience"
    output: e16s_output1


  - platform: binary
    id: e16s_output2_light
    name: "Entrata 1p Luce"
    output: e16s_output2
      
  - platform: binary
    id: e16s_output3_light
    name: "Sala Ambience"
    output: e16s_output3
      
  - platform: binary
    id: e16s_output4_light
    name: "Sala Cabinet"
    output: e16s_output4
    restore_mode: RESTORE_DEFAULT_ON
    #temporaneo, da cambiare
      
  - platform: binary
    id: e16s_output5_light
    name: "Sala Luce"
    output: e16s_output5
      
  - platform: binary
    id: e16s_output6_light
    name: "Cucina Ambience"
    output: e16s_output6

  - platform: binary
    id: e16s_output7_light
    name: "Cucina Pensile"
    output: e16s_output7
      
  - platform: binary
    id: e16s_output8_light
    name: "Cucina Luce"
    output: e16s_output8
      
  - platform: binary
    id: e16s_output9_light
    name: "Antibagno"
    output: e16s_output9

  - platform: binary
    id: e16s_output10_light
    name: "Bagno Luce"
    output: e16s_output10

  - platform: binary
    id: e16s_output11_light
    name: "Bagno Specchio LED"
    output: e16s_output11
      
  - platform: binary
    id: e16s_output12_light
    name: "Bagno Specchio Faretti"
    output: e16s_output12
      
  - platform: binary
    id: e16s_output13_light
    name: "Cameretta Ambience"
    output: e16s_output13
      
  - platform: binary
    id: e16s_output14_light
    name: "Cameretta Luce"
    output: e16s_output14
      
  - platform: binary
    id: e16s_output15_light
    name: "Master Ambience"
    output: e16s_output15
      
  - platform: binary
    id: e16s_output16_light
    name: "Master Luce"
    output: e16s_output16

output:
  - platform: gpio
    id: "e16s_output1"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    id: "e16s_output2"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output3"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output4"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output5"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output6"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    id: "e16s_output7"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output8"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output9"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    id: "e16s_output10"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    id: "e16s_output11"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 2
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output12"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 3
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output13"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 4
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output14"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 5
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output15"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 6
      mode: OUTPUT
      inverted: true
      
  - platform: gpio
    id: "e16s_output16"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 7
      mode: OUTPUT
      inverted: true
      
binary_sensor:
  - platform: gpio
    name: ""
    id: "e16s_input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output1_light

  - platform: gpio
    name: ""
    id: "e16s_input2"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true
    on_multi_click:
      - timing:
          - ON for at most 1s
          - OFF for at least 0.5s
        then:
        - light.toggle: e16s_output2_light

  - platform: gpio
    name: ""
    id: "e16s_input3"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output3_light

  - platform: gpio
    name: "Button_Cabinet"
    id: "e16s_input4"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true
#    on_press:
#      - light.toggle: e16s_output4_light
# da cambiare

  - platform: gpio
    name: ""
    id: "e16s_input5"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output5_light

  - platform: gpio
    name: ""
    id: "e16s_input6"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output6_light

  - platform: gpio
    name: ""
    id: "e16s_input7"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output7_light

  - platform: gpio
    name: ""
    id: "e16s_input8"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output8_light

  - platform: gpio
    name: ""
    id: "e16s_input9"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output9_light


  - platform: gpio
    name: ""
    id: "e16s_input10"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 1
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output10_light

  - platform: gpio
    name: ""
    id: "e16s_input11"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 2
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output11_light


  - platform: gpio
    name: ""
    id: "e16s_input12"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 3
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output12_light

  - platform: gpio
    name: ""
    id: "e16s_input13"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 4
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output13_light

  - platform: gpio
    name: ""
    id: "e16s_input14"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 5
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output14_light

  - platform: gpio
    name: ""
    id: "e16s_input15"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 6
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output15_light

  - platform: gpio
    name: ""
    id: "e16s_input16"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 7
      mode: INPUT
      inverted: true
    on_press:
      - light.toggle: e16s_output16_light


and this is the error that i get when i try to compile:

INFO Reading configuration /config/aaa.yaml...
WARNING GPIO15 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO15 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 33, in <module>
    sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
  File "/esphome/esphome/__main__.py", line 965, in main
    return run_esphome(sys.argv)
  File "/esphome/esphome/__main__.py", line 952, in run_esphome
    rc = POST_CONFIG_ACTIONS[args.command](args, config)
  File "/esphome/esphome/__main__.py", line 357, in command_compile
    exit_code = write_cpp(config)
  File "/esphome/esphome/__main__.py", line 178, in write_cpp
    generate_cpp_contents(config)
  File "/esphome/esphome/__main__.py", line 190, in generate_cpp_contents
    CORE.flush_tasks()
  File "/esphome/esphome/core/__init__.py", line 622, in flush_tasks
    self.event_loop.flush_tasks()
  File "/esphome/esphome/coroutine.py", line 246, in flush_tasks
    next(task.iterator)
  File "/esphome/esphome/__main__.py", line 170, in wrapped
    await coro(conf)
  File "/esphome/esphome/components/gpio/binary_sensor/__init__.py", line 24, in to_code
    var = await binary_sensor.new_binary_sensor(config)
  File "/esphome/esphome/components/binary_sensor/__init__.py", line 481, in new_binary_sensor
    await register_binary_sensor(var, config)
  File "/esphome/esphome/components/binary_sensor/__init__.py", line 476, in register_binary_sensor
    await setup_binary_sensor_core_(var, config)
  File "/esphome/esphome/components/binary_sensor/__init__.py", line 414, in setup_binary_sensor_core_
    await setup_entity(var, config)
  File "/esphome/esphome/cpp_helpers.py", line 106, in setup_entity
    add(var.set_object_id(sanitize(snake_case(CORE.friendly_name))))
  File "/esphome/esphome/helpers.py", line 342, in snake_case
    return value.replace(" ", "_").lower()
AttributeError: 'NoneType' object has no attribute 'replace'

Do i have to post an issue on github?

Have you tried the ‘Clean Build Files’ option in the hamburger menu for that device in the ESPHome page?

Yes, I even deployed a brand new docker to test the versions and clean between versions.

And I did verify that it compile on 2023.3.2 but not on 2023.4.0 and above.

I tried on my pi with HA and on a docker on my unraid server with the same result

Resolved removing:
name: “”
in the yaml