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

fix client_mode configuration block #252

Merged
merged 21 commits into from
Dec 22, 2024

Conversation

s-allius
Copy link
Owner

No description provided.

@s-allius s-allius linked an issue Dec 18, 2024 that may be closed by this pull request
@s-allius s-allius changed the title fix client_mode block fix client_mode configuration block Dec 19, 2024
@s-allius
Copy link
Owner Author

s-allius commented Dec 19, 2024

@mime24 Kannst du dir die Änderungen hier nochmal anschauen. Ich habe:

  • eine deutsche Übersetzung hinzugefügt
  • die client_mode parameter geändert und ergänzt. Wenn du diese konfigurierst, versucht der Proxy ein Verbindung zum Inverter aufbauen. Dies wird zwar von deinem WR nicht unterstützt, aber du solltest eine Log-Eintrag sehen:
'2024-12-19 20:36:49  INFO | conn | 'client_mode' for snr: 2.......000 host: 192.168.x.x:8899, forward: True'

Was mir noch nicht klar ist, ob wir den DNS Server für den Proxy noch setzen müssen. Es muss sichergestellt sein, dass der Proxy nicht den lokalen DNS Server nutzt, sonst löst er die cloud Hostnamen wieder auf sich selbst auf. Im composer file habe dazu als DNS Server für 8.8.8.8 und 4.4.4.4 konfiguriert.

@mime24
Copy link
Collaborator

mime24 commented Dec 20, 2024

klar, schaue ich mir heute Abend an.

@mime24
Copy link
Collaborator

mime24 commented Dec 20, 2024

Da die Translations im add-on config Tab ohne Formatierung gerendert werden, kürze ich einige Texte ein und verweise ggf. auf die Doku.

@mime24
Copy link
Collaborator

mime24 commented Dec 20, 2024

er zeigt bei mir eine 0 bei der Seriennummer ('client_mode' for snr: 0 )

- serial: R17E760702080xxx
  node_id: PV-Garage
  suggested_area: Garage
  modbus_polling: false
  pv1.manufacturer: Shinefar
  pv1.type: SF-M18/144550
  pv2.manufacturer: Shinefar
  pv2.type: SF-M18/144550
  client_mode.host: 192.168.178.80
  client_mode.port: 8899
  client_mode.forward: true

Log...

Add-on environment started
check for Home Assistant MQTT
MQTT found
Start Proxyserver...
'2024-12-20 17:28:42  INFO | root | Server "proxy - " will be started'
'2024-12-20 17:28:42  INFO | root | current dir: /home/proxy'
'2024-12-20 17:28:42  INFO | root | config_path: /homeassistant/tsun-proxy/'
'2024-12-20 17:28:42  INFO | root | json_config: /data/options.json'
'2024-12-20 17:28:42  INFO | root | toml_config: None'
'2024-12-20 17:28:42  INFO | root | log_path:    /homeassistant/tsun-proxy/logs/'
'2024-12-20 17:28:42  INFO | root | log_backups: 2 days'
'2024-12-20 17:28:42  INFO | root | LOG_LVL    : INFO'
'2024-12-20 17:28:42  INFO | root | ******'
'2024-12-20 17:28:42  INFO | root | Read from default_config.toml => ok'
'2024-12-20 17:28:42  INFO | root | Read from Read environment => ok'
'2024-12-20 17:28:42  INFO | root | Read from /homeassistant/tsun-proxy/config.json => n/a'
'2024-12-20 17:28:42  INFO | root | Read from /homeassistant/tsun-proxy/config.toml => n/a'
'2024-12-20 17:28:42  INFO | root | Read from /data/options.json => ok'
'2024-12-20 17:28:42  INFO | root | ******'
'2024-12-20 17:28:42  INFO | conn | 'client_mode' for snr: 0 host: 192.168.178.80:8899, forward: True'
'2024-12-20 17:28:42  INFO | root | listen on port: 5005 for inverters'
'2024-12-20 17:28:42  INFO | root | listen on port: 10000 for inverters'
'2024-12-20 17:28:42  INFO | mqtt | start MQTT: host:core-mosquitto  port:1883  user:addons'
'2024-12-20 17:28:42  INFO | root | HTTP server listen on port: 8127'
'2024-12-20 17:28:42  INFO | mqtt | MQTT broker connection established'
'2024-12-20 17:28:42  INFO | root | Initialize proxy device on home assistant'

@mime24
Copy link
Collaborator

mime24 commented Dec 20, 2024

