LubosD / esphome-smartboiler

ESPHome component for Dražice OKHE smart boilers
20 stars 9 forks source link

Error during install #2

Closed lpjerry closed 1 year ago

lpjerry commented 1 year ago

Hi Lubos,

First of all thank you very much for creating this program for DZD boilers.

I'm trying to install your code to my ESP32 board but i cannot succeed. Here is my yaml:

substitutions:

  name: "drazice-boiler-proxy"
  mac_address: FD:DD:DA:5F:F8:73
  mqtt_broker: 10.0.107.99

esphome:
  name: ${name}
  name_add_mac_suffix: False
  platform: ESP32
  board: esp-wrover-kit

external_components:
  - source: github://LubosD/esphome-smartboiler@master

ota:
  safe_mode: true
  password: !secret ota_password
logger:
api:

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

  manual_ip:
    static_ip: 10.0.107.199
    gateway: 10.0.107.1
    subnet: 255.255.255.0
    dns1: 1.1.1.1
    dns2: 1.0.0.1

binary_sensor:
select:
climate:
esp32_ble_tracker:
sensor:
#  - platform: wifi_signal
#    name: "WiFi Signal Sensor"
#    update_interval: 60s

mqtt:
  broker: ${mqtt_broker}
  username: mqtt
  password: !secret mqtt_password

ble_client:
  - mac_address: ${mac_address}
    id: drazice_okhe

smartboiler:
  ble_client_id: drazice_okhe
  topic_prefix: smartboiler
  temp1:
    name: boiler_temp1
  temp2:
    name: boiler_temp2
  hdo_low_tariff:
    name: hdo_low_tariff
  heat_on:
    name: boiler_heat_on
  mode:
    name: boiler_mode
  thermostat:
    name: boiler_thermostat
  consumption:
    name: boiler_consumption
    state_class: total_increasing
    device_class: energy

and here is the error i get:

INFO Reading configuration /config/esphome/drazice-boiler-proxy.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing drazice-boiler-proxy (board: esp-wrover-kit; framework: arduino; platform: platformio/espressif32 @ 3.5.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- WiFi @ 1.0
|-- ESPmDNS @ 1.0
|-- Update @ 1.0
|-- AsyncMqttClient-esphome @ 0.8.6
|   |-- AsyncTCP-esphome @ 1.2.2
|-- ArduinoJson @ 6.18.5
Compiling /data/drazice-boiler-proxy/.pioenvs/drazice-boiler-proxy/src/esphome/components/smartboiler/smartboiler.cpp.o
src/esphome/components/smartboiler/smartboiler.cpp: In member function 'void esphome::sb::SmartBoiler::send_to_boiler(uint8_t*, size_t)':
src/esphome/components/smartboiler/smartboiler.cpp:89:56: error: 'class esphome::ble_client::BLEClient' has no member named 'gattc_if'
  auto status = esp_ble_gattc_write_char(this->parent_->gattc_if, this->parent_->conn_id, this->char_handle_,
                                                        ^
src/esphome/components/smartboiler/smartboiler.cpp:89:81: error: 'class esphome::ble_client::BLEClient' has no member named 'conn_id'
  auto status = esp_ble_gattc_write_char(this->parent_->gattc_if, this->parent_->conn_id, this->char_handle_,
                                                                                 ^
src/esphome/components/smartboiler/smartboiler.cpp: In member function 'virtual void esphome::sb::SmartBoiler::gattc_event_handler(esp_gattc_cb_event_t, esp_gatt_if_t, esp_ble_gattc_cb_param_t*)':
src/esphome/components/smartboiler/smartboiler.cpp:227:68: error: 'class esphome::ble_client::BLEClient' has no member named 'gattc_if'
    auto status = esp_ble_gattc_register_for_notify(this->parent()->gattc_if, this->parent()->remote_bda, chr->handle);
                                                                    ^
src/esphome/components/smartboiler/smartboiler.cpp:227:94: error: 'class esphome::ble_client::BLEClient' has no member named 'remote_bda'
    auto status = esp_ble_gattc_register_for_notify(this->parent()->gattc_if, this->parent()->remote_bda, chr->handle);
                                                                                              ^
*** [/data/drazice-boiler-proxy/.pioenvs/drazice-boiler-proxy/src/esphome/components/smartboiler/smartboiler.cpp.o] Error 1
========================== [FAILED] Took 2.57 seconds ==========================

Many thanks for your help.

pedobry commented 1 year ago

I believe there was some change in ble_client code. smartboiler.cpp needs to be fixed:

gattc_if replaced with get_gattc_if() conn_id replaced with get_conn_id() remote_bda replaced with get_ remote_bda()

lpjerry commented 1 year ago

Thank you pedobry. I managed to compile the program. It's working now.