syssi / esphome-pipsolar

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

New sensors and custom settings on mi invertor Effekta AX- Series #127

Open tiimsvk opened 6 months ago

tiimsvk commented 6 months ago

Hello. I made a new configuration file for my solar inverter Effekta AX-Series AX-P1 3000-24

Connecting the inverter via a digital isolator outside the USB interface. (see yaml)

#-------------------------------------------
# BUG AND REPAIR AND PLANNED
#-------------------------------------------
# Added:
# -1 relay input 230AC, output 2 relay
# -CT clamp input
# -BL0939 power meter output
# -Battery temperature
# -Segment display? 
# -Mosfet output 24V

#-------------------------------------------
# REVISION
#-------------------------------------------
# 2024.05.09 - Fisrt version

#-------------------------------------------
# SUBTITUTIONS - basic definitions and description of the device
#-------------------------------------------
substitutions:
  friendly_name: energy-solar
  device_name: energy-solar
  created_by: "StudioTiiM 2024"
  device_description: "Monitoring solar inverter"

#-------------------------------------------
# POWER CONSUMPTION 
# whit multimeter
#-------------------------------------------
# Power consumption 
# Normal-  wifi:            mA

#-------------------------------------------
# DEFINE PINS AND VARIABILES
# CIRCUIT AND MODULES - basic definitions and description of the device
#-------------------------------------------

 # ----- MCU -----
  # Module: ESP32-S + adapter
   # Circuit: Solder on Prototype PCB expansion board ESP32 7x9cm
   # LDO:  Voltage in: max 6.5V, out: 3.3 +/- 0.3V, Current: 500mA / Drop voltage 0.260V / Quiescent current: 40µA
   # BATTERY PROTECTION: LP4054 Voltage in: max 6.5V, out: 4.2V, Current charging: 500mA Ires: 2kΩ

   # Power Consumption: Peak 450mA  / Normal wifi:  150mA  / Normal: 50mA  / Wifi disable: / DeepSleep: 0.01mA 
   # Specification: Chip Family: ESP32 / Chip Model: ESP32-D0WDQ6 (revision 1) / Number of Cores: 2 /Max CPU Frequency: 240MHz / Has Bluetooth: YES / Has Embedded Flash: NO / Has Factory-Calibrated ADC: YES /MAC Address: C8:C9:A3:C7:C4:F4

   # Pinout:
    #                    +-----------------------+
    #                    |  +--+  +--+  +--+--+  |
    #                    |  |  |  |  |  |  |  |  |
    #                    |  |  +--+  +--+  |  |  |
    #                    |                       |
    #             GND --+|                       |+-- GND
    #             3V3 --+|                       |+-- GPIO23 VSPI
    #              EN --+|                       |+-- GPIO22 VSPI SCL
    # ADC1 VP  GPIO36 --+|   +----------+        |+-- GPIO01 TXD0 CLKOU3
    # ADC1 VN  GPIO39 --+|   | MCU      |        |+-- GPIO03 RXD0 CLKOUT2
    # ADC1     GPIO34 --+|   |          |        |+-- GPIO21 VSPI SDA
    # ADC1     GPIO35 --+|   |          |        |+-- NC
    # ADC1     GPIO32 --+|   |          |        |+-- GPIO19 VSPI
    # ADC1     GPIO33 --+|   +----------+        |+-- GPIO18 VSPI
    # ADC2 DAC GPIO25 --+|     +---------+       |+-- GPIO05 VSPI
    # ADC2 DAC GPIO26 --+|    -| FLASH   |-      |+-- GPIO17 TXD2
    # ADC2     GPIO27 --+|    -|         |-      |+-- GPIO16 RXD2
    # ADC2     GPIO14 --+|    -|         |-      |+-- GPIO04 ADC2 
    # ADC2     GPIO12 --+|    -|        °|-      |+-- GPIO0  ADC2 CLKOUT1
    #                    |     +---------+       |
    #                    +-----------------------+
    #                       + + + + + + + + + +
    #                       | | | | | | | | | |
    #              GND -----+ | | | | | | | | +------ GPIO02 ADC2
    #     ADC2 GPIO13 --------+ | | | | | | +-------- GPIO15 ADC2
    #      SPI GPIO09 ----------+ | | | | +---------- GPIO08 SPI
    #      SPI GPIO10 ------------+ | | +------------ GPIO07 SPI
    #      SPI GPIO11 --------------+ +-------------- GPIO06 SPI

   # Description pins:
    # PINS ESP32    | FUNCTION     | INPUT | OUTPUT | ADC | PWM | I2C           | SPI  | RESISTOR             | BOOT       | FLASH   | HIGH AT BOOT | BOOT FAILS | NOTES
    # ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    # EN            | RESET                                                            | 10.0k PULLUP PCB     |                                     |
    # GPIO0         | STRAPPING    | OK!   | OK!    |     | OK  | OK            |      | 10.0k PULLUP         | PULLUP    | PULLDOWN | PWM          | LOW
    # GPIO01 *      | TX           | OK!*1 | OK     |     | OK  | OK            |      |                      |           |          | HIGH         |            | 
    # GPIO02 *      | STATUS LED   | OK    | OK     |     | OK  | OK            |      | INTERNAL PULLDOWN    | PULLUP    |          | HIGH         |            | 
    # GPIO03 *      | RX           | OK    | OK!*1  |     | OK  | OK            |      |                      |           |          | HIGH         |            | 
    # GPIO04        |              | OK    | OK     |     | OK  | OK            |      | INTERNAL PULLDOWN    |           |          |              |
    # GPIO05        | STRAPPING    | OK    | OK!    |     | OK  | OK            |      | INTERNAL PULLUP      |           |          | PWM          | LOW
    # GPIO06        | INTERNAL SPI |       |        |     |     |               | CLK  |                      |           |          |              |
    # GPIO07        | INTERNAL SPI |       |        |     |     |               | MISO |                      |           |          |              |
    # GPIO08        | INTERNAL SPI |       |        |     |     |               | MOSI |                      |           |          |              |
    # GPIO09        | INTERNAL SPI |       |        |     |     |               | HD   |                      |           |          | HIGH         |
    # GPIO10        | INTERNAL SPI |       |        |     |     |               | WP   |                      |           |          | HIGH         |
    # GPIO11        | SPI CSC/CMD  |       |        |     |     |               | CS   |                      |           |          | HIGH         |
    # GPIO12        | STRAPPING    | OK!*3 | OK     |     | OK  | OK            |      |                      |           |          | LOW          | HIGH
    # GPIO13        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |
    # GPIO14        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          | PWM          |
    # GPIO15        | STRAPPING    | OK!   | OK!    |     | OK  | OK            |      |                      | PULLDOWN  |          | PWM          | HIGH
    # GPIO16        | RX2 PSRAM*4  | OK    | OK     |     | OK  | OK            |      |                      |           |          | PWM          |
    # GPIO17        | TX2 PSRAM*4  | OK    | OK     |     | OK  | OK            |      |                      |           |          | PWM          |
    # GPIO18        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |
    # GPIO19        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |

    # GPIO21        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |
    # GPIO22        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |
    # GPIO23        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |

    # GPIO25        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |
    # GPIO26        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |
    # GPIO27        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |

    # GPIO32        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |
    # GPIO33        |              | OK    | OK     |     | OK  | OK            |      |                      |           |          |              |

    # GPIO34        |              | OK    |        | OK  |     |               |      |                      |           |          |              |
    # GPIO35        |              | OK    |        | OK  |     |               |      |                      |           |          |              |
    # GPIO36        | VP           | OK*5  |        | OK  |     |               |      |                      |           |          |              |
    # GPIO39        | VN           | OK*5  |        | OK  |     |               |      |                      |           |          |              |

    # * Connected on this project
    # *1 Disable hardware uart. logger baud_rate: 0
    # *2 recommended I2C
    # *3 May damage flash if low at boot on 1.8V flash chips
    # *4 GPIO 16 & 17 are usually connected to the SPI flash and PSRAM. These do show some activity during boot to detect the presence of PSRAM. For example GPIO 17 may still show some high frequency signal until it is specifically set to a high or low output state. When PSRAM is present, these pins should not be used.
    # *5 GPIO 36 & 39 should not be used for interrupts when also using ADC or WiFi and Bluetooth. These pins are on some boards labelled as: 
    #    The internal Hall sensor in the ESP32 is connected to these two pins.
    #    The Hall Sensor uses channels 0 and 3 of ADC1. Do not configure these channels for use as ADC channels when also reading from the Hall sensor.
    # *6 
    # GPIO08 and GPIO09 pulldown invalid on boot
    # Current draw 12mA max per GPIO

