SolarPower: Difference between revisions

From JoBaPedia
Jump to navigation Jump to search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Solar Power =
= Balkonkraftwerk =  
 
== Balkonkraftwerk ==  
My "Balkonkraftwerk" uses OpenDTU to query the rf data of the microinverter TSOL-M800 from TSUN (Hoymiles HM600 compatible).
My "Balkonkraftwerk" uses OpenDTU to query the rf data of the microinverter TSOL-M800 from TSUN (Hoymiles HM600 compatible).


=== Monitoring Setup ===
== Monitoring Setup ==
* http://OpenDTU1
* http://OpenDTU1 (admin j...1)
* mqtt@job4 (mosquitto_sub -v -t 'OpenDTU1/#')
* mqtt@job4 (mosquitto_sub -v -t 'OpenDTU1/#')
* job4:/etc/systemd/system/openDtu2Db@OpenDTU1.service (sudo systemctl status openDtu2Db@OpenDTU1.service, sudo journalctl -f -u openDtu2Db@OpenDTU1.service)
* job4:/etc/systemd/system/openDtu2Db@OpenDTU1.service (sudo systemctl status openDtu2Db@OpenDTU1.service, sudo journalctl -f -u openDtu2Db@OpenDTU1.service)
Line 12: Line 10:
* Grafana Source openDtu@InfluxDB
* Grafana Source openDtu@InfluxDB
* Grafana Dashboard https://banzhaf.chickenkiller.com/grafana/d/_rNE2oO7k/stromverbrauch?orgId=1&refresh=10s&viewPanel=7
* Grafana Dashboard https://banzhaf.chickenkiller.com/grafana/d/_rNE2oO7k/stromverbrauch?orgId=1&refresh=10s&viewPanel=7
* Dynamic Inverter Limit for my ElectricityMeter firmware
** To enable dynamic inverter limit the firmware needs mqtt topic OpenDTU1/$serialno/status/limit_dynamic set to 1
** Make Mosquitto persistent messages persistent over restarts
*** /etc/mosquitto/conf.d/persistence.conf
persistence true
persistence_location /var/lib/mosquitto
* Added OpenDTU integration to my new home assistant


