Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMH-III 24V 4.2kW #164

Open
fedottt opened this issue Dec 12, 2024 · 8 comments
Open

SMH-III 24V 4.2kW #164

fedottt opened this issue Dec 12, 2024 · 8 comments

Comments

@fedottt
Copy link

fedottt commented Dec 12, 2024

this is not issue, this is part of my expirience and eating cactus with this f*cking inverter

for changing current_max_charging_current default didnt work
i founded this:

in yaml

  - platform: pipsolar
    pipsolar_id: inv1
    current_max_charging_current:
      name: "Charge - Current Total"
      optionsmap:
        "10A": "MNCHGC010"  #   <-- take a look for this, it different from default
        "20A": "MNCHGC020"
        "30A": "MNCHGC030"
        "40A": "MNCHGC040"
        "50A": "MNCHGC050"
      statusmap:
        "10": "10A"
        "20": "20A"
        "30": "30A"
        "40": "40A"
        "50": "50A"

AND!

did some changes to
pipsolar/components/pipsolar/output/__init__.py

CONF_CURRENT_MAX_CHARGING_CURRENT: ([ 10, 20, 30, 40, 50 ], "MNCHGC0%03.0f"),

image

with this change i can set total current for this invrter

@carmelo42
Copy link

I'm looking a way to change the values for :

  • current_max_charging_current
  • max_ac_charging_current

I have a SMH-II 3.2kw inverter ... so I think your solution could help me.
Would you mind providing your esphome yaml config file please ? I'm struggling for several days to get it working!

@fedottt
Copy link
Author

fedottt commented Dec 13, 2024

I have a SMH-II 3.2kw inverter ... so I think your solution could help me. Would you mind providing your esphome yaml config file please ? I'm struggling for several days to get it working!

use https://github.com/syssi/esphome-pipsolar/tree/pip8048
i have this inverter at mom's house and this yaml works good without modify

@carmelo42
Copy link

Thanks !

@nheinemans
Copy link

Looking at the changes you made in init.py, it looks like you're changing a different file than the one in esphome:
https://github.com/esphome/esphome/blob/2024.12.2/esphome/components/pipsolar/output/__init__.py

I tried changing lines 52 and 53 in this file, using your example, but I can't get these values from my inverter (I also have a SMH-III 24V 4.2kW). Can you perhaps point me to a working yaml?

@fedottt
Copy link
Author

fedottt commented Dec 23, 2024

https://github.com/fedottt/pipsolar/blob/main/components/pipsolar/output/__init__.py

esphome is 48v only
so you need custom. from syssi, for example, or you can clone my repo

full yaml of my inverter

#-------------------------------------------
# SUBTITUTIONS - basic definitions and description of the device
#-------------------------------------------
substitutions:
  friendly_name: Inverter
  device_name: easun_home
  # Module: smd on board
  status_led_pin: D4
  # UART
  uart_tx: D5
  uart_rx: D6
  battery_capacite: "110"

uart:
  - id: uart_bus
    tx_pin: $uart_tx
    rx_pin: $uart_rx
    baud_rate: 2400

#-------------------------------------------
# ESP - MAIN SETTINGS
#-------------------------------------------
esphome:
  name: $device_name
  friendly_name: $friendly_name

esp8266:
  board: d1_mini

# Enable Home Assistant API
api:
  encryption:
    key: "KEY"

ota:
  - platform: esphome

#-------------------------------------------
# LOGGER
#-------------------------------------------
logger:
  # disable log over uart
  baud_rate: 0

#-------------------------------------------
# ETHERNET
#-------------------------------------------
wifi:


#-------------------------------------------
# EXTERNAL AND CUSTOM COMPONENT
#-------------------------------------------
external_components:
  - source: github://fedottt/pipsolar
    refresh: 0s

#-------------------------------------------
# STATUS LED
#-------------------------------------------
status_led:
  pin: 
    number: $status_led_pin
    
#-------------------------------------------
# PIP SOLAR COMPONENT
#-------------------------------------------
pipsolar:
  - uart_id: uart_bus
    id: effekta_ax

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

#-------------------------------------------
# Total energy - Charge BATTERY
#-------------------------------------------
  - platform: template
    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: "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: "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: "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
#-------------------------------------------

  #-------------------------------------------
  # PIPSOLAR SENSORS
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
      
    #-------------------------------------------
    # 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: "LIL"
          - 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: "Grid - Voltage"

      
    #-------------------------------------------
    # LOAD
    #-------------------------------------------
    ac_output_voltage:
      name: "Load - Voltage"
    ac_output_frequency:
      name: "Load - Frequency"
    ac_output_active_power:
      name: "Load - Power"
      icon: "mdi:flash"
      id: load_power
    output_load_percent:
      name: "Load - Percent"
      
    #-------------------------------------------
    # BUS
    #-------------------------------------------
    bus_voltage:
      name: "BUS - Voltage"
      
    #-------------------------------------------
    # BATTERY
    #-------------------------------------------
    battery_voltage:
      name: "Battery - Voltage"
      id: battery_voltage
    battery_charging_current:
      name: "Battery - Current Charging"
      id: battery_charging_current
    battery_discharge_current:
      name: "Battery - Current Discharge"
      id: battery_discharging_current
       
    #-------------------------------------------
    # TEMPERATURE
    #-------------------------------------------
    inverter_heat_sink_temperature:
      name: "Temperature"
      entity_category: diagnostic