bezüglich deiner frage zum DNS server.
In dem typischen Add-on setup mit dem AdGuard Addon sollte man kein nennenswertes Risiko haben. In der Beschreibung vom AdGuard wird ganz deutlich darauf hingewiesen, dass der Homeassistant eine feste IP Adresse und einen externen DNS verwendet.

Ensure your Home Assistant device has a static IP and static external DNS servers! This is important! You WILL end up having issues if you skip this step.

in den Parameterlisten für die Addon configuration habe ich nichts zu DNS gefunden.

@s-allius
Copy link
Owner Author

er zeigt bei mir eine 0 bei der Seriennummer ('client_mode' for snr: 0 )

- serial: R17E760702080xxx
  node_id: PV-Garage
  suggested_area: Garage
  modbus_polling: false
  pv1.manufacturer: Shinefar
  pv1.type: SF-M18/144550
  pv2.manufacturer: Shinefar
  pv2.type: SF-M18/144550
  client_mode.host: 192.168.178.80
  client_mode.port: 8899
  client_mode.forward: true

Log...

Add-on environment started
check for Home Assistant MQTT
MQTT found
Start Proxyserver...
'2024-12-20 17:28:42  INFO | root | Server "proxy - " will be started'
'2024-12-20 17:28:42  INFO | root | current dir: /home/proxy'
'2024-12-20 17:28:42  INFO | root | config_path: /homeassistant/tsun-proxy/'
'2024-12-20 17:28:42  INFO | root | json_config: /data/options.json'
'2024-12-20 17:28:42  INFO | root | toml_config: None'
'2024-12-20 17:28:42  INFO | root | log_path:    /homeassistant/tsun-proxy/logs/'
'2024-12-20 17:28:42  INFO | root | log_backups: 2 days'
'2024-12-20 17:28:42  INFO | root | LOG_LVL    : INFO'
'2024-12-20 17:28:42  INFO | root | ******'
'2024-12-20 17:28:42  INFO | root | Read from default_config.toml => ok'
'2024-12-20 17:28:42  INFO | root | Read from Read environment => ok'
'2024-12-20 17:28:42  INFO | root | Read from /homeassistant/tsun-proxy/config.json => n/a'
'2024-12-20 17:28:42  INFO | root | Read from /homeassistant/tsun-proxy/config.toml => n/a'
'2024-12-20 17:28:42  INFO | root | Read from /data/options.json => ok'
'2024-12-20 17:28:42  INFO | root | ******'
'2024-12-20 17:28:42  INFO | conn | 'client_mode' for snr: 0 host: 192.168.178.80:8899, forward: True'
'2024-12-20 17:28:42  INFO | root | listen on port: 5005 for inverters'
'2024-12-20 17:28:42  INFO | root | listen on port: 10000 for inverters'
'2024-12-20 17:28:42  INFO | mqtt | start MQTT: host:core-mosquitto  port:1883  user:addons'
'2024-12-20 17:28:42  INFO | root | HTTP server listen on port: 8127'
'2024-12-20 17:28:42  INFO | mqtt | MQTT broker connection established'
'2024-12-20 17:28:42  INFO | root | Initialize proxy device on home assistant'

Das ist genau wie erwartet. Da du bei GEN3 Wechselrichter keine monitor_snr hast wird der Defaultwert 0gesetzt.

@s-allius
Copy link
Owner Author

bezüglich deiner frage zum DNS server. In dem typischen Add-on setup mit dem AdGuard Addon sollte man kein nennenswertes Risiko haben. In der Beschreibung vom AdGuard wird ganz deutlich darauf hingewiesen, dass der Homeassistant eine feste IP Adresse und einen externen DNS verwendet.

Ensure your Home Assistant device has a static IP and static external DNS servers! This is important! You WILL end up having issues if you skip this step.

in den Parameterlisten für die Addon configuration habe ich nichts zu DNS gefunden.

OK, dann müssen wir da nichts weiteres machen.

@s-allius
Copy link
Owner Author

@mime24 Hallo Michael, müssen wir an der AddOn Implementierung noch was tun, oder ist die gut genug für eine erste Release? Ich würde gerne in den nächsten 2 Tagen die 0.12 veröffentlichen. Wenn für den add-on Betrieb was noch nicht rund ist, könnte ich auch einen ReleaseCandidaten erstellen

@s-allius
Copy link
Owner Author

bezüglich deiner frage zum DNS server. In dem typischen Add-on setup mit dem AdGuard Addon sollte man kein nennenswertes Risiko haben. In der Beschreibung vom AdGuard wird ganz deutlich darauf hingewiesen, dass der Homeassistant eine feste IP Adresse und einen externen DNS verwendet.

Ensure your Home Assistant device has a static IP and static external DNS servers! This is important! You WILL end up having issues if you skip this step.

in den Parameterlisten für die Addon configuration habe ich nichts zu DNS gefunden.

OK, dann müssen wir da nichts weiteres machen.

Habe doch noch eine Erkennung implementiert, die eine Error loggt, wenn die TSUN Domänen auf eine lokale IP aufgelöst werden. #256

@mime24
Copy link
Collaborator

mime24 commented Dec 22, 2024

aus meiner definitiv gut genug für ein erstes Release. Ich freue mich, dass wir es soweit geschafft haben. Tolle Sache. Ich habe dabei sehr viel gelernt!

@mime24
Copy link
Collaborator

mime24 commented Dec 22, 2024

wenn du möchtest kannst du noch das CHANGELOG.md im makefile für das addon aufnehmen, sodass dieses auch im add-on folder verfügbar ist.

@s-allius s-allius merged commit f227faa into dev-0.12 Dec 22, 2024
5 checks passed
@s-allius s-allius deleted the 219-ha-addon-complete-the-configuration branch December 22, 2024 19:16
s-allius added a commit that referenced this pull request Dec 22, 2024
* add ha_addons repository to cscode workspace

* Issue220 ha addon dokumentation update (#232)

* initial DOCS.md for Addon

* links to Mosquitto and Adguard

* replaced _ by . for PV-Strings

* mentioned add-on installation method in README.md

* fix most of the markdown linter warnings

* add missing alt texts

* added nice add repository to my Home Assistant badges

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>
Co-authored-by: Stefan Allius <stefan.allius@t-online.de>

* S allius/issue216 (#235)


* improve docker run

- establish multistage Dockerfile
- build a python wheel for all needed packages
- remove unneeded tools like apk for runtime

* pin versions, fix hadolint warnings

* merge from dev-0.12

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* Issue220 ha addon dokumentation update (#245)

* revised config disclaimer

* add newline at end of file to fix linter warning

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* 238 ha addon repository check (#244)

* move Makefile and bake file into parent folder

* build config.yaml from template

* use Makefile instead of build shell script

* ignore temporary or created files

* add rules for building the add-on repository

* add rel version of add-on

* add  jinja2-cli

* ignore inverter replays which a older than 1 day (#246)

* S allius/issue7 (#248)

* report alarm and fault bitfield to ha

* define the alarm and fault names

* configure log path and max number of daily log files (#243)

* configure log path and max number of daily log files

* don't use a subfolder for configs

* use make instead of a build script

* mount /homeassistant/tsun-proxy

* Add venv to base image

* give write access to mounted folder

* intial checkin, ignore SC1091

* set advanced and stage value in config.yaml

* fix typo

* added watchdog and removed Port 8127 from mapping

* fixed typo and use new add-on repro

- change the install button to install from
 https://github.com/s-allius/ha-addons

* add addon-rel target

* disable watchdog due to exceptions in the ha supervisor

* update changelog

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* Update README.md (#251)

install `https://github.com/s-allius/ha-addons` as repro for our add-on

* add german language file (#253)

* fix return type get_extra_info in FakeWriter

* move global startup code into main methdod

* pin version of base image

* avoid forwarding to a private (lokal) IP addr (#256)

* avoid forwarding to a private (lokal) IP addr

* test DNS resolver issues

* increase test coverage

* update changelog

* fix client_mode configuration block (#252)

* fix client_mode block

* add client mode

* fix tests with client_mode values

* log client_mode configuration

* add forward flag for client_mode

* improve startup logging

* added client_mode example

* adjusted translation files

* AT commands added

* typo

* missing "PLUS"

* link to config details

* improve log msg for config problems

* improve log msg on config errors

* improve log msg for config problems

* copy CHANGELOG.md into add-on repro

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* rename "ConfigErr" to match naming convention

* disable test coverage for __main__

* update changelog version 0.12

---------

Co-authored-by: metzi <147942647+mime24@users.noreply.github.com>
Co-authored-by: Michael Metz <michael.metz@siemens.com>
s-allius added a commit that referenced this pull request Dec 22, 2024
* add ha_addons repository to cscode workspace

* Issue220 ha addon dokumentation update (#232)

* initial DOCS.md for Addon

* links to Mosquitto and Adguard

* replaced _ by . for PV-Strings

* mentioned add-on installation method in README.md

* fix most of the markdown linter warnings

* add missing alt texts

* added nice add repository to my Home Assistant badges

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>
Co-authored-by: Stefan Allius <stefan.allius@t-online.de>

* S allius/issue216 (#235)


* improve docker run

- establish multistage Dockerfile
- build a python wheel for all needed packages
- remove unneeded tools like apk for runtime

* pin versions, fix hadolint warnings

* merge from dev-0.12

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* Issue220 ha addon dokumentation update (#245)

* revised config disclaimer

* add newline at end of file to fix linter warning

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* 238 ha addon repository check (#244)

* move Makefile and bake file into parent folder

* build config.yaml from template

* use Makefile instead of build shell script

* ignore temporary or created files

* add rules for building the add-on repository

* add rel version of add-on

* add  jinja2-cli

* ignore inverter replays which a older than 1 day (#246)

* S allius/issue7 (#248)

* report alarm and fault bitfield to ha

* define the alarm and fault names

* configure log path and max number of daily log files (#243)

* configure log path and max number of daily log files

* don't use a subfolder for configs

* use make instead of a build script

* mount /homeassistant/tsun-proxy

* Add venv to base image

* give write access to mounted folder

* intial checkin, ignore SC1091

* set advanced and stage value in config.yaml

* fix typo

* added watchdog and removed Port 8127 from mapping

* fixed typo and use new add-on repro

- change the install button to install from
 https://github.com/s-allius/ha-addons

* add addon-rel target

* disable watchdog due to exceptions in the ha supervisor

* update changelog

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* Update README.md (#251)

install `https://github.com/s-allius/ha-addons` as repro for our add-on

* add german language file (#253)

* fix return type get_extra_info in FakeWriter

* move global startup code into main methdod

* pin version of base image

* avoid forwarding to a private (lokal) IP addr (#256)

* avoid forwarding to a private (lokal) IP addr

* test DNS resolver issues

* increase test coverage

* update changelog

* fix client_mode configuration block (#252)

* fix client_mode block

* add client mode

* fix tests with client_mode values

* log client_mode configuration

* add forward flag for client_mode

* improve startup logging

* added client_mode example

* adjusted translation files

* AT commands added

* typo

* missing "PLUS"

* link to config details

* improve log msg for config problems

* improve log msg on config errors

* improve log msg for config problems

* copy CHANGELOG.md into add-on repro

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* rename "ConfigErr" to match naming convention

* disable test coverage for __main__

* update changelog version 0.12

---------

Co-authored-by: metzi <147942647+mime24@users.noreply.github.com>
Co-authored-by: Michael Metz <michael.metz@siemens.com>
s-allius added a commit that referenced this pull request Dec 22, 2024
* add ha_addons repository to cscode workspace

* Issue220 ha addon dokumentation update (#232)

* initial DOCS.md for Addon

* links to Mosquitto and Adguard

* replaced _ by . for PV-Strings

* mentioned add-on installation method in README.md

* fix most of the markdown linter warnings

* add missing alt texts

* added nice add repository to my Home Assistant badges

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>
Co-authored-by: Stefan Allius <stefan.allius@t-online.de>

* S allius/issue216 (#235)


* improve docker run

- establish multistage Dockerfile
- build a python wheel for all needed packages
- remove unneeded tools like apk for runtime

* pin versions, fix hadolint warnings

* merge from dev-0.12

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* Issue220 ha addon dokumentation update (#245)

* revised config disclaimer

* add newline at end of file to fix linter warning

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* 238 ha addon repository check (#244)

* move Makefile and bake file into parent folder

* build config.yaml from template

* use Makefile instead of build shell script

* ignore temporary or created files

* add rules for building the add-on repository

* add rel version of add-on

* add  jinja2-cli

* ignore inverter replays which a older than 1 day (#246)

* S allius/issue7 (#248)

* report alarm and fault bitfield to ha

* define the alarm and fault names

* configure log path and max number of daily log files (#243)

* configure log path and max number of daily log files

* don't use a subfolder for configs

* use make instead of a build script

* mount /homeassistant/tsun-proxy

* Add venv to base image

* give write access to mounted folder

* intial checkin, ignore SC1091

* set advanced and stage value in config.yaml

* fix typo

* added watchdog and removed Port 8127 from mapping

* fixed typo and use new add-on repro

- change the install button to install from
 https://github.com/s-allius/ha-addons

* add addon-rel target

* disable watchdog due to exceptions in the ha supervisor

* update changelog

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* Update README.md (#251)

install `https://github.com/s-allius/ha-addons` as repro for our add-on

* add german language file (#253)

* fix return type get_extra_info in FakeWriter

* move global startup code into main methdod

* pin version of base image

* avoid forwarding to a private (lokal) IP addr (#256)

* avoid forwarding to a private (lokal) IP addr

* test DNS resolver issues

* increase test coverage

* update changelog

* fix client_mode configuration block (#252)

* fix client_mode block

* add client mode

* fix tests with client_mode values

* log client_mode configuration

* add forward flag for client_mode

* improve startup logging

* added client_mode example

* adjusted translation files

* AT commands added

* typo

* missing "PLUS"

* link to config details

* improve log msg for config problems

* improve log msg on config errors

* improve log msg for config problems

* copy CHANGELOG.md into add-on repro

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* rename "ConfigErr" to match naming convention

* disable test coverage for __main__

* update changelog version 0.12

---------

Co-authored-by: metzi <147942647+mime24@users.noreply.github.com>
Co-authored-by: Michael Metz <michael.metz@siemens.com>
s-allius added a commit that referenced this pull request Dec 24, 2024
* add ha_addons repository to cscode workspace

* Issue220 ha addon dokumentation update (#232)

* initial DOCS.md for Addon

* links to Mosquitto and Adguard

* replaced _ by . for PV-Strings

* mentioned add-on installation method in README.md

* fix most of the markdown linter warnings

* add missing alt texts

* added nice add repository to my Home Assistant badges

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>
Co-authored-by: Stefan Allius <stefan.allius@t-online.de>

* S allius/issue216 (#235)


* improve docker run

- establish multistage Dockerfile
- build a python wheel for all needed packages
- remove unneeded tools like apk for runtime

* pin versions, fix hadolint warnings

* merge from dev-0.12

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* Issue220 ha addon dokumentation update (#245)

* revised config disclaimer

* add newline at end of file to fix linter warning

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* 238 ha addon repository check (#244)

* move Makefile and bake file into parent folder

* build config.yaml from template

* use Makefile instead of build shell script

* ignore temporary or created files

* add rules for building the add-on repository

* add rel version of add-on

* add  jinja2-cli

* ignore inverter replays which a older than 1 day (#246)

* S allius/issue7 (#248)

* report alarm and fault bitfield to ha

* define the alarm and fault names

* configure log path and max number of daily log files (#243)

* configure log path and max number of daily log files

* don't use a subfolder for configs

* use make instead of a build script

* mount /homeassistant/tsun-proxy

* Add venv to base image

* give write access to mounted folder

* intial checkin, ignore SC1091

* set advanced and stage value in config.yaml

* fix typo

* added watchdog and removed Port 8127 from mapping

* fixed typo and use new add-on repro

- change the install button to install from
 https://github.com/s-allius/ha-addons

* add addon-rel target

* disable watchdog due to exceptions in the ha supervisor

* update changelog

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* Update README.md (#251)

install `https://github.com/s-allius/ha-addons` as repro for our add-on

* add german language file (#253)

* fix return type get_extra_info in FakeWriter

* move global startup code into main methdod

* pin version of base image

* avoid forwarding to a private (lokal) IP addr (#256)

* avoid forwarding to a private (lokal) IP addr

* test DNS resolver issues

* increase test coverage

* update changelog

* fix client_mode configuration block (#252)

* fix client_mode block

* add client mode

* fix tests with client_mode values

* log client_mode configuration

* add forward flag for client_mode

* improve startup logging

* added client_mode example

* adjusted translation files

* AT commands added

* typo

* missing "PLUS"

* link to config details

* improve log msg for config problems

* improve log msg on config errors

* improve log msg for config problems

* copy CHANGELOG.md into add-on repro

---------

Co-authored-by: Michael Metz <michael.metz@siemens.com>

* rename "ConfigErr" to match naming convention

* disable test coverage for __main__

* update changelog version 0.12

* Merge branch 'main' of https://github.com/s-allius/tsun-gen3-proxy

* copy the run.sh scripts into the add-on repros

* set image path using jinja template

* fix wiki pathss

---------

Co-authored-by: metzi <147942647+mime24@users.noreply.github.com>
Co-authored-by: Michael Metz <michael.metz@siemens.com>
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

Successfully merging this pull request may close these issues.

HA AddOn: Complete. the configuration
2 participants