# ----- ELECTRICITY ---------
 # ----- POWER SUPPLY -------
  # Module: connected to USB
  # Protection: 
    # Fuse PPTC: 6V 750mA connected on LDO input Marking: 5

  # ----- LDO REGULATORS -----
  # Module: holtek HT7833 original
   # Specification: Voltage in 0-8 out fixed 3.3V 2% / max voltage drop 360mV / current max 0.5A / current standby 4μA / protection: overtemperature; current limiting

# ----- SOLAR SYSTEM ---------
 # ----- BATTERY ------------
  # Manufacture:              LittoKala 
  # Type:                     LiFePo4 8S1P 24V100Ah
  # Installed:                   2          pcs
  # Nominal Voltage:            24.0        V
  # Working Voltage:            21.6 ~ 27.6 V
  # Nominal Capacity:          100          Ah
  # True Capacity:              70          Ah (140Ah)
  # Nominal Energy:           2400          Wh
  # True Energy:              1680          Wh (3360Wh)
  # Max. Charging Voltage:      29.2        V ± 0.2V
  # Max. Charging Current:      20          A (40A)
  # Max. Discharging Current:  100          A (200A)
  # Weight:                     18.7        kg
  # Dimension:                50x34x10      cm

  battery_capacite: "3360"

   # LIFEPO4 Battery charging specification:
     # 3 stage charging:
      # 1. stage: BULK       - Constant current SET max 30A   (show battery specification) (20% capacity battery)
      # 2. stage: ABSORBTION - Constant voltage SET max 29.0V (3.625V per cell)
      # 3. stage: FLOAT      - 27.6V                          (3.45V per cell)(current: 1% max capacity = 100Ah * 0.01 = 1A)

 # ----- SOLAR PANEL ----- 
  # Module: Q.CELLS (Q.PRO-G2 235) panel 235Wp polycrystal 29V
   # Specification: Pmax 235W / Voltage Vmp: 29.26V Voc: 37.02V / Imp: 8.13A Isc: 8.71A / dimension: 167x100x50cm / Operating temperature: -40 ~ +85°C
    # Vzdialenosť S = https://calc.efve.cz/preskokova-vzdalenost-s-a-jeji-vypocet/

 # ----- INVERTOR -----
  # Module: Efekta AX seria P1 3000-24 MPPT (similar Axpert MKS 3kW)
   # Specifications:
    # Arcticel number: SLAPVTSI3K0W1024
    # Operating temperature rnge: 0 ~ 50°C
    # Inverted Mode:               
     # Rated Active Power:         3000  W
     # Rated Apparent Power:       3000  AV
     # DC Input Voltage:           24    V 
     # DC Input Current:           142   A
     # AC Output Voltage:          230   V 
     # AC Output Frequency:        50/60 Hz 
     # Ac Output Current:          13    A
    # AC Charging Mode:
     # AC Input Voltage:           230 VAC
     # AC Input Frequency:         50/60 Hz 
     # AC Input Current:           17.7  A
     # DC Output Voltage:          27    VDC
     # AC Output Voltage:          230   VAC 
     # AC Output Current:          13    A
    # Solar Charge Mode:
     # Rated Curent                60       A
     # System Voltage:             24       VDC
     # Operating Voltage Range:    30 ~ 115 VDC
     # Max. Solar Voltage (VOC):   145      VDC

   # Connector: communication board
    # Circuit: 6 pin connector
     # 6 pin connector | Digtal isolator | MCU ESP32
     # 1 TX            | AI -> AO        | TX
     # 2 RX            | BO -> BI        | RX
     # 3 5V            | V2 -> V1        | 3V3
     # 4 GND           | G2 -> G1        | GND
     # 5 HFPW+         |                 |
     # 6 Relay         |                 |

     # Digital isolator: π122U31

  # COMMUNICATIONS: https://github.com/ardupic/voltronic-inverter-communication-protocols or See MAX_Communication_Protocol_20210217.pdf

