syssi / esphome-pipsolar

ESPHome component to monitor and control a pipsolar inverter via RS232
Apache License 2.0
78 stars 35 forks source link

Can not compile, missing pipsolar_textsensor.o #86

Closed proasnet closed 10 months ago

proasnet commented 10 months ago

Hi dear @syssi, I have a problem with compile node to wrower. Please, can you see on it? Thank you


substitutions:
  name: technology
  device_description: "Monitor and control technology"
  updates: 30s
  mppt_rx: GPIO26
  mppt_tx: GPIO25
  inv1_rx: GPIO3
  inv1_tx: GPIO1
  inv2_rx: GPIO9
  inv2_tx: GPIO10
  bms0: "${name} bms0"
  external_components_source_1: github://syssi/esphome-jk-bms@main

  bms0_mac_address: C8:47:8C:E4:52:9D
  bms0_protocol_version: JK02

external_components:
  - source: ${external_components_source_1}
    refresh: 0s

esphome:
  name: ${name}
  comment: ${device_description}

esp32:
  board: esp-wrover-kit
  framework:
    type: esp-idf

logger:
  baud_rate: 0

api:
  reboot_timeout: 0s

esp32_ble_tracker:

ble_client:
  - mac_address: ${bms0_mac_address}
    id: client0

jk_bms_ble:
  - ble_client_id: client0
    protocol_version: ${bms0_protocol_version}
    throttle: 10s
    id: bms0

ota:

web_server:
  port: 80

wifi:
  ssid: !secret wifi_ssid_0
  password: !secret wifi_password

captive_portal:

time:
  - platform: sntp
    id: sntp_time
    servers: "pool.ntp.org"

uart: 
  - id: mod_bus
    tx_pin: ${mppt_tx}
    rx_pin: ${mppt_rx}
    baud_rate: 9600
    stop_bits: 1
    debug:

  - id: inv1_uart
    tx_pin: ${inv1_tx}
    rx_pin: ${inv1_rx}
    baud_rate: 2400

#  - id: inv2_uart
#    tx_pin: ${inv2_tx}
#    rx_pin: ${inv2_rx}
#    baud_rate: 2400

modbus:
  uart_id: mod_bus
  send_wait_time: 200ms
  id: mod_bus_easun

modbus_controller:
  - id: easun
    address: 0x1
    modbus_id: mod_bus_easun
    command_throttle: 200ms
    setup_priority: -10
    update_interval: ${updates}

pipsolar:
  - uart_id: inv1_uart
    id: inverter1
#  - uart_id: inv2_uart
#    id: inverter2

