lorenzo-deluca / espkyogate

Serial Bridge for Bentel Kyo Alarm System.
GNU Affero General Public License v3.0
38 stars 13 forks source link

binary sensor "platform: custom" probably deprecated unable to build #44

Closed joyride1176 closed 8 months ago

joyride1176 commented 8 months ago

Hi,

I'm trying to build the image for ESP board but probably the yaml configuration isn't supported anymore by new esphome version 2023.12.1

Documentation: https://esphome.io/components/binary_sensor/custom.html

"Warning Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a future release. Please look at creating a real ESPHome component and “importing” it into your configuration with External Components."

Error appear with default yaml file proposed by you with minor config:

Error:


INFO ESPHome 2023.12.1 INFO Reading configuration /config/esphome/test.yaml... Failed config

binary_sensor.custom: [source :45] platform: custom

Any suggestion?

YAML full config `esphome: name: test friendly_name: Test

esp8266: board: esp01_1m

Enable logging

logger:

Enable Home Assistant API

api: encryption: key: "oytieDmV1TM/VhzQa+j1MzWY9/6+mDxHV/cooCm78cY="

ota: password: "e1bb229aced5b43622cdea640593ffde"

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

Enable fallback hotspot (captive portal) in case wifi connection fails

ap: ssid: "Test Fallback Hotspot" password: "NFe76qjMlqax"

captive_portal:

uart: id: uart_bus tx_pin: GPIO5 rx_pin: GPIO4 baud_rate: 9600 data_bits: 8 parity: EVEN

switch:

binary_sensor:

Full log error:

`INFO ESPHome 2023.12.1 INFO Reading configuration /config/esphome/test.yaml... Failed config

binary_sensor.custom: [source :45] platform: custom lambda: !lambda |- auto kyo32 = new Bentel_Kyo32(id(uart_bus)); App.register_component(kyo32); return { kyo32->kyo_comunication, kyo32->stato_sirena, kyo32->warn_mancanza_rete, kyo32->sabotaggio_zona, kyo32->sabotaggio_sistema, kyo32->warn_scomparsa_bpi, kyo32->warn_fusibile, kyo32->warn_batteria_bassa, kyo32->warn_guasto_linea_telefonica, kyo32->warn_codici_default, kyo32->warn_wireless, kyo32->sabotaggio_bpi, kyo32->sabotaggio_jam, kyo32->sabotaggio_wireless, kyo32->sabotaggio_chiave_falsa,

  &kyo32->zona[0],
  &kyo32->zona[1],
  &kyo32->zona[2],
  &kyo32->zona[3],

  &kyo32->zona_sabotaggio[0],
  &kyo32->zona_sabotaggio[1],
  &kyo32->zona_sabotaggio[2],
  &kyo32->zona_sabotaggio[3],

  &kyo32->zona_esclusa[0],
  &kyo32->zona_esclusa[1],
  &kyo32->zona_esclusa[2],
  &kyo32->zona_esclusa[3],

  &kyo32->memoria_allarme_zona[0],
  &kyo32->memoria_allarme_zona[1],
  &kyo32->memoria_allarme_zona[2],
  &kyo32->memoria_allarme_zona[3],

  &kyo32->memoria_sabotaggio_zona[0],
  &kyo32->memoria_sabotaggio_zona[1],
  &kyo32->memoria_sabotaggio_zona[2],
  &kyo32->memoria_sabotaggio_zona[3],

  &kyo32->allarme_area[0],
  &kyo32->allarme_area[1],
  &kyo32->allarme_area[2],
  &kyo32->allarme_area[3],

  &kyo32->inserimento_totale_area[0],
  &kyo32->inserimento_totale_area[1],
  &kyo32->inserimento_totale_area[2],
  &kyo32->inserimento_totale_area[3],

  &kyo32->inserimento_parziale_area[0],
  &kyo32->inserimento_parziale_area[1],
  &kyo32->inserimento_parziale_area[2],
  &kyo32->inserimento_parziale_area[3],

  &kyo32->inserimento_parziale_ritardo_0_area[0],
  &kyo32->inserimento_parziale_ritardo_0_area[1],
  &kyo32->inserimento_parziale_ritardo_0_area[2],
  &kyo32->inserimento_parziale_ritardo_0_area[3],

  &kyo32->disinserita_area[0],
  &kyo32->disinserita_area[1],
  &kyo32->disinserita_area[2],
  &kyo32->disinserita_area[3],

  &kyo32->stato_uscita[0],
  &kyo32->stato_uscita[1],
  &kyo32->stato_uscita[2],
  &kyo32->stato_uscita[3]
};

binary_sensors:

lorenzo-deluca commented 8 months ago

Hello, I saw the warning but it is only a warning, I recompiled everything with ESPHome 2023.12.3 and it works ;) In your case the problem is clear, you have defined "exit_status_1" several times.

(for the next times if you want to post your configuration use the appropriate yaml identifier)

Happy Christmas :christmas_tree:

EDIT: I see the duplication actually came from my example yaml, it must have been pushed after some PR.. sorry :)