# Power Consumption device:
  # Cellar
   # pracovňa led pás 55W
   # Pivnica svetlo vstup 10W
   # Pivnica neonka 25W
   # PC 180W
   # Kotol 200W standby 7W
   # Okruhy 10W - 40W
   # Kamera xiaomi 1,5W

   # Server:
    # LEd pas: 25W
    # Gateway: 16W
    # RPI: 14W
    # Kamery + Router 35W

    # Atelier 10W standby (klimatizacia)
    # Peltier chladnčka 100W standby 20W

 ##   Sonoff Dual R3 https://www.letscontrolit.com/forum/viewtopic.php?t=8948

# ----- OTHERS ------
# Other charger module in other battery
 # SD30CRMA MPPT Charger
 # Enable after in voltage 17.5 - 18.5V
 # R5 = 12k input 7-28V

 # ----- LEDS -----
 # STATUS LED
  # Module: smd on board
  status_led_pin: GPIO02

 # ----- TEMPERATURE -----
  # Module: 3x Dallas DS18B20
   # Circuit: 4.7k resistor data pin to VCC
   # Power consumption: 50μA
   # Measure: Battery
  dallas_pin: GPIO0
  update_time: 60s

#-------------------------------------------
# PROTOCOLS
#-------------------------------------------
 # ----- PROTOCOLS PINS -----
  # UART
  uart_tx: GPIO01
  uart_rx: GPIO03

 # ----- PROTOCOLS SETTINGS -----
uart:
  # BaudRate 2400
  # Start Bit 1
  # Data Bit 8
  # Parity Bit N
  # Stop Bit 1
  - id: uart_bus
    tx_pin: GPIO1
    rx_pin: GPIO3
    baud_rate: 2400
    #rx_buffer_size: 512

    # DEBBUGING DEVELOPER READY CODES
    #debug:
    #  direction: BOTH
    #  dummy_receiver: false
    #  after:
    #    delimiter: "\r"
    #  sequence:
    #    - lambda: UARTDebug::log_string(direction, bytes);

dallas:
  - pin: 
      number: "$dallas_pin"
      ignore_strapping_warning: true
    update_interval: $update_time

#-------------------------------------------
# ESP - MAIN SETTINGS
#-------------------------------------------
esphome:
  name: energy-solar
  project:
    name: "studiotiim.energy_solar"
    version: 2024.05.1.0.0

esp32:
  board: esp32dev
  framework:
    type: esp-idf
    version: recommended

# Enable Home Assistant API
api:
  reboot_timeout: 60min
ota:
  password: !secret ota_pass

#-------------------------------------------
# LOGGER
#-------------------------------------------
logger:
  # disable log over uart
  baud_rate: 0
  logs:
    # Hidden warning: 
    # [00:00:00][W][component:204]: Component xxxxxx took a long time for an operation (x.xx s).
    # [00:00:00][W][component:205]: Components should block for at most 20-30ms.
    # Source: https://github.com/esphome/issues/issues/4717
    component: ERROR

#-------------------------------------------
# ETHERNET
#-------------------------------------------
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.31.210
    gateway:   192.168.31.1
    subnet:    227.227.227.0
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Energy-Solar Fallback Hotspot"
    password: "passenergysolar"

captive_portal:

#-------------------------------------------
# EXTERNAL AND CUSTOM COMPONENT
#-------------------------------------------
external_components:
  #- source: github://syssi/esphome-pipsolar@pip8048
  #- source: github://syssi/esphome-pipsolar@2424mse1
  #- source: github://syssi/esphome-pipsolar@hms-3k-24v
  #  refresh: 0s
  #- source: github://pr#5299
  #  components: [pipsolar]
  #  refresh: always

  # Edited syssi custom component whit mixed 2424mse1 and pip8048 whot add functions
  - source: 
      type: local
      path: custom_component
    components:
      - pipsolar

#-------------------------------------------
# STATUS LED
#-------------------------------------------
status_led:
  pin: 
    number: $status_led_pin
    inverted: True
    ignore_strapping_warning: true

#-------------------------------------------
# PIP SOLAR COMPONENT
#-------------------------------------------
pipsolar:
  - uart_id: uart_bus
    id: effekta_ax
    update_interval: 10s

#-------------------------------------------
# SENSORS
#-------------------------------------------
sensor:
  #-------------------------------------------
  # Wifi signal component
  #-------------------------------------------
  - platform: wifi_signal
    name: "${friendly_name} Signal"
    id: "signal_strange"
    update_interval: 60s

#-------------------------------------------
# Total energy - Charge BATTERY
#-------------------------------------------
  - platform: template
    name: "${friendly_name} Battery - Power Charging"
    id: battery_power_charging
    lambda: return (id(battery_charging_current).state * id(battery_voltage).state);
    accuracy_decimals: 0
    unit_of_measurement: W
    icon: "mdi:flash"
    update_interval: 10s

#-------------------------------------------
# Total energy - Discharge BATTERY
#-------------------------------------------
  - platform: template
    name: "${friendly_name} Battery - Power Discharging"
    id: battery_power_discharging
    lambda: return (id(battery_discharging_current).state * id(battery_voltage).state);
    accuracy_decimals: 0
    unit_of_measurement: W
    icon: "mdi:flash"
    update_interval: 10s

#-------------------------------------------
# Total energy - CHARGE DAILY BATTERY
#-------------------------------------------
  - platform: total_daily_energy
    name: "${friendly_name} Battery - Energy Charge"
    power_id: battery_power_charging
    filters:
      - multiply: 0.001
    unit_of_measurement: kWh
    state_class: total_increasing
    device_class: energy
    icon: "mdi:battery-arrow-up-outline"