#-------------------------------------------
# TEXT SENSORS
#-------------------------------------------
text_sensor:

  #-------------------------------------------
  # PIP SOLAR - TEXT
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    device_mode:
      name: "Device mode"
      id: device_mode
      filters:
        map:
          - P -> Power on
          - S -> Standby
          - L -> Line
          - B -> Battery
          - F -> Fault
          - D -> Shutdown
   # last_qpigs:
   #   name: "qpigs"
   # last_qpiri:
   #   name: "qpiri"

  #-------------------------------------------
  # 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: "Battery - Type"
    lambda: |-
      return {"Loading"};
    icon: mdi:battery-high
    update_interval: 10min
    entity_category: diagnostic

#-------------------------------------------
# BINARY SENSORS
#-------------------------------------------
binary_sensor:
  #-------------------------------------------
  # PIP SOLAR - BINARY_SENSORS
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    #-------------------------------------------
    # Unnecessary sensors
    #-------------------------------------------
  
    load_status:
      name: "Status - Load"
      entity_category: diagnostic
    charging_status:
      name: "Status - Charging"
      entity_category: diagnostic
    # b1
    scc_charging_status:
      name: "Status - DC Charging"
      entity_category: diagnostic
    # b0
    ac_charging_status:
      name: "Status - AC Charging"
      entity_category: diagnostic
    # b10
    charging_to_floating_mode:
      name: "Status - Float Charging"
      entity_category: diagnostic
    # b9  
    switch_on:
      name: "Switch On"
      entity_category: diagnostic
    warnings_present:
      name: "Warnings present"
      entity_category: diagnostic
    faults_present:
      name: "Faults present"
      entity_category: diagnostic
    
    fault_code:
      name: "Fault Code"

    warning_battery_equalization:
      name: "Warning battery equa"
      entity_category: diagnostic


#-------------------------------------------
# SELECTS
#-------------------------------------------
select:
  #-------------------------------------------
  # Output Source Priority
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    output_source_priority:
      id: output_source_priority_select
      name: "Output source priority"
      optionsmap:
        "USB": "POP00"
        "SUB": "POP01"
        "SBU": "POP02"
      statusmap:
        "0": "USB"
        "1": "SUB"
        "2": "SBU"

  #-------------------------------------------
  # Charger Grid Current
  #-------------------------------------------
  - platform: pipsolar
    pipsolar_id: effekta_ax
    current_max_ac_charging_current:
      name: "Charge - Current Grid"
      entity_category: config
      optionsmap:
        "10A": "MUCHGC010"
        "20A": "MUCHGC020"
        "30A": "MUCHGC030"
        "40A": "MUCHGC040"
        "50A": "MUCHGC050"
        
      statusmap:
        "10": "10A"
        "20": "20A"
        "30": "30A"
        "40": "40A"
        "50": "50A"

  - platform: pipsolar
    pipsolar_id: effekta_ax
    current_max_charging_current:
      name: "Charge - Current Total"
      optionsmap:
        "10A": "MNCHGC010"
        "20A": "MNCHGC020"
        "30A": "MNCHGC030"
        "40A": "MNCHGC040"
        "50A": "MNCHGC050"
      statusmap:
        "10": "10A"
        "20": "20A"
        "30": "30A"
        "40": "40A"
        "50": "50A"

#-------------------------------------------
# TIME COMPONENT
#-------------------------------------------
time:
  - platform: homeassistant```

@nheinemans
Copy link

nheinemans commented Dec 27, 2024

Thanks a lot for sharing your config. I didn't realise I should use a different pipsolar component. However, when I'm trying to use your repo, I'm getting this error message:

INFO Reading configuration /config/esphome/esphome-web-e5a136.yaml...
INFO Updating https://github.com/fedottt/pipsolar.git@None
INFO Detected timezone 'Europe/Amsterdam'
INFO Generating C++ source...
INFO Compiling app...
Processing garage (board: d1_mini; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.6
Compiling .pioenvs/garage/src/esphome/components/pipsolar/pipsolar.cpp.o
Compiling .pioenvs/garage/src/esphome/components/select/select_traits.cpp.o
Compiling .pioenvs/garage/src/esphome/components/sensor/automation.cpp.o
Compiling .pioenvs/garage/src/esphome/components/sensor/filter.cpp.o
In file included from src/esphome/components/pipsolar/pipsolar.cpp:1:
src/esphome/components/pipsolar/pipsolar.h:7:10: fatal error: esphome/components/pipsolar/select/pipsolar_select.h: No such file or directory
    7 | #include "esphome/components/pipsolar/select/pipsolar_select.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/garage/src/esphome/components/pipsolar/pipsolar.cpp.o] Error 1
========================== [FAILED] Took 9.51 seconds ==========================

I'm using this from esphome in Home Assistant, both running the latest versions. Any idea what I'm doing wrong?

@syssi
Copy link
Owner

syssi commented Dec 27, 2024

Please try a CLEAN build and make sure there is a select: section at your YAML configuration.

@fedottt
Copy link
Author

fedottt commented Dec 30, 2024

I didn't realise I should use a different pipsolar component.

heh, well thats it))
if we looking in code, we see only 40+ voltage
image

Any idea what I'm doing wrong?

we need your conf) to make review))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants