Ostrovní fotovoltaická elektrárna I. pro vjezdovou bránu se zálohou - Integrace regulátoru do HASS a dálkový odečet

Seznam článků

Je sice pěkné, že systém pracuje. Ale kolik vyrobil? Kdy běžel z baterie?

V roce 2023 jsem vůbec nic neměřil. Prostě jsem to namotnoval a jednou za čas se šel podívat jak to funguje (kolik to vyrobilo atd.) S montáží druhé elektrárny jsem připojil i tuto první elektrárnu.

Používám na svém Raspberry Pi systém Homeassistant (https://www.home-assistant.io/) do kterého jsem si přes Wi-Fi připojil solární regulátor. Ve své druhé fotovoltaické elektrárně mám regulátor připojený přes převodník USB/RS485 (ale to bych musel dříve myslet na takovou věc jako "natáhnout z domu do přístřešku UTP kabel" :-( ). Naštěstí dělá chiňan Wi-Fi modul :-)

1) nejprve je nutné pořídit nějaký převodník USB/RS485, nebo Wi-Fi (použit v této elektrárně)

EPEVER WiFi 2.4G RJ45 D

Modul, Wi-Fi, pro monitoring fotovoltaického systému, RS-485 (RJ-45), IP30

(https://www.i4wifi.cz/cs/297012-epever-wi-fi-adapter-2-4g-rj45-d-wifi-modul) 623,-

a propojovací kabel

EPEVER CC-RJ45-3.81-150U

Kabel, komunikační, 1x RJ-45, 1x 4pin, pro regulátory DuoRacer a Wi-Fi/BT monitory, délka 1,5m

(https://www.i4wifi.cz/cs/258583-epever-cc-rj45-3-81-150u-kabel-pro-regulatory-duoracer-a-wi-fi-bt-monitory) 138,-

a UTP-UTP spojku

XtendLan RJ45 Cat5e stíněná spojka

Spojka, RJ45, rozvodu CAT5E, přímá, stíněná

(https://www.i4wifi.cz/cs/179558-xtendlan-spojka-rj45-rozvodu-cat5e-prima-stinena) 65,-

Nic se nemusí pájet a vše se rovnou připojí do regulátoru.

 

Modul "EPEVER WiFi 2.4G RJ45 D" připojíme do své domácí Wi-Fi sítě. To byl docela porod (nikde se v manuálu nic nedočtete na jakou IP adresu se připojit). Nechci používat Čínský kloud a jeho aplikaci. Chci data vyčítat přes TCP do HASS.

Po zapnutí si modul vytvoří svůj AP připojovací bod. Připojíme se k síti SSID něco jako: HN_EP06.... a heslo: 12345678

V prohlížeči zadáme adresu: http://10.10.100.254 a přihlásíme se jméno: admin a heslo: admin. Doporučuji jméno a heslo po přihlášení ihned změnit.

 

Připojíme modul k naší domácí Wi-Fi síti.

V sekci STA je vidět přidělená IP adresa (doporučuji ve svém routeru adresu uzamknout a přidělovat stále stejnou, jinak se může po restartu stát, že modul dostane jinou IP adresu a nepůjde potom z HASS načítat data).

Nepodařilo se modul přepnout do režimu jen STA. Stále je v režimu AP+STA (když necháte výchozí admin/admin, tak se lojza co jde okolo může do modulu přihlásit).

Spustíme na modulu místo china kloudu lokální TCP server. Já zvolil port 9999, komu vyhovuje 666 klidně.

To je celé co se týče nastavení tohoto modulu. Změnu firmware jsem chtěl také udělat (případná dostupná aktualizace), ale nenašel jsem, kde stáhnout poslední verzi. Lepší se v tom nehrabat, když to funguje.

2) Do HASS je nutné přidat do souboru "/homeassistant/configuration.yaml" do sekce modbus zařízení přes TCP.

modbus:

   - type: rtuovertcp
    name: EPEVER2
    host: 192.168.88.124
    port: 9999
    timeout: 5

    sensors:
    # Epever regulátor 2 přes TCP
      - name: PV2 Napětí z FV pole #0x003100
        unique_id: pv2_array_input_voltage
        unit_of_measurement: V
        slave: 1
        address: 12544
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV2 Proud z FV pole # 0x003101
        unique_id: pv2_array_input_current
        unit_of_measurement: A
        slave: 1
        address: 12545
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV2 Výkon z FV pole # 3102 and 3103
        unique_id: pv2_array_input_power
        unit_of_measurement: W
        slave: 1
        address: 12546
        input_type: input
        scale: 0.01
        precision: 2
        swap: word
        data_type: uint32
      - name: PV2 Teplota regulátoru #0x003111
        unique_id: pv2_device_temperature
        unit_of_measurement: °C
        slave: 1
        address: 12561
        input_type: input
        scale: 0.01
        precision: 2
        data_type: int16
      - name: PV2 Baterie stav nabití #0x00311A
        unique_id: pv2_battery_state_of_charge
        unit_of_measurement: "%"
        slave: 1
        address: 12570
        input_type: input
        scale: 1
        precision: 0
        data_type: uint16
      - name: PV2 Baterie napětí #0x00331A
        unique_id: pv2_battery_voltage
        unit_of_measurement: V
        slave: 1
        address: 13082
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV2 Baterie proud #0x00331B & 1C
        unique_id: pv2_battery_current
        unit_of_measurement: A
        slave: 1
        address: 13083
        input_type: input
        scale: 0.01
        precision: 2
        swap: word
        data_type: int32
      - name: PV2 Baterie dnešní max napětí #0x003302
        unique_id: pv2_maximum_battery_voltage_today
        unit_of_measurement: V
        slave: 1
        address: 13058
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV2 Baterie dnešní min napětí #0x003303
        unique_id: pv2_minimum_battery_voltage_today
        unit_of_measurement: V
        slave: 1
        address: 13059
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV2 Vyrobená energie dnes #0x00330C & 0D
        unique_id: pv2_generated_energy_today
        unit_of_measurement: kWh
        slave: 1
        address: 13068
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total
        swap: word
        data_type: int32
      - name: PV2 Vyrobená energie tento měsíc #0x00330E & 0F
        unique_id: pv2_generated_energy_month
        unit_of_measurement: kWh
        slave: 1
        address: 13070
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total
        swap: word
        data_type: int32
      - name: PV2 Vyrobená energie tento rok #0x003310 & 11
        unique_id: pv2_generated_energy_year
        unit_of_measurement: kWh
        slave: 1
        address: 13072
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total
        swap: word
        data_type: int32
      - name: PV2 Vyrobená energie celkem #0x003312 & 13
        unique_id: pv2_generated_energy_total
        unit_of_measurement: kWh
        slave: 1
        address: 13074
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total_increasing
        swap: word
        data_type: int32

Zde je můj kompletní soubor "/homeassistant/configuration.yaml"  pro oba regulátory (jeden přes TCP a druhý přes USB)

modbus:
  - type: serial
    name: EPEVER1
    method: rtu
    port: /dev/ttyUSB0
    baudrate: 115200
    stopbits: 1
    bytesize: 8
    parity: N

    sensors:
    # Epever regulátor 1 přes USB
      - name: PV1 Napětí z FV pole #0x003100
        unique_id: pv1_array_input_voltage
        unit_of_measurement: V
        slave: 1
        address: 12544
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV1 Proud z FV pole # 0x003101
        unique_id: pv1_array_input_current
        unit_of_measurement: A
        slave: 1
        address: 12545
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV1 Výkon z FV pole # 3102 and 3103
        unique_id: pv1_array_input_power
        unit_of_measurement: W
        slave: 1
        address: 12546
        input_type: input
        scale: 0.01
        precision: 2
        swap: word
        data_type: uint32
      - name: PV1 Teplota regulátoru #0x003111
        unique_id: pv1_device_temperature
        unit_of_measurement: °C
        slave: 1
        address: 12561
        input_type: input
        scale: 0.01
        precision: 2
        data_type: int16
      - name: PV1 Baterie stav nabití #0x00311A
        unique_id: pv1_battery_state_of_charge
        unit_of_measurement: "%"
        slave: 1
        address: 12570
        input_type: input
        scale: 1
        precision: 0
        data_type: uint16
      - name: PV1 Baterie napětí #0x00331A
        unique_id: pv1_battery_voltage
        unit_of_measurement: V
        slave: 1
        address: 13082
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV1 Baterie proud #0x00331B & 1C
        unique_id: pv1_battery_current
        unit_of_measurement: A
        slave: 1
        address: 13083
        input_type: input
        scale: 0.01
        precision: 2
        swap: word
        data_type: int32
      - name: PV1 Baterie dnešní max napětí #0x003302
        unique_id: pv1_maximum_battery_voltage_today
        unit_of_measurement: V
        slave: 1
        address: 13058
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV1 Baterie dnešní min napětí #0x003303
        unique_id: pv1_minimum_battery_voltage_today
        unit_of_measurement: V
        slave: 1
        address: 13059
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV1 Vyrobená energie dnes #0x00330C & 0D
        unique_id: pv1_generated_energy_today
        unit_of_measurement: kWh
        slave: 1
        address: 13068
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total
        swap: word
        data_type: int32
      - name: PV1 Vyrobená energie tento měsíc #0x00330E & 0F
        unique_id: pv1_generated_energy_month
        unit_of_measurement: kWh
        slave: 1
        address: 13070
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total
        swap: word
        data_type: int32
      - name: PV1 Vyrobená energie tento rok #0x003310 & 11
        unique_id: pv1_generated_energy_year
        unit_of_measurement: kWh
        slave: 1
        address: 13072
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total
        swap: word
        data_type: int32
      - name: PV1 Vyrobená energie celkem #0x003312 & 13
        unique_id: pv1_generated_energy_total
        unit_of_measurement: kWh
        slave: 1
        address: 13074
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total_increasing
        swap: word
        data_type: int32

  - type: rtuovertcp
    name: EPEVER2
    host: 192.168.88.124
    port: 9999
    timeout: 5

    sensors:
    # Epever regulátor 2 přes TCP
      - name: PV2 Napětí z FV pole #0x003100
        unique_id: pv2_array_input_voltage
        unit_of_measurement: V
        slave: 1
        address: 12544
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV2 Proud z FV pole # 0x003101
        unique_id: pv2_array_input_current
        unit_of_measurement: A
        slave: 1
        address: 12545
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV2 Výkon z FV pole # 3102 and 3103
        unique_id: pv2_array_input_power
        unit_of_measurement: W
        slave: 1
        address: 12546
        input_type: input
        scale: 0.01
        precision: 2
        swap: word
        data_type: uint32
      - name: PV2 Teplota regulátoru #0x003111
        unique_id: pv2_device_temperature
        unit_of_measurement: °C
        slave: 1
        address: 12561
        input_type: input
        scale: 0.01
        precision: 2
        data_type: int16
      - name: PV2 Baterie stav nabití #0x00311A
        unique_id: pv2_battery_state_of_charge
        unit_of_measurement: "%"
        slave: 1
        address: 12570
        input_type: input
        scale: 1
        precision: 0
        data_type: uint16
      - name: PV2 Baterie napětí #0x00331A
        unique_id: pv2_battery_voltage
        unit_of_measurement: V
        slave: 1
        address: 13082
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV2 Baterie proud #0x00331B & 1C
        unique_id: pv2_battery_current
        unit_of_measurement: A
        slave: 1
        address: 13083
        input_type: input
        scale: 0.01
        precision: 2
        swap: word
        data_type: int32
      - name: PV2 Baterie dnešní max napětí #0x003302
        unique_id: pv2_maximum_battery_voltage_today
        unit_of_measurement: V
        slave: 1
        address: 13058
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV2 Baterie dnešní min napětí #0x003303
        unique_id: pv2_minimum_battery_voltage_today
        unit_of_measurement: V
        slave: 1
        address: 13059
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV2 Vyrobená energie dnes #0x00330C & 0D
        unique_id: pv2_generated_energy_today
        unit_of_measurement: kWh
        slave: 1
        address: 13068
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total
        swap: word
        data_type: int32
      - name: PV2 Vyrobená energie tento měsíc #0x00330E & 0F
        unique_id: pv2_generated_energy_month
        unit_of_measurement: kWh
        slave: 1
        address: 13070
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total
        swap: word
        data_type: int32
      - name: PV2 Vyrobená energie tento rok #0x003310 & 11
        unique_id: pv2_generated_energy_year
        unit_of_measurement: kWh
        slave: 1
        address: 13072
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total
        swap: word
        data_type: int32
      - name: PV2 Vyrobená energie celkem #0x003312 & 13
        unique_id: pv2_generated_energy_total
        unit_of_measurement: kWh
        slave: 1
        address: 13074
        input_type: input
        scale: 0.01
        precision: 2
        device_class: energy
        state_class: total_increasing
        swap: word
        data_type: int32

Po restartu HASS již budou dostupná data z regulátoru (názvy lze v HASS samozřejmě upravit).

 

Několik grafů jak systém pracuje.

7.8.2025 výkon z fotovoltaického panelu během dne (baterie se nabije relativně brzo na 100% a z panelu teče jen minimum na provoz IP kamer, stand-by režimu pojezdu brány, na měnič...).

 

Kdyby chtěl někdo vyčítat data například v Pythonu (tak přikládám kód pro načtení)

# sudo apt install python3-pymodbus

from pymodbus.client import ModbusTcpClient
from pymodbus.transaction import ModbusRtuFramer as ModbusFramer
import logging
import time

logging.basicConfig()
log = logging.getLogger()
# log.setLevel(logging.DEBUG)

host = "192.168.88.124"
port = 9999

client = ModbusTcpClient(host, port=port, framer=ModbusFramer)
success = client.connect()

def _read():
  if success:
     result = client.read_input_registers(0x3100, 8, slave=1)
     print(result)
     if (not result.isError()):
        pvVoltage = float(result.registers[0] / 100.0)
        pvCurrent = float(result.registers[1] / 100.0)
        pvPower = float(result.registers[2] / 100.0)

        print("0x3100: pvVoltage:", pvVoltage, "v")
        print("0x3101: pvCurrent:", pvCurrent, "a")
        print("0x3102: pvPower:",   pvPower, "w")

def _init():
  if success:
    client.send(bytes.fromhex("20020000"))

_init()
time.sleep(1)
_read()

Výpis v konzoly přes putty SSH

Attachments:
Download this file (-o-manual-duoracer-v1-2-cz.pdf)Manuál epever[duoracer]2493 kB37 Downloads2025-08-07 19:18
Download this file (EN PS_24,5.pdf)Zdroj 24V[ ]174 kB42 Downloads2025-08-07 19:20
Download this file (EXS-410MHC-B_DS_30mm.pdf)Datasheet panel[EXS-410]1078 kB40 Downloads2025-08-07 19:19
Download this file (Navod_Goowei_Energy_CNLFP_v2.pdf)Návod k baterii[CNLFP]5486 kB26 Downloads2025-08-07 19:17