#-------------------------------------------
# Total energy - DISCHARGE DAILY BATTERY
#-------------------------------------------
  - platform: total_daily_energy
    name: "${friendly_name} Battery - Energy Discharge"
    power_id: battery_power_discharging
    filters:
      - multiply: 0.001
    unit_of_measurement: kWh
    state_class: total_increasing
    device_class: energy
    icon: mdi:battery-arrow-down-outline

#-------------------------------------------
# Total energy - DISCHARGE DAILY BATTERY
#-------------------------------------------
  - platform: total_daily_energy
    name: "${friendly_name} Solar - Energy"
    power_id: solar_power
    filters:
      - multiply: 0.001
    unit_of_measurement: kWh
    state_class: total_increasing
    device_class: energy
    icon: mdi:solar-energy

  #-------------------------------------------
  # PIPSOLAR SENSORS
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    #-------------------------------------------
    # QPIRI - READY
    #-------------------------------------------
    #
    # Parameters rating on this inverter EFFEKTA AX-P1 300-24:
    #
    # Grid voltage:              230.0 V
    # Grid current:               13.0 A
    # AC Output voltage:         230.0 V
    # AC Output current:          13.0 A
    # AC Output frequency:        50.0 Hz
    # AC Output apparent power: 3000.0 VA
    # AC Output active power:   3000.0 W
    # Battery voltage:            24.0 V
    # Machine type:               10   Hybrid
    # Typology:                    0   transformerless
    # Output mode:                 0   single machine output
    # Eeprom version:              0.0

    #-------------------------------------------
    # Unnecessary sensors 
    # whitout changes life invertor
    #-------------------------------------------
    #grid_rating_voltage:
    #  name: "${friendly_name} grid_rating_voltage"
    #grid_rating_current:
    #  name: "${friendly_name} grid_rating_current"
    #ac_output_rating_voltage:
    #  name: "${friendly_name} ac_output_rating_voltage"
    #ac_output_rating_frequency:
    #  name: "${friendly_name} ac_output_rating_frequency"
    #ac_output_rating_current:
    #  name: "${friendly_name} ac_output_rating_current"
    #ac_output_rating_apparent_power:
    #  name: "${friendly_name} ac_output_rating_apparent_power"
    #ac_output_rating_active_power:
    #  name: "${friendly_name} ac_output_rating_active_power"
    #battery_rating_voltage:
    #  name: "${friendly_name} battery_rating_voltage"
    #machine_type:
    #  name: "${friendly_name} machine_type"
    #topology:
    #  name: "${friendly_name} topology"
    #output_mode:
    #  name: "${friendly_name} output_mode"
    #eeprom_version:
    #  name: "${friendly_name} eeprom_version"
    #-------------------------------------------

    #-------------------------------------------
    # BATTERY - type
    # 0 - AGM 
    # 1 - Flooded battery, 
    # 2 - user define, 
    # 3 - Pylontech, 
    # 4 - Shinheung, 
    # 5 - Weco, 
    # 6 - Soltaro, 
    # 7 - BAK, 
    # 8 - Lib, 
    # 9 - Lic
    #-------------------------------------------
    battery_type:
      internal: true
      id: battery_type
      on_value:
      # send text sensor
        then:
          - if:
              condition:
                lambda: return id(battery_type).state == 0;
              then:
                  - text_sensor.template.publish:
                      id: battery_type_text
                      state: "AGM"
          - if:
              condition:
                lambda: return id(battery_type).state == 1;
              then:
                  - text_sensor.template.publish:
                      id: battery_type_text
                      state: "Flooded"
          - if:
              condition:
                lambda: return id(battery_type).state == 2;
              then:
                  - text_sensor.template.publish:
                      id: battery_type_text
                      state: "USER"
          - if:
              condition:
                lambda: return id(battery_type).state == 3;
              then:
                  - text_sensor.template.publish:
                      id: battery_type_text
                      state: "PLYNOTECH"
          - if:
              condition:
                lambda: return id(battery_type).state == 4;
              then:
                  - text_sensor.template.publish:
                      id: battery_type_text
                      state: "SHINHEUNG"
          - if:
              condition:
                lambda: return id(battery_type).state == 5;
              then:
                  - text_sensor.template.publish:
                      id: battery_type_text
                      state: "WECO"
          - if:
              condition:
                lambda: return id(battery_type).state == 6;
              then:
                  - text_sensor.template.publish:
                      id: battery_type_text
                      state: "SOLTARO"
          - if:
              condition:
                lambda: return id(battery_type).state == 7;
              then:
                  - text_sensor.template.publish:
                      id: battery_type_text
                      state: "BAK"
          - if:
              condition:
                lambda: return id(battery_type).state == 8;
              then:
                  - text_sensor.template.publish:
                      id: battery_type_text
                      state: "LIB"
          - if:
              condition:
                lambda: return id(battery_type).state == 9;
              then:
                  - text_sensor.template.publish:
                      id: battery_type_text
                      state: "LIC"

    #-------------------------------------------
    # QPIGS - READY
    #-------------------------------------------
    #-------------------------------------------
    # GRID
    #-------------------------------------------
    grid_voltage:
      name: "${friendly_name} Grid - Voltage"
    grid_frequency:
      name: "${friendly_name} Grid - Frequency"

    #-------------------------------------------
    # LOAD
    #-------------------------------------------
    ac_output_voltage:
      name: "${friendly_name} Load - Voltage"
    ac_output_frequency:
      name: "${friendly_name} Load - Frequency"
    ac_output_apparent_power:
      name: "${friendly_name} Load - Apparent Power"
      icon: "mdi:flash"
    ac_output_active_power:
      name: "${friendly_name} Load - Power"
      icon: "mdi:flash"
      id: load_power
    output_load_percent:
      name: "${friendly_name} Load - Percent"

    #-------------------------------------------
    # BUS
    #-------------------------------------------
    bus_voltage:
      name: "${friendly_name} BUS - Voltage"

    #-------------------------------------------
    # BATTERY
    #-------------------------------------------
    battery_voltage:
      name: "${friendly_name} Battery - Voltage"
      id: battery_voltage
    battery_charging_current:
      name: "${friendly_name} Battery - Current Charging"
      id: battery_charging_current
    battery_discharge_current:
      name: "${friendly_name} Battery - Current Discharge"
      id: battery_discharging_current
    battery_capacity_percent:
      name: "${friendly_name} Battery"
      icon: mdi:battery
    battery_voltage_scc:
      name: "${friendly_name} Battery - Voltage SCC"
    #battery_voltage_offset_for_fans_on:
    #  name: "${friendly_name} Battery - voltage_offset_for_fans_on"

    #-------------------------------------------
    # TEMPERATURE
    #-------------------------------------------
    inverter_heat_sink_temperature:
      name: "${friendly_name} Temperature"
      entity_category: diagnostic

    #-------------------------------------------
    # NOT SUPPORT ON THIS INVERTOR
    #-------------------------------------------
    #pv2_input_current:
    #  name: "${friendly_name} pv2_input_current"
    #pv2_input_voltage:
    #  name: "${friendly_name} pv2_input_voltage"
    #pv2_charging_power:
    #  name: "${friendly_name} pv2_charging_power"
    #parallel_max_num:
    #  name: "${friendly_name} parallel_max_num"
    #pv_ok_condition_for_parallel:
    #  name: "${friendly_name} pv_ok_condition_for_parallel"

    #-------------------------------------------
    # SOLAR
    #-------------------------------------------
    # bad value solar current send same as battery current
    #pv_input_current_for_battery:
    #  name: "${friendly_name} Solar - Current"

    pv_input_voltage:
      name: "${friendly_name} Solar - Voltage"
      id: solar_voltage
    pv_charging_power:
      name: "${friendly_name} Solar - Power"
      id: solar_power

  - platform: template
    name: "${friendly_name} Solar - Current"
    lambda: return (id(solar_power).state / id(solar_voltage).state);
    accuracy_decimals: 1
    unit_of_measurement: A
    icon: "mdi:flash"
    update_interval: 10s
    on_value:
      then:
        if:
          condition:
            lambda: return x > 0.5;
          then:
            - switch.turn_on: backlight_lcd
          else:
            - switch.turn_off: backlight_lcd

    #-------------------------------------------
    # Battery - Disharge Percent
    #-------------------------------------------
  - platform: template
    name: "${friendly_name} Battery - Disharge Percent"
    lambda: return ((id(battery_power_discharging).state / ($battery_capacite / 100)) * (-1));
    accuracy_decimals: 1
    unit_of_measurement: "%"
    update_interval: 10s
    icon: "mdi:battery-arrow-down"