sensor:
 # MPPT
  - platform: modbus_controller
    modbus_controller_id: easun
    id: battery_voltage
    name: "Battery voltage"
    address: 0x102
    register_type: holding
    unit_of_measurement: "V"
    value_type: U_WORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: easun
    id: charging_current
    name: "Charging current"
    address: 0x103
    register_type: holding
    unit_of_measurement: "A"
    value_type: U_WORD
    accuracy_decimals: 0
    filters:
      - multiply: 0.01

  - platform: modbus_controller
    modbus_controller_id: easun
    id: charging_power
    name: "Charging power"
    address: 0x104
    register_type: holding
    unit_of_measurement: "W"
    value_type: U_WORD

  - platform: modbus_controller
    modbus_controller_id: easun
    id: actual_temperature
    name: "Actual temperature"
    address: 0x105
    register_type: holding
    unit_of_measurement: "°C"
    value_type: U_WORD
    bitmask: 0xFF00

  - platform: modbus_controller
    modbus_controller_id: easun
    id: pv_input_voltage
    name: "PV array input voltage"
    address: 0x109
    register_type: holding
    unit_of_measurement: "V"
    value_type: U_WORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: easun
    id: max_day_power
    name: "Maximum day power"
    address: 0x10A
    register_type: holding
    unit_of_measurement: "W"
    value_type: U_WORD

  - platform: modbus_controller
    modbus_controller_id: easun
    id: power_day_generation
    name: "Power day generation"
    address: 0x10B
    register_type: holding
    unit_of_measurement: "kWh"
    state_class: "total_increasing"
    device_class: "energy"
    value_type: U_WORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.001

  - platform: modbus_controller
    modbus_controller_id: easun
    id: power_day_consumption
    name: "Power day consumption"
    address: 0x10C
    register_type: holding
    unit_of_measurement: "kWh"
    state_class: "total_increasing"
    device_class: "energy"
    value_type: U_WORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.001

  - platform: modbus_controller
    modbus_controller_id: easun
    id: charging_status_number
    name: "Charging status number"
    address: 0x10D
    register_type: holding
    value_type: U_WORD
    bitmask: 0x00FF
    on_value:
      - if:
          condition:
            lambda: 'return id(charging_status_number).state == 0;'
          then:
            - text_sensor.template.publish:
                id: charging_status_text
                state: "No charge"
      - if:
          condition:
            lambda: 'return id(charging_status_number).state == 1;'
          then:
            - text_sensor.template.publish:
                id: charging_status_text
                state: "Open charge mode"
      - if:
          condition:
            lambda: 'return id(charging_status_number).state == 2;'
          then:
            - text_sensor.template.publish:
                id: charging_status_text
                state: "MPPT charge mode"
      - if:
          condition:
            lambda: 'return id(charging_status_number).state == 3;'
          then:
            - text_sensor.template.publish:
                id: charging_status_text
                state: "Equalizing charge mode"
      - if:
          condition:
            lambda: 'return id(charging_status_number).state == 4;'
          then:
            - text_sensor.template.publish:
                id: charging_status_text
                state: "Boost charge mode"
      - if:
          condition:
            lambda: 'return id(charging_status_number).state == 5;'
          then:
            - text_sensor.template.publish:
                id: charging_status_text
                state: "Float charge mode"
      - if:
          condition:
            lambda: 'return id(charging_status_number).state == 6;'
          then:
            - text_sensor.template.publish:
                id: charging_status_text
                state: "Current limit!!!"

  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Alarm information"
    id: alarm_information
    address: 0x10E
    register_type: holding
    value_type: U_WORD

  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Total running days"
    id: total_running_days
    address: 0x10F
    register_type: holding
    value_type: U_WORD

  - platform: modbus_controller
    modbus_controller_id: easun
    id: cumulative_power_generation
    name: "Cumulative power generation"
    address: 0x110
    register_type: holding
    unit_of_measurement: "kWh"
    state_class: "total_increasing"
    device_class: "energy"
    value_type: U_DWORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.001

  - platform: modbus_controller
    modbus_controller_id: easun
    id: cumulative_power_consumption
    name: "Cumulative power consumption"
    address: 0x112
    register_type: holding
    unit_of_measurement: "kWh"
    state_class: "total_increasing"
    device_class: "energy"
    value_type: U_DWORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.001

  - platform: modbus_controller
    modbus_controller_id: easun
    id: boost_charge_voltage
    name: "Boost charge voltage"
    unit_of_measurement: "V"
    address: 0x205
    register_type: holding
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.2       

  # JKBMS
  - platform: jk_bms_ble
    jk_bms_ble_id: bms0
    delta_cell_voltage:
      name: "${bms0} delta cell voltage"
    average_cell_voltage:
      name: "${bms0} average cell voltage"
    total_voltage:
      name: "${bms0} total voltage"
    current:
      name: "${bms0} current"
    power:
      name: "${bms0} power"
    temperature_sensor_1:
      name: "${bms0} temperature sensor 1"
    temperature_sensor_2:
      name: "${bms0} temperature sensor 2"
    power_tube_temperature:
      name: "${bms0} power tube temperature"
    state_of_charge:
      name: "${bms0} state of charge"
    capacity_remaining:
      name: "${bms0} capacity remaining"
    charging_cycles:
      name: "${bms0} charging cycles"
    cell_voltage_1:
      name: "${bms0} cell voltage 1"
    cell_voltage_2:
      name: "${bms0} cell voltage 2"
    cell_voltage_3:
      name: "${bms0} cell voltage 3"
    cell_voltage_4:
      name: "${bms0} cell voltage 4"
    cell_voltage_5:
      name: "${bms0} cell voltage 5"
    cell_voltage_6:
      name: "${bms0} cell voltage 6"
    cell_voltage_7:
      name: "${bms0} cell voltage 7"
    cell_voltage_8:
      name: "${bms0} cell voltage 8"
    cell_voltage_9:
      name: "${bms0} cell voltage 9"
    cell_voltage_10:
      name: "${bms0} cell voltage 10"
    cell_voltage_11:
      name: "${bms0} cell voltage 11"
    cell_voltage_12:
      name: "${bms0} cell voltage 12"
    cell_voltage_13:
      name: "${bms0} cell voltage 13"
    cell_voltage_14:
      name: "${bms0} cell voltage 14"
    cell_voltage_15:
      name: "${bms0} cell voltage 15"
    cell_voltage_16:
      name: "${bms0} cell voltage 16"

  # Inverter 1
  - platform: pipsolar
    pipsolar_id: inverter1
    grid_rating_voltage:
      id: inverter1_grid_rating_voltage
      name: Inverter 1 Grid Rating Voltage
    ac_output_rating_frequency:
      id: inverter1_ac_output_rating_frequency
      name: Inverter 1 AC Output Rating Freq
    grid_rating_current:
      id: inverter1_grid_rating_current
      name: Inverter 1 Grid Rating Current
    ac_output_apparent_power:
      id: inverter1_ac_output_apparent_power
      name: Inverter 1 AC Output Apparent Power
    ac_output_active_power:
      id: inverter1_ac_output_active_power
      name: Inverter 1 AC Output Active Power
    grid_voltage:
      id: inverter1_grid_voltage
      name: Inverter 1 Grid Voltage
    grid_frequency:
      id: inverter1_grid_frequency
      name: Inverter 1 Grid Freq
    ac_output_voltage:
      id: inverter1_ac_output_voltage
      name: Inverter 1 AC Output Voltage
    ac_output_frequency:
      id: inverter1_ac_output_frequency
      name: Inverter 1 AC Output Freq   
    output_load_percent:
      id: inverter1_output_load_percent
      name: Inverter 1 Output Load Percent 
    bus_voltage:
      id: inverter1_bus_voltage
      name: Inverter 1 Bus Voltage
    battery_voltage:
      id: inverter1_battery_voltage
      name: Inverter 1 Battery Voltage
    battery_charging_current:
      id: inverter1_charging_current
      name: Inverter 1 Charging Current
    battery_capacity_percent:
      id: inverter1_battery_capacity_percent
      name: Inverter 1 Battery Cap Percent
    inverter_heat_sink_temperature:
      id: inverter1_inverter_heat_sink_temperature
      name: Inverter 1 Inverter Heat Sink Temp
    pv_input_current_for_battery:
      id: inverter1_pv_input_current_for_battery
      name: Inverter 1 PV Input Current
    pv_input_voltage:
      id: inverter1_pv_input_voltage
      name: Inverter 1 PV Input Voltage
    battery_voltage_scc:
      id: inverter1_battery_voltage_scc
      name: Inverter 1 Battery Voltage SCC
    battery_discharge_current:
      id: inverter1_battery_discharge_current
      name: Inverter 1 Battery Discharge Current
    pv_charging_power:
      id: inverter1_pv_charging_power
      name: Inverter 1 PV Charging Power

  # Inverter 2