=== Troubleshooting ===
== Troubleshooting ==
* Sometimes mqtt connection gets lost (see https://github.com/tbnobody/OpenDTU/issues/965)
* Sometimes mqtt connection gets lost (see https://github.com/tbnobody/OpenDTU/issues/965)
** Symptom: no new data in influx db and Grafana dashboard
** Symptom: no new data in influx db and Grafana dashboard
** Fix: Go to http://opendtu1/settings/mqtt, hit "Save".
** Fix: Go to http://opendtu1/settings/mqtt, hit "Save".
** Updated 2023-07-31, check if fixed...
== Update ==
* Online: http://opendtu1/firmware/upgrade
* Offline
** Download e.g. https://github.com/tbnobody/OpenDTU/releases/download/v23.7.22/opendtu-generic.factory.bin
** Flash with esptool.py (e.g. from within platformio packages and python of vscode platformio terminal)
python ~/.platformio/packages/tool-esptoolpy@src-3656ef7461ddc68b458b40db7ac51220/esptool.py \
  --port /dev/ttyACM0 --chip esp32 --before default_reset --after hard_reset  write_flash \
  --flash_mode dout --flash_freq 40m --flash_size detect 0x0  ~/Downloads/opendtu-generic.factory.bin


== Garagenkraftwerk ==
= Garagenkraftwerk =
My "Garagenkraftwerk" uses Tasmota to query power data and control a fan via Nous power plugs
My "Garagenkraftwerk" uses Tasmota to query power data and control a fan via Nous power plugs


=== Monitoring Setup ===
== Monitoring Setup ==
* Fan http://nous1 (on after 2 min > 250 W, off after 6 min < 150 W by tasmogy.py)  
* Fan http://nous1 (on after 2 min > 250 W, off after 6 min < 150 W by tasmogy.py)  
* Power: http//nous2
* Power: http//nous2
Line 32: Line 47:
* Grafana Dashboard https://banzhaf.chickenkiller.com/grafana/d/_rNE2oO7k/stromverbrauch?orgId=1&refresh=10s&editPanel=12
* Grafana Dashboard https://banzhaf.chickenkiller.com/grafana/d/_rNE2oO7k/stromverbrauch?orgId=1&refresh=10s&editPanel=12
* Fan and Solar Plug can be controlled and monitored via Domoticz (using my [https://github.com/joba-1/Tasmoticz Tasmoticz Gateway])
* Fan and Solar Plug can be controlled and monitored via Domoticz (using my [https://github.com/joba-1/Tasmoticz Tasmoticz Gateway])
* Added Tasmota energy device nous2 to my new home assistant


== LiFePO-Island ==
= LiFePO-Island =


My shed in the garden has LiFePO backeded island solar power
My shed in the garden has LiFePO backed island solar power


=== Monitoring Setup ===
== Monitoring Setup ==
* Power route: Panel -> Esmart3 -> BMS -> 12V LiFePOs -> Inverter -> 220 V / 500 W continuous power (7 manually switchable output plugs, 2 USB ports)
* Power route: Panel -> Esmart3 -> BMS -> 12V LiFePOs -> Inverter -> 220 V / 500 W continuous power -> 7 manually switchable output plugs and 2 USB ports
* Control/Monitoring: The BMS and the ESmart3 report to an ESP32 via RS485 serial line.
* Control/Monitoring: The BMS and the ESmart3 report to an ESP32 via RS485 serial line.
* The ESP32 is behind a Tasmota port forwarding range extender http://nat2, reachable via http://nat2:8080
* The ESP32 is behind a Tasmota port forwarding range extender http://nat2, reachable via http://nat2:8080 (see trac topic SolarAnlage)
* The ESP32 runs my firmware https://github.com/joba-1/LiFePO_Island which posts data to influx
* The ESP32 runs my firmware https://github.com/joba-1/LiFePO_Island which posts data to influx
* Influx DB (influx --database LiFePO_Island --execute "show measurements" for all available data tables) e.g.:
* Influx DB (influx --database LiFePO_Island --execute "show measurements" for all available data tables) e.g.:
Line 50: Line 66:
** Switch script: /opt/domoticz/scripts/lua/script_device_LiFePO_Island_Load.lua
** Switch script: /opt/domoticz/scripts/lua/script_device_LiFePO_Island_Load.lua
** Status script: /opt/domoticz/scripts/lua/script_time_LiFePO_Island_Load.lua
** Status script: /opt/domoticz/scripts/lua/script_time_LiFePO_Island_Load.lua
* Home Assistant configuration (add in /share/Docker/homeassistant/config/configuration.yaml)
<nowiki>mqtt:
  switch:
    name: "LiFePO_Island Load"
    unique_id: lifepo_island_load_switch
    state_topic: "LiFePO_Island/1/json/LoadParam"
    value_template: "{{ value_json.LoadParam.LoadSts }}"
    state_off: "0"
    state_on: "1"
    command_topic: "LiFePO_Island/1/cmd"
    payload_off: "load off"
    payload_on: "load on"
    availability:
      topic: "LiFePO_Island/1/status/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
  sensor:
    - name: "LiFePO Island Cell 1"
      unique_id: lifepo_island_cell_1
      state_topic: "LiFePO_Island/1/json/Cells"
      unit_of_measurement: "V"
      value_template: "{{ value_json.Cells[0] }}"
    - name: "LiFePO Island Cell 2"
      unique_id: lifepo_island_cell_2
      state_topic: "LiFePO_Island/1/json/Cells"
      unit_of_measurement: "V"
      value_template: "{{ value_json.Cells[1] }}"
    - name: "LiFePO Island Cell 3"
      unique_id: lifepo_island_cell_3
      state_topic: "LiFePO_Island/1/json/Cells"
      unit_of_measurement: "V"
      value_template: "{{ value_json.Cells[2] }}"
    - name: "LiFePO Island Cell 4"
      unique_id: lifepo_island_cell_4
      state_topic: "LiFePO_Island/1/json/Cells"
      unit_of_measurement: "V"
      value_template: "{{ value_json.Cells[3] }}"
    - name: "LiFePO Island Capacity"
      unique_id: lifepo_island_capacity
      state_topic: "LiFePO_Island/1/json/Status"
      unit_of_measurement: "%"
      value_template: "{{ value_json.Status.currentCapacity }}"</nowiki>
* Added more custom energy sensor values from Log json for battery energy monitoring to my new home assistant

Latest revision as of 09:32, 12 December 2023

Balkonkraftwerk

My "Balkonkraftwerk" uses OpenDTU to query the rf data of the microinverter TSOL-M800 from TSUN (Hoymiles HM600 compatible).

Monitoring Setup

  • http://OpenDTU1 (admin j...1)
  • mqtt@job4 (mosquitto_sub -v -t 'OpenDTU1/#')
  • job4:/etc/systemd/system/openDtu2Db@OpenDTU1.service (sudo systemctl status openDtu2Db@OpenDTU1.service, sudo journalctl -f -u openDtu2Db@OpenDTU1.service)
    • python -u /home/joachim/bin/openDtu2Db.py OpenDTU1 (prints to stdout)
  • Influx database openDtu (influx -database openDtu -precision rfc3339 -execute "select * from string order by time desc limit 10")
  • Grafana Source openDtu@InfluxDB
  • Grafana Dashboard https://banzhaf.chickenkiller.com/grafana/d/_rNE2oO7k/stromverbrauch?orgId=1&refresh=10s&viewPanel=7
  • Dynamic Inverter Limit for my ElectricityMeter firmware
    • To enable dynamic inverter limit the firmware needs mqtt topic OpenDTU1/$serialno/status/limit_dynamic set to 1
    • Make Mosquitto persistent messages persistent over restarts
      • /etc/mosquitto/conf.d/persistence.conf
persistence true
persistence_location /var/lib/mosquitto
  • Added OpenDTU integration to my new home assistant

Troubleshooting

Update

python ~/.platformio/packages/tool-esptoolpy@src-3656ef7461ddc68b458b40db7ac51220/esptool.py \
  --port /dev/ttyACM0 --chip esp32 --before default_reset --after hard_reset  write_flash \
  --flash_mode dout --flash_freq 40m --flash_size detect 0x0  ~/Downloads/opendtu-generic.factory.bin

Garagenkraftwerk

My "Garagenkraftwerk" uses Tasmota to query power data and control a fan via Nous power plugs

Monitoring Setup

  • Fan http://nous1 (on after 2 min > 250 W, off after 6 min < 150 W by tasmogy.py)
  • Power: http//nous2
  • mqtt@job4 (mosquitto_sub -v -t '+/nous1/#' -t '+/nous2/#')
  • job4:/etc/systemd/system/tasmogy.service (sudo systemctl status tasmogy.service, sudo journalctl -f -u tasmogy.service)
  • Influx database energies (influx -database energies -precision rfc3339 -execute "select * from energy order by time desc limit 10")
  • Grafana Source energies@InfluxDB
  • Grafana Dashboard https://banzhaf.chickenkiller.com/grafana/d/_rNE2oO7k/stromverbrauch?orgId=1&refresh=10s&editPanel=12
  • Fan and Solar Plug can be controlled and monitored via Domoticz (using my Tasmoticz Gateway)
  • Added Tasmota energy device nous2 to my new home assistant

LiFePO-Island

My shed in the garden has LiFePO backed island solar power

Monitoring Setup

  • Power route: Panel -> Esmart3 -> BMS -> 12V LiFePOs -> Inverter -> 220 V / 500 W continuous power -> 7 manually switchable output plugs and 2 USB ports
  • Control/Monitoring: The BMS and the ESmart3 report to an ESP32 via RS485 serial line.
  • The ESP32 is behind a Tasmota port forwarding range extender http://nat2, reachable via http://nat2:8080 (see trac topic SolarAnlage)
  • The ESP32 runs my firmware https://github.com/joba-1/LiFePO_Island which posts data to influx
  • Influx DB (influx --database LiFePO_Island --execute "show measurements" for all available data tables) e.g.:
    • ESmart3 charge and load status: influx -precision rfc3339 --database LiFePO_Island --execute 'select * from ChgSts order by time desc limit 10'
    • BMS cell voltages: influx -precision rfc3339 --database LiFePO_Island --execute 'select * from Cells order by time desc limit 10'
  • Grafana Source LiFePO_Island@InfluxDB
  • Grafana Dashboard https://banzhaf.chickenkiller.com/grafana/d/mYiP89N4z/lifepo_island?orgId=1
  • Load can be switched via Domoticz (Dummy Hardware LiFePO_Island with virtual sensor LiFePO_Island_Load, type switch)
    • Switch script: /opt/domoticz/scripts/lua/script_device_LiFePO_Island_Load.lua
    • Status script: /opt/domoticz/scripts/lua/script_time_LiFePO_Island_Load.lua
  • Home Assistant configuration (add in /share/Docker/homeassistant/config/configuration.yaml)
mqtt:
  switch:
    name: "LiFePO_Island Load"
    unique_id: lifepo_island_load_switch
    state_topic: "LiFePO_Island/1/json/LoadParam"
    value_template: "{{ value_json.LoadParam.LoadSts }}"
    state_off: "0"
    state_on: "1"
    command_topic: "LiFePO_Island/1/cmd"
    payload_off: "load off"
    payload_on: "load on"
    availability:
      topic: "LiFePO_Island/1/status/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
  sensor:
    - name: "LiFePO Island Cell 1"
      unique_id: lifepo_island_cell_1
      state_topic: "LiFePO_Island/1/json/Cells"
      unit_of_measurement: "V"
      value_template: "{{ value_json.Cells[0] }}"
    - name: "LiFePO Island Cell 2"
      unique_id: lifepo_island_cell_2
      state_topic: "LiFePO_Island/1/json/Cells"
      unit_of_measurement: "V"
      value_template: "{{ value_json.Cells[1] }}"
    - name: "LiFePO Island Cell 3"
      unique_id: lifepo_island_cell_3
      state_topic: "LiFePO_Island/1/json/Cells"
      unit_of_measurement: "V"
      value_template: "{{ value_json.Cells[2] }}"
    - name: "LiFePO Island Cell 4"
      unique_id: lifepo_island_cell_4
      state_topic: "LiFePO_Island/1/json/Cells"
      unit_of_measurement: "V"
      value_template: "{{ value_json.Cells[3] }}"
    - name: "LiFePO Island Capacity"
      unique_id: lifepo_island_capacity
      state_topic: "LiFePO_Island/1/json/Status"
      unit_of_measurement: "%"
      value_template: "{{ value_json.Status.currentCapacity }}"
  • Added more custom energy sensor values from Log json for battery energy monitoring to my new home assistant