#-------------------------------------------
# TEXT SENSORS
#-------------------------------------------
text_sensor:
  #-------------------------------------------
  # PIP SOLAR - TEXT
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax

    #-------------------------------------------
    # Device mode - text templated
    #
    # MODE          | CODE(M)
    # -----------------------
    # Power on mode | P
    # Standby mode  | S
    # Line mode     | L
    # Battery mode  | B
    # Fault mode    | F
    # Shutdown mode | D
    #-------------------------------------------
    device_mode:
      name: "${friendly_name} device_mode"
      internal: true
      id: device_mode
      on_value:
        then:
          - if:
              condition:
                lambda: return id(device_mode).state == "P";
              then:
                  - text_sensor.template.publish:
                      id: device_mode_text
                      state: "Power on"
          - if:
              condition:
                lambda: return id(device_mode).state == "S";
              then:
                  - text_sensor.template.publish:
                      id: device_mode_text
                      state: "Standby"
          - if:
              condition:
                lambda: return id(device_mode).state == "L";
              then:
                  - text_sensor.template.publish:
                      id: device_mode_text
                      state: "Line"
          - if:
              condition:
                lambda: return id(device_mode).state == "B";
              then:
                  - text_sensor.template.publish:
                      id: device_mode_text
                      state: "Battery"
          - if:
              condition:
                lambda: return id(device_mode).state == "F";
              then:
                  - text_sensor.template.publish:
                      id: device_mode_text
                      state: "Fault"
          - if:
              condition:
                lambda: return id(device_mode).state == "D";
              then:
                  - text_sensor.template.publish:
                      id: device_mode_text
                      state: "Shutdown"

    #-------------------------------------------
    # Unnecessary sensors 
    # whitout changes life invertor
    #-------------------------------------------
    #last_qpigs:
    #  name: "${friendly_name} last_qpigs"
    #last_qpiri:
    #  name: "${friendly_name} last_qpiri"
    #last_qmod:
    #  name: "${friendly_name} last_qmod"
    #last_qflag:
    #  name: "${friendly_name} last_qflag"

  - platform: template
    id: device_mode_text
    name: "${friendly_name} Device mode"
    lambda: |-
      return {"Loading"};
    icon: "mdi:home-battery"
    update_interval: never
    entity_category: diagnostic

  #-------------------------------------------
  # BATTERY - type text
  # 0 - AGM 
  # 1 - Flooded battery, 
  # 2 - user define, 
  # 3 - Pylontech, 
  # 4 - Shinheung, 
  # 5 - Weco, 
  # 6 - Soltaro, 
  # 7 - BAK, 
  # 8 - Lib, 
  # 9 - Lic
  #-------------------------------------------
  - platform: template
    id: battery_type_text
    name: "${friendly_name} Battery - Type"
    lambda: |-
      return {"Loading"};
    icon: mdi:battery-high
    update_interval: never
    entity_category: diagnostic

#-------------------------------------------
# BINARY SENSORS
#-------------------------------------------
binary_sensor:
  #-------------------------------------------
  # PIP SOLAR - BINARY_SENSORS
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    #-------------------------------------------
    # Unnecessary sensors
    #-------------------------------------------
    # b7: false
    #add_sbu_priority_version:
    #  name: "${friendly_name} add_sbu_priority_version"
    # b6: false
    #configuration_status:
    #  name: "${friendly_name} configuration_status"
    # b5: true
    #scc_firmware_version:
    #  name: "${friendly_name} scc_firmware_version"
    # b4
    load_status:
      name: "${friendly_name} Status - Load"
      entity_category: diagnostic
    # b3: false
    #battery_voltage_to_steady_while_charging:
    #  name: "${friendly_name} battery_voltage_to_steady_while_charging"
    # b2
    charging_status:
      name: "${friendly_name} Status - Charging"
      entity_category: diagnostic
    # b1
    scc_charging_status:
      name: "${friendly_name} Status - DC Charging"
      entity_category: diagnostic
    # b0
    ac_charging_status:
      name: "${friendly_name} Status - AC Charging"
      entity_category: diagnostic
    # b10
    charging_to_floating_mode:
      name: "${friendly_name} Status - Float Charging"
      entity_category: diagnostic
    # b9  
    switch_on:
      name: "${friendly_name} Switch On"
      entity_category: diagnostic

    #-------------------------------------------
    # QFLAGS READY
    #-------------------------------------------
    #-------------------------------------------
    # Unnecessary sensors
    #-------------------------------------------
    #silence_buzzer_open_buzzer:
    #  name: "${friendly_name} silence_buzzer_open_buzzer"
    #overload_bypass_function:
    #  name: "${friendly_name} overload_bypass_function"
    #overload_restart_function:
    #  name: "${friendly_name} overload_restart_function"
    #over_temperature_restart_function:
    #  name: "${friendly_name} over_temperature_restart_function"
    #backlight_on:
    #  name: "${friendly_name} backlight_on"
    #lcd_escape_to_default:
    #  name: "${name} lcd_escape_to_default"
    #fault_code:
    #  name: "${friendly_name} Fault Code"

    power_saving:
      name: "${friendly_name} Power Saving"
      entity_category: diagnostic
    warnung_low_pv_energy:
      name: "${friendly_name} Solar - Low energy"
      entity_category: diagnostic
    warning_battery_equalization:
      name: "${friendly_name} Warning battery equa"
      entity_category: diagnostic

    #-------------------------------------------
    # NOT SUPPORT ON THIS INVERTOR
    #-------------------------------------------
    # b8: Axpert V series
    #dustproof_installed:
    #  name: "${friendly_name} dustproof_installed"
    #charge_onoff:
    #  name: "${friendly_name} Charge onoff"
    #discharge_onoff:
    #  name: "${friendly_name} Discharge onoff"
    #discharge_with_standby_onoff:
    #  name: "${friendly_name} Discharge whit standby onoff"

#-------------------------------------------
# SWITCHES
#-------------------------------------------
switch:
  #-------------------------------------------
  # PIP SOLAR - SWITCHES
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    #-------------------------------------------
    # Solar Panel - Power balance
    # QPIRI COMMAND X
    # 0: PV input max current will be the max charged current;
    # 1: PV input max power will be the sum of the max charged power and loads power.
    #-------------------------------------------
    pv_power_balance:
      name: "${friendly_name} Solar - Power Balance"
      icon: mdi:code-tags

    #-------------------------------------------
    # QFLAG COMMAND
    #-------------------------------------------
    # x backlight_on
    backlight:
      name: "${friendly_name} Backlight"
      id: backlight_lcd
      icon: mdi:monitor-clean
    # a silence_buzzer_open_buzzer
    buzzer:
      name: "${friendly_name} Buzzer"
      icon: mdi:volume-low
    # b overload_bypass_function
    overload_bypass:
      name: "${friendly_name} Overload - Bypass"
      icon: mdi:thermometer-alert
    # k lcd_escape_to_default
    lcd_default:
      name: "${friendly_name} LCD - Default"
      icon: mdi:monitor-edit
    # u overload_restart_function
    overload_restart:
      name: "${friendly_name} Overload - Restart"
      icon: mdi:alert-outline
    # v over_temperature_restart_function
    over_temperature:
      name: "${friendly_name} Over - Temperature"
      icon: mdi:thermometer-alert
    # y alarm_on_when_primary_source_interrupt
    alarm_primary_interrupt:
      name: "${friendly_name} Alarm - primary interrupt"
      icon: mdi:alert-outline
    # z fault_code_record
    fault_record:
      name: "${friendly_name} Fault Code Record"
      icon: mdi:thermometer-alert
    # j power_saving
    power_saving:
      name: "${friendly_name} Power Saving"
      icon: mdi:battery-heart-outline

    #-------------------------------------------
    # AC - Input Voltage Range
    # QPIRI X
    # Page 03 AC voltage range input
    # 0: Appliance 90-280VAC
    # 1: UPS 170-280VAC better
    #-------------------------------------------
    input_voltage_range:
      name: "${friendly_name} Grid - Voltage Range"
      icon: mdi:code-tags

    #-------------------------------------------
    # THIS SETTINGS USED IN SELECTED COMPONENT
    #-------------------------------------------
    #output_source_priority_utility:
    #  name: "${friendly_name} output_source_priority_utility"
    #output_source_priority_solar:
    #  name: "${friendly_name} output_source_priority_solar"
    #output_source_priority_battery:
    #  name: "${friendly_name} output_source_priority_battery"
    # pv_ok_condition_for_parallel:
    #   name: "${friendly_name} pv_ok_condition_for_parallel"