#  - platform: pipsolar
#    pipsolar_id: inverter2
#    grid_rating_voltage:
#      id: inverter2_grid_rating_voltage
#      name: Inverter 2 Grid Rating Voltage
#    ac_output_rating_frequency:
#      id: inverter2_ac_output_rating_frequency
#      name: Inverter 2 AC Output Rating Freq
#    grid_rating_current:
#      id: inverter2_grid_rating_current
#      name: Inverter 2 Grid Rating Current
#    ac_output_apparent_power:
#      id: inverter2_ac_output_apparent_power
#      name: Inverter 2 AC Output Apparent Power
#    ac_output_active_power:
#      id: inverter2_ac_output_active_power
#      name: Inverter 2 AC Output Active Power
#    grid_voltage:
#      id: inverter2_grid_voltage
#      name: Inverter 2 Grid Voltage
#    grid_frequency:
#      id: inverter2_grid_frequency
#      name: Inverter 2 Grid Freq
#    ac_output_voltage:
#      id: inverter2_ac_output_voltage
#      name: Inverter 2 AC Output Voltage
#    ac_output_frequency:
#      id: inverter2_ac_output_frequency
#      name: Inverter 2 AC Output Freq   
#    output_load_percent:
#      id: inverter2_output_load_percent
#      name: Inverter 2 Output Load Percent 
#    bus_voltage:
#      id: inverter2_bus_voltage
#      name: Inverter 2 Bus Voltage
#    battery_voltage:
#      id: inverter2_battery_voltage
#      name: Inverter 2 Battery Voltage
#    battery_charging_current:
#      id: inverter2_charging_current
#      name: Inverter 2 Charging Current
#    battery_capacity_percent:
#      id: inverter2_battery_capacity_percent
#      name: Inverter 2 Battery Cap Percent
#    inverter_heat_sink_temperature:
#      id: inverter2_inverter_heat_sink_temperature
#      name: Inverter 2 Inverter Heat Sink Temp
#    pv_input_current_for_battery:
#      id: inverter2_pv_input_current_for_battery
#      name: Inverter 2 PV Input Current
#    pv_input_voltage:
#      id: inverter2_pv_input_voltage
#      name: Inverter 2 PV Input Voltage
#    battery_voltage_scc:
#      id: inverter2_battery_voltage_scc
#      name: Inverter 2 Battery Voltage SCC
#    battery_discharge_current:
#      id: inverter2_battery_discharge_current
#      name: Inverter 2 Battery Discharge Current
#    pv_charging_power:
#      id: inverter2_pv_charging_power
#      name: Inverter 2 PV Charging Power

number:
  # JKBMS
  - platform: jk_bms_ble
    jk_bms_ble_id: bms0
    balance_trigger_voltage:
      name: "${bms0} balance trigger voltage"
    balance_starting_voltage:
      name: "${bms0} balance starting voltage"
    power_off_voltage:
      name: "${bms0} power off voltage"

binary_sensor:

  # JKBMS
  - platform: jk_bms_ble
    jk_bms_ble_id: bms0
    balancing:
      name: "${bms0} balancing"
    charging:
      name: "${bms0} charging"
    discharging:
      name: "${bms0} discharging"

switch:

  # JKBMS
  - platform: jk_bms_ble
    jk_bms_ble_id: bms0
    charging:
      name: "${bms0} charging"
    discharging:
      name: "${bms0} discharging"
    balancer:
      name: "${bms0} balancer"

  - platform: ble_client
    ble_client_id: client0
    name: "${bms0} enable bluetooth connection"

text_sensor:
  # JKBMS
  - platform: jk_bms_ble
    jk_bms_ble_id: bms0
    errors:
      name: "${bms0} errors"
    total_runtime_formatted:
      name: "${bms0} total runtime formatted"

  # MPPT
  - platform: template
    name: "Charging status text"
    id: charging_status_text

  # Inverter 1
  #- platform: pipsolar
  #  pipsolar_id: inverter1
  #  device_mode:
  #    id: inverter1_device_mode
  #    name: Inverter 1 Device Mode

  # Inverter 2
#  - platform: pipsolar
#    pipsolar_id: inverter2
#    device_mode:
#      id: inverter2_device_mode
#      name: Inverter 2 Device Mode

button:
  # JKBMS
  - platform: jk_bms_ble
    jk_bms_ble_id: bms0
    retrieve_settings:
      name: "${bms0} retrieve settings"
    retrieve_device_info:
      name: "${bms0} retrieve device info"

  - platform: restart
    name: "ESP_Restart"

output:
  # Inverter 1
#  - platform: pipsolar
#    pipsolar_id: inverter1
#    battery_recharge_voltage:
#      id: inverter1_battery_recharge_voltage
#      possible_values: [44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0]   
#    battery_redischarge_voltage:    
#      id: inverter1_battery_redischarge_voltage
#      possible_values: [48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0]

#    battery_under_voltage:
#      id: inverter1_battery_under_voltage
#      possible_values: [50.0, 50.1, 50.2]
#        
#    battery_float_voltage:
#      id: inverter1_battery_float_voltage
#      possible_values: [24.0, 24.5, 25.0, 25.5, 26.0, 26.5, 27.0, 27.5, 28.0, 28.5, 29.0]
#    battery_bulk_voltage:
#      id: inverter1_battery_bulk_voltage_out
#      possible_values: [24.0, 24.1, 24.2]
#    current_max_ac_charging_current:
#      id: inverter1_current_max_ac_charging_current
#      possible_values: [2, 10, 20, 30, 40, 50, 60]
#    current_max_charging_current:
#      id: inverter1_current_max_charging_current
#      possible_values: [10, 20, 30, 40, 50, 60]    

#    charger_source_priority:
#      id: inverter1_charger_source_priority
#    output_source_priority:
#      id: inverter1_output_source_priority

#    battery_type:
#      id: inverter1_battery_type

    # Inverter 2
#  - platform: pipsolar
#    pipsolar_id: inverter2
#    battery_recharge_voltage:
#      id: inverter2_battery_recharge_voltage
#      possible_values: [44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0]  
#    battery_redischarge_voltage:    
#      id: inverter2_battery_redischarge_voltage
#      possible_values: [48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0]

#    battery_under_voltage:
#      id: inverter2_battery_under_voltage
#      possible_values: [25.0, 25.1, 25.2, 25.3, 25.4, 25.5, 25.6, 25.7, 25.8, 25.9,
#                        26.0, 26.1, 26.2, 26.3, 26.4, 26.5, 26.6, 26.7, 26.8, 26.9,
#                        27.0, 27.1, 27.2, 27.3, 27.4, 27.5, 27.6, 27.7, 27.8, 27.9,
#                        28.0, 28.1, 28.2, 28.3, 27.8, 28.5, 28.6, 28.7, 28.8, 28.9,
#                        29.0, 29.1, 29.2, 29.3, 29.4, 29.5, 29.6, 29.7, 29.8, 29.9,
#                        30.0, 30.1, 30.2, 30.3, 30.4, 30.5, 30.6, 30.7, 30.8, 30.9,
#                        31.0, 31.1, 31.2, 31.3, 31.4, 31.5]

#    battery_float_voltage:
#      id: inverter2_battery_float_voltage
#      possible_values: [24.0, 24.5, 25.0, 25.5, 26.0, 26.5, 27.0, 27.5, 28.0, 28.5, 29.0]
#    battery_bulk_voltage:
#      id: inverter2_battery_bulk_voltage_out
#      possible_values: [24.0, 24.1, 24.2]
#    current_max_ac_charging_current:
#      id: inverter2_current_max_ac_charging_current
#      possible_values: [2, 10, 20, 30, 40, 50, 60]
#    current_max_charging_current:
#      id: inverter2_current_max_charging_current
#      possible_values: [10, 20, 30, 40, 50, 60]    

#    charger_source_priority:
#      id: inverter2_charger_source_priority
#    output_source_priority:
#      id: inverter2_output_source_priority

#    battery_type:
#      id: inverter2_battery_type

INFO ESPHome 2023.8.2
INFO Reading configuration /config/esphome/technology.yaml...
INFO Updating https://github.com/syssi/esphome-jk-bms.git@main
INFO Detected timezone 'Europe/Prague'
INFO Generating C++ source...
INFO Compiling app...
Processing technology (board: esp-wrover-kit; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40405.230623 (4.4.5) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
Dependency Graph
|-- ArduinoJson @ 6.18.5
*** [/data/technology/.pioenvs/technology/src/esphome/components/pipsolar/text_sensor/pipsolar_textsensor.o] Source `src/esphome/components/pipsolar/text_sensor/pipsolar_textsensor.cpp' not found, needed by target `/data/technology/.pioenvs/technology/src/esphome/components/pipsolar/text_sensor/pipsolar_textsensor.o'.
========================= [FAILED] Took 27.89 seconds =========================