syssi / esphome-jk-bms

ESPHome component to monitor and control a Jikong Battery Management System (JK-BMS) via UART-TTL or BLE
Apache License 2.0
403 stars 134 forks source link

Feed-in restrictions #476

Open josef232 opened 3 months ago

josef232 commented 3 months ago

Hello, I have your software running on an ESP32 and use it to read a JK BMS. I pass the required data to my Goodwe 10k inverter and have adapted your software slightly (through trial and error :-))

Since our power grid operator only allows a feed-in of 4000W, on sunny Days i only want to charge the battery when the 4000W grid feed-in has been reached.

I used the following program part from you to read out the watts supplied/delivered into the grid via the Goodwe inverter, this works really well. But I'm having trouble processing the data, so I wanted to ask you if you could help me here.

My approach would be to define a variable that can be between 0 and 25 (this would be my charging current that I pass on to the inverter)

If more than 4000W is now supplied to the network, this variable should increase in steps of 1 every 10 seconds. If less than 3900W is supplied to the network, this variable should decrease in steps of 1 every 10 seconds.

For the newer Goodwe 20k-et and 30k-et devices, the manufacturer offers the intelligent charging function.

But with this "small" program, my inverter should also work well enough to feed as much as possible into the grid on sunny days,

substitutions:

--------------------------

name that will appear in esphome and homeassistant.

name: bmssolar

--------------------------------------

Battery State of Health (SOH) setting:

Maximum charging cycles is used to calculate the battey SOH, LF280K=6000.0 LF280=3000.0 (decimal is required)

max_cycles: "6000.0"

--------------------------------------

ESP32 CAN/Serail port pins:

GPIO pins your CAN bus transceiver(TJA1050) is connected to the ESP, note! TX->TX and RX->RX.

can_tx_pin: GPIO23

can_rx_pin: GPIO22

GPIO pins your JK-BMS RS485(TTL) is connected to the ESP TX->RX and RX->TX.

tx_pin: GPIO1 rx_pin: GPIO3

--------------------------------------

Thank you very much Josef

esphome: name: bmssolar friendly_name: bmssolar

esp32: board: esp32dev framework: type: arduino

logger: baud_rate: 0

globals:

button:

wifi: ssid: xxxx password: xxxx

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

ap: ssid: "BmsSolar Fallback Hotspot" password: "xxxx

Enable Home Assistant API

api: encryption: key: "xxxx ota: password: xxxx

#

uart: id: uart_0 baud_rate: 9600 rx_buffer_size: 384 tx_pin: ${tx_pin} rx_pin: ${rx_pin}

modbus: id: modbus0 uart_id: uart_0 send_wait_time: 300ms

modbus_controller: id: bms0 address: 247 modbus_id: modbus0 command_throttle: 300ms update_interval: 1s

sensor:

1000 Leistung R UINT16 2 Watt