#-------------------------------------------
# OUTPUTS
#-------------------------------------------
output:
  #-------------------------------------------
  # Output - Battery Back
  # Setup: 28.0V
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    battery_recharge_voltage:
      id: battery_back_voltage
      possible_values: [0.0,24.0,24.5,25.0,25.5,26.0,26.5,27.0,27.5,28.0,28.5,29.0,29.5,30.0,30.5,31.0,31.5,32.0]

  #-------------------------------------------
  # Output - Battery Absorption charge voltage
  # Setup: 29.0V
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    battery_bulk_voltage:
      id: battery_absorption_voltage
      possible_values:
        - 24.0
        - 24.1
        - 24.2
        - 24.3
        - 24.4
        - 24.5
        - 24.6
        - 24.7
        - 24.8
        - 24.9
        - 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
        - 28.4
        - 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
        - 31.6
        - 31.7
        - 31.8
        - 31.9
        - 32.0

  #-------------------------------------------
  # Output - Battery Float Charge Voltage
  # Setup: 27.0V
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    battery_float_voltage:
      id: battery_float_voltage
      possible_values:
        - 24.0
        - 24.1
        - 24.2
        - 24.3
        - 24.4
        - 24.5
        - 24.6
        - 24.7
        - 24.8
        - 24.9
        - 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
        - 28.4
        - 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
        - 31.6
        - 31.7
        - 31.8
        - 31.9
        - 32.0

  #-------------------------------------------
  # Output - Battery Grid Voltage
  # Setup: 24.0V
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    battery_recharge_voltage:
      id: battery_recharge_voltage
      possible_values:
        - 0.0
        - 22.0
        - 22.5
        - 23.0
        - 23.5
        - 24.0
        - 24.5
        - 25.0
        - 25.5
        - 26.0
        - 26.5
        - 27.0
        - 27.5
        - 28.0
        - 28.5

  #-------------------------------------------
  # Output - Battery Under voltage
  # Setup: 21.7V
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    battery_under_voltage:
      id: battery_under_voltage
      possible_values:
        - "20.0"
        - "20.1"
        - "20.2"
        - "20.3"
        - "20.4"
        - "20.5"
        - "20.6"
        - "20.7"
        - "20.8"
        - "20.9"
        - "21.0"
        - "21.1"
        - "21.2"
        - "21.3"
        - "21.4"
        - "21.5"
        - "21.6"
        - "21.7"
        - "21.8"
        - "21.9"
        - "22.0"
        - "22.1"
        - "22.2"
        - "22.3"
        - "22.4"
        - "22.5"
        - "22.6"
        - "22.7"
        - "22.8"
        - "22.9"
        - "23.0"
        - "23.1"
        - "23.2"
        - "23.3"
        - "23.4"
        - "23.5"
        - "23.6"
        - "23.7"
        - "23.8"
        - "23.9"
        - "24.0"
        - "24.1"
        - "24.2"
        - "24.3"
        - "24.4"
        - "24.5"
        - "24.6"
        - "24.7"
        - "24.8"
        - "24.9"
        - "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"

#-------------------------------------------
# SELECTS
#-------------------------------------------
select:
  #-------------------------------------------
  # Select - Battery Back voltage
  # Setup: 28.0V
  #-------------------------------------------
  - platform: template
    name: Battery - Voltage Back
    id: set_back
    optimistic: True
    initial_option: "28.0"
    restore_value: true
    entity_category: config
    on_value:
      then:
        - output.pipsolar.set_level:
            id: battery_back_voltage
            value: !lambda |- 
              float float_back = std::stof(id(set_back).state); // change to float number value
              return float_back;
    options: 
      - "0.0"
      - "24.0"
      - "24.5"
      - "25.0"
      - "25.5"
      - "26.0"
      - "26.5"
      - "27.0"
      - "27.5"
      - "28.0"
      - "28.5"
      - "29.0"
      - "29.5"
      - "30.0"
      - "30.5"
      - "31.0"
      - "31.5"
      - "32.0"

  #-------------------------------------------
  # Select - Battery Absorption charge voltage
  # Setup: 29.0V
  #-------------------------------------------
  - platform: template
    name: Battery - Voltage Absorption
    id: set_absorption
    optimistic: True
    initial_option: "29.0"
    restore_value: true
    entity_category: config
    on_value:
      then:
        - output.pipsolar.set_level:
            id: battery_absorption_voltage
            value: !lambda |- 
              float float_absor = std::stof(id(set_absorption).state); // change to float number value
              return float_absor;
    options: 
      - "24.0"
      - "24.1"
      - "24.2"
      - "24.3"
      - "24.4"
      - "24.5"
      - "24.6"
      - "24.7"
      - "24.8"
      - "24.9"
      - "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"
      - "28.4"
      - "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"
      - "31.6"
      - "31.7"
      - "31.8"
      - "31.9"
      - "32.0"

  #-------------------------------------------
  # Select - Battery Float charge voltage
  # Setup: 27.0V
  #-------------------------------------------
  - platform: template
    name: Battery - Voltage Float
    id: set_float
    optimistic: True
    initial_option: "27.0"
    restore_value: true
    entity_category: config
    on_value:
      then:
        - output.pipsolar.set_level:
            id: battery_float_voltage
            value: !lambda |- 
              float float_float = std::stof(id(set_float).state); // change to float number value
              return float_float;
    options: 
      - "24.0"
      - "24.1"
      - "24.2"
      - "24.3"
      - "24.4"
      - "24.5"
      - "24.6"
      - "24.7"
      - "24.8"
      - "24.9"
      - "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"
      - "28.4"
      - "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"
      - "31.6"
      - "31.7"
      - "31.8"
      - "31.9"
      - "32.0"

  #-------------------------------------------
  # Select - Battery Under voltage
  # Setup: 21.7V
  #-------------------------------------------
  - platform: template
    name: Battery - Voltage Under
    id: set_under
    optimistic: True
    initial_option: "21.7"
    restore_value: true
    entity_category: config
    on_value:
      then:
        - output.pipsolar.set_level:
            id: battery_under_voltage
            value: !lambda |- 
              float float_under = std::stof(id(set_under).state); // change to float number value
              return float_under;
    options: 
      - "20.0"
      - "20.1"
      - "20.2"
      - "20.3"
      - "20.4"
      - "20.5"
      - "20.6"
      - "20.7"
      - "20.8"
      - "20.9"
      - "21.0"
      - "21.1"
      - "21.2"
      - "21.3"
      - "21.4"
      - "21.5"
      - "21.6"
      - "21.7"
      - "21.8"
      - "21.9"
      - "22.0"
      - "22.1"
      - "22.2"
      - "22.3"
      - "22.4"
      - "22.5"
      - "22.6"
      - "22.7"
      - "22.8"
      - "22.9"
      - "23.0"
      - "23.1"
      - "23.2"
      - "23.3"
      - "23.4"
      - "23.5"
      - "23.6"
      - "23.7"
      - "23.8"
      - "23.9"
      - "24.0"
      - "24.1"
      - "24.2"
      - "24.3"
      - "24.4"
      - "24.5"
      - "24.6"
      - "24.7"
      - "24.8"
      - "24.9"
      - "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"

  #-------------------------------------------
  # Select - Battery Grid voltage
  # Setup: 28.0V
  #-------------------------------------------
  - platform: template
    name: Battery - Voltage Grid
    id: set_grid
    optimistic: True
    initial_option: "24.0"
    restore_value: true
    entity_category: config
    on_value:
      then:
        - output.pipsolar.set_level:
            id: battery_recharge_voltage
            value: !lambda |- 
              float float_grid = std::stof(id(set_grid).state); // change to float number value
              return float_grid;
    options: 
      - "0.0"
      - "22.0"
      - "22.5"
      - "23.0"
      - "23.5"
      - "24.0"
      - "24.5"
      - "25.0"
      - "25.5"
      - "26.0"
      - "26.5"
      - "27.0"
      - "27.5"
      - "28.0"
      - "28.5"

  #-------------------------------------------
  # Battery charge/discharge controlling command 
  # not send data
  # See MAX_Communication_Protocol_20210217.pdf page 21
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax

    charging_discharging_control:
      entity_category: config
      name: "${friendly_name} charging discharging control"
      optionsmap:
        "On C/D": "PBATCD111"
        "On C only solar 2A AC/Off D/Invertor off": "PBATCD011"
        "101": "PBATCD101"
        "110": "PBATCD110"
        "010": "PBATCD010"
        "100": "PBATCD100"
        "001": "PBATCD001"
        "000": "PBATCD000"
      statusmap:
        "111": "On C/D"
        "011": "On C only solar 2A AC/Off D/Invertor off"
        "101": "On C only solar 2A AC/Off D/Invertor standby"
        "110": "Off C/On D"
        "010": "Off C/D/Invertor off (PV/Grid no present)"
        "100": "Off C/D/Invertor standby"
        "001": "N/A"
        "000": "Clean and return previous status."

  #-------------------------------------------
  # Select - Output Source Priority
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    output_source_priority:
      id: effekta_ax_output_source_priority_select
      name: "${friendly_name} Source Priority - Output"
      entity_category: config
      optionsmap:
        "Utility first": "POP00"
        "Solar only": "POP01"
        "Solar Battery Utility": "POP02"
      statusmap:
        "0": "Utility first"
        "1": "Solar first"
        "2": "Solar Battery Utility"

  #-------------------------------------------
  # Select - Charger Source priority
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    charger_source_priority:
      name: "${friendly_name} Source Priority - Charge"
      entity_category: config
      optionsmap:
        "Utility first": "PCP00"
        "Solar first": "PCP01"
        "Solar and utility": "PCP02"
        "Solar charging only": "PCP03"
      statusmap:
        "0": "Utility first"
        "1": "Solar first"
        "2": "Solar and utility simultaneously"
        "3": "Solar only"

  #-------------------------------------------
  # Charger Grid Current
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    current_max_ac_charging_current:
      name: "${friendly_name} Charge - Current Grid"
      entity_category: config
      optionsmap:
        #"2A": "MUCHGC0002"
        #"10A": "MUCHGC0010"
        "20A": "MUCHGC020"
        "30A": "MUCHGC030"
        #"40A": "MUCHGC0040"
        #"50A": "MUCHGC0050"
        #"60A": "MUCHGC0060"
        #"70A": "MUCHGC0070"
        #"80A": "MUCHGC0080"
        #"90A": "MUCHGC0090"
        #"100A": "MUCHGC0100"
        #"110A": "MUCHGC0110"
        #"120A": "MUCHGC0120"
      statusmap:
        #"2": "2A"
        #"10": "10A"
        "20": "20A"
        "30": "30A"
        #"40": "40A"
        #"50": "50A"
        #"60": "60A"
        #"70": "70A"
        #"80": "80A"
        #"90": "90A"
        #"100": "100A"
        #"110": "110A"
        #"120": "120A"

  #-------------------------------------------
  # Charger Solar Current
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    current_max_charging_current:
      name: ${friendly_name} Charge - Current Solar
      entity_category: config
      optionsmap:
        "10A": "MCHGC0010"
        "20A": "MCHGC0020"
        "30A": "MCHGC0030"
        "40A": "MCHGC0040"
        "50A": "MCHGC0050"
        "60A": "MCHGC0060"
        "70A": "MCHGC0070"
        "80A": "MCHGC0080"
        "90A": "MCHGC0090"
        #"100A": "MCHGC100"
        #"110A": "MCHGC110"
        #"120A": "MCHGC120"
      statusmap:
        "10": "10A"
        "20": "20A"
        "30": "30A"
        "40": "40A"
        "50": "50A"
        "60": "60A"
        "70": "70A"
        "80": "80A"
        "90": "90A"
        #"100": "100A"
        #"110": "110A"
        #"120": "120A"

  #- platform: pipsolar
  #  pipsolar_id: effekta_ax
  #  battery_bulk_voltage:
  #    name: bulk voltage battery
  #    optionsmap:
  #      "28.8": "28.8"
  #      "28.9": "28.9"
  #      "29.0": "29.0"
  #    statusmap:
  #      "28.8": "28.8V"
  #      "28.9": "28.9V"
  #      "29.0": "29.0V"

#-------------------------------------------
# TIME COMPONENT
#-------------------------------------------
time:
  - platform: sntp

Code: pipsolar.zip

tiimsvk commented 5 months ago

Final: https://github.com/tiimsvk/Effekta-AX-Series-Axpert-MKS-esphome

genus-giuseppe commented 4 months ago

HI, I have a 10.2 kW inverter with 2 pv inputs. can you help me with the configuration?

Not all commands work with pipsolar

tiimsvk commented 4 months ago

HI, I have a 10.2 kW inverter with 2 pv inputs. can you help me with the configuration?

Not all commands work with pipsolar

it is necessary to have the uart communication function turned on. and in the log you will see what you receive, based on that you can already divide the string into the necessary values.

as for sending commands. if you change the settings directly on the inverter, you will see commands in the log. You just need to implement them in esphome