Closed costa2 closed 1 year ago
Hallo, das kann ich irgendwie nicht wirklich nachvollziehen - bei mir funktioniert der code, unter Windows und unter Linux mit Python 3.9.2
edit: Ich vermute du hast Python 3 kleiner V3.6 installiert? Da geht das nicht: --> In Python 3.6, the f-string, formatted string literal, was introduced
Dann mรผsstest du Python updaten.
Schau mal mit python3 -โversion
welche Version du installiert hast und ggf. mรผsstest du dann updaten.
Stimmt, Python 3.4.2 Dann werde ich es mal updaten. Danke erst einmal, ich melde mich dann wieder.
An Python lag es nicht, es ist nun 3.9.9 Muss ich das Script nun eventuell neu installieren?
Apr 09 22:21:05 raspberrypi systemd[1]: HoymilesZeroExport.service holdoff time over, scheduling restart. Apr 09 22:21:05 raspberrypi systemd[1]: Stopping HoymilesZeroExport Service... Apr 09 22:21:05 raspberrypi systemd[1]: Starting HoymilesZeroExport Service... Apr 09 22:21:05 raspberrypi systemd[1]: Started HoymilesZeroExport Service. Apr 09 22:21:05 raspberrypi python3[7496]: File "/home/pi/HoymilesZeroExport/HoymilesZeroExport.py", line 69 Apr 09 22:21:05 raspberrypi python3[7496]: url=f"http://{OPENDTU_IP}/api/limit/config" Apr 09 22:21:05 raspberrypi python3[7496]: ^ Apr 09 22:21:05 raspberrypi python3[7496]: SyntaxError: invalid syntax Apr 09 22:21:05 raspberrypi systemd[1]: HoymilesZeroExport.service: main process exited, code=exited, status=1/FAILURE Apr 09 22:21:05 raspberrypi systemd[1]: Unit HoymilesZeroExport.service entered failed state. Apr 09 22:21:05 raspberrypi systemd[1]: HoymilesZeroExport.service holdoff time over, scheduling restart. Apr 09 22:21:05 raspberrypi systemd[1]: Stopping HoymilesZeroExport Service... Apr 09 22:21:05 raspberrypi systemd[1]: Starting HoymilesZeroExport Service... Apr 09 22:21:05 raspberrypi systemd[1]: HoymilesZeroExport.service ๐๐๐๐๐ ๐๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐ ๐๐๐ ๐๐๐๐๐๐๐, refusing to start. Apr 09 22:21:05 raspberrypi systemd[1]: Failed to start HoymilesZeroExport Service. Apr 09 22:21:05 raspberrypi systemd[1]: Unit HoymilesZeroExport.service entered failed state.
Bist du sicher, dass der Dienst auch mit der neuen Python Version ausgefรผhrt wird? Ich glaube das muss man explizit noch aktivieren.
Kommt bei python3 --version
jetzt 3.9.9?
edit: ah, das hier meinte ich: sudo update-alternatives --config python3
- siehe hier
edit2: gib mal /usr/bin/python3
in die shell ein, damit wird der Service das Script starten.
bei mir sieht das dann so aus:
pi@RasPi4:~$ /usr/bin/python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
pi@raspberrypi:/usr/bin $ python --version Python 3.9.9
was ist wenn du mit dem Befehl hier mal probierst das Script zu starten?
python3.9 HoymilesZeroExport/HoymilesZeroExport.py
pi@raspberrypi:/ $ sudo python3.9: can't open file '/home/pi/HoymilesZeroExport/HoymilesZeroExport/HoymilesZeroExport.py': [Errno 2] No such file or directory
Es ist ja Python 3.9.9, aber auch das geht nicht.
pi@raspberrypi:/ $ sudo python3.9.9 HoymilesZeroExport/HoymilesZeroExport.py sudo: python3.9.9: Kommando nicht gefunden
Oben ist der Pfad falsch, da findet er die Datei nicht.
python3.9 /home/pi/HoymilesZeroExport/HoymilesZeroExport.py
Das mรผsste korrekt sein
Traceback (most recent call last):
File "/home/pi/HoymilesZeroExport/HoymilesZeroExport.py", line 20, in
pip3 install requests
Musst du noch fรผr die neue Version machen
Leider funktioniert es nicht, irgendwas ist mit meinem Fhem nicht i.O.. Die selbe Fehlermeldung bekomme ich auch, wenn ich ein Upgrade auf Bullseye machen mรถchte.
sudo apt-get install python3-requests Paketlisten werden gelesen... Fertig Abhรคngigkeitsbaum wird aufgebaut. Statusinformationen werden eingelesen.... Fertig E: Das Paket fhem muss neu installiert werden, es kann jedoch kein Archiv dafรผr gefunden werden.
Nun habe ich folgendes dazu gefunden:
๐ฒ๐ ๐๐ฐ๐ต๐ฒ๐ถ๐ป๐ ๐ฎ๐น๐ ๐รผ๐ฟ๐ฑ๐ฒ ๐ฒ๐ถ๐ป ๐ฎ๐น๐๐ฒ๐ ๐ฝ๐ฎ๐ธ๐ฒ๐ ๐ป๐ผ๐ฐ๐ต ๐๐ฎ๐ ๐ฏ๐ฒ๐ถ ๐ฑ๐ถ๐ฟ ๐ฏ๐น๐ผ๐ฐ๐ธ๐ถ๐ฒ๐ฟ๐ฒ๐ป: ๐ถ๐ฐ๐ต ๐รผ๐ฟ๐ฑ๐ฒ ๐ฑ๐ถ๐ฟ ๐ณรผ๐ฟ ๐ฎ๐น๐น๐ฒ ๐ณ๐ฎ๐น๐๐ฐ๐ต๐ฒ๐ป ๐๐ป๐ฑ ๐ป๐ถ๐ฐ๐ต๐ ๐๐๐บ ๐ผ๐ณ๐ณ๐ถ๐๐ถ๐ฒ๐น๐น๐ฒ๐ป ๐ฑ๐ฒ๐ฏ๐ถ๐ฎ๐ป ๐๐ฟ๐ฒ๐ฒ ๐ด๐ฒ๐ตรถ๐ฟ๐ฒ๐ป๐ฑ๐ฒ ๐ฝ๐ฎ๐ธ๐ฒ๐๐ฒ ๐ฒ๐บ๐ฝ๐ณ๐ฒ๐ต๐น๐ฒ๐ป ๐ฑ๐ถ๐ฒ๐๐ฒ ๐บ๐ถ๐ ๐ฑ๐ฝ๐ธ๐ด --๐ฝ๐๐ฟ๐ด๐ฒ --๐ณ๐ผ๐ฟ๐ฐ๐ฒ-๐ฎ๐น๐น ๐๐ ๐นรถ๐๐ฐ๐ต๐ฒ๐ป. ๐บ๐ถ๐ ๐ฑ๐ฒ๐ฟ ๐ผ๐ฝ๐๐ถ๐ผ๐ป --๐ณ๐ผ๐ฟ๐ฐ๐ฒ-๐ฟ๐ฒ๐บ๐ผ๐๐ฒ-๐ฟ๐ฒ๐ถ๐ป๐๐๐ฟ๐ฒ๐พ ๐๐ผ๐น๐น๐๐ฒ ๐๐ถ๐ฐ๐ต ๐ฑ๐ฎ๐ ๐ผ๐ฏ๐ฒ๐ป ๐ด๐ฒ๐๐ฐ๐ต๐ถ๐น๐ฑ๐ฒ๐ฟ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ฏ๐น๐ฒ๐บ ๐นรถ๐๐ฒ๐ป ๐น๐ฎ๐๐๐ฒ๐ป.
Ich befรผrchte aber, dass ich meine Fhem Installation damit schrotte.
Ja irgendwas ist da total faul. Du kannst noch das hier probieren: python3.9 -m pip3 install requests Oder python3.9 -m pip install requests
ich bin leider auch kein Linux Professional, evtl kann hier noch jemand helfen? Das Problem wieso das Script nicht startet liegt aber definitiv an Python.
Nun habe ich das Script auf einem zweiten Raspi installiert, welcher nur als Bluetooth Repeater genutzt wird, da lรคuft das Script, aaaber:
Apr 10 16:59:27 raspi2 python3[15109]: 2023-04-10 16:59:27 ERROR Exception at GetPowermeterWatts Apr 10 16:59:27 raspi2 python3[15109]: 2023-04-10 16:59:27 ERROR 'SM1'
Der Hichi hat das MQTT Topic SM1. In der ini ist es so eingestellt:
[SELECT_POWERMETER]
USE_TASMOTA = true
T[TASMOTA]
--- defines for Tasmota Smartmeter Modul---
TASMOTA_IP = 192.168.0.86
the following three constants describes how to navigate through the Tasmota-JSON
e.g. JSON_Result = {"StatusSNS":{"Time":"2023-02-28T12:49:49","SML":{"total_kwh":15011.575,"curr_w":-71}}}
TASMOTA_JSON_STATUS = StatusSNS
Prefix for Web UI and MQTT JSON payload
TASMOTA_JSON_PAYLOAD_MQTT_PREFIX = SM1
Power-MQTT label (the current power in Watt, positive (import more energy than export) or negative (export more ene$
TASMOTA_JSON_POWER_MQTT_LABEL = SM_16_7_0
if your powermeter does NOT output the current power: you need to calculate it -> Power(W) = OBIS(1.7.0) - OBIS(2.7$
TASMOTA_JSON_POWER_CALCULATE = FALSE
Power-MQTT Input label (positive active instantaneous power, e.g. OBIS Code 1.7.0)
TASMOTA_JSON_POWER_INPUT_MQTT_LABEL =
Power-MQTT output label (negative active instantaneous power, e.g. OBIS Code 2.7.0)
TASMOTA_JSON_POWER_OUTPUT_MQTT_LABEL =
Gib mal
http://192.168.0.86/cm?cmnd=status%2010
Im Browser ein und poste mal das was zurรผck kommt
// 20230410173233 // http://192.168.0.86/cm?cmnd=status%2010
{ "StatusSNS": { "Time": "2023-04-10T17:32:10", "SM": { "1_8_0": 143.54, "2_8_0": 35.45, "16_7_0": -53.00, "36_7_0": 27.35, "56_7_0": 179.22, "76_7_0": -259.57, "32_7_0": 225.7, "52_7_0": 227.6, "72_7_0": 228.0, "96_1_0": "1EBxxxxxxxxx" } } }
Dann musst du einstellen:
TASMOTA_JSON_STATUS = StatusSNS
TASMOTA_JSON_PAYLOAD_MQTT_PREFIX = SM
TASMOTA_JSON_POWER_MQTT_LABEL = 16_7_0
Dann musst du einstellen:
TASMOTA_JSON_STATUS = StatusSNS TASMOTA_JSON_PAYLOAD_MQTT_PREFIX = SM TASMOTA_JSON_POWER_MQTT_LABEL = 16_7_0
Vielen Dank fรผr Deine Bemรผhungen, jetzt lรคuft es. Nun muss ich mich nur noch mit dem Feintuning beschรคftigen.
Super, dass es lรคuft und keine ahnung was mit dem Python auf deinem anderen Raspi los ist.
kannst auch mal hier reinschauen: https://github.com/reserve85/HoymilesZeroExport/issues/28
Mein System: 2 HM-600, Ahoy und Hichi Lesekopf. Im HoymilesZeroExport.py ist scheinbar ein Fehler. Kann es daran liegen?
Apr 09 14:41:29 raspberrypi systemd[1]: Starting HoymilesZeroExport Service... Apr 09 14:41:29 raspberrypi systemd[1]: Started HoymilesZeroExport Service. Apr 09 14:41:29 raspberrypi python3[7912]: File "/home/pi/HoymilesZeroExport/HoymilesZeroExport.py", line 69 Apr 09 14:41:29 raspberrypi python3[7912]: url=f"http://{OPENDTU_IP}/api/limit/config" Apr 09 14:41:29 raspberrypi python3[7912]: ^ Apr 09 14:41:29 raspberrypi python3[7912]: SyntaxError: invalid syntax Apr 09 14:41:29 raspberrypi systemd[1]: HoymilesZeroExport.service: main process exited, code=exited, status=1/FAILURE Apr 09 14:41:29 raspberrypi systemd[1]: Unit HoymilesZeroExport.service entered failed state. Apr 09 14:41:29 raspberrypi systemd[1]: HoymilesZeroExport.service holdoff time over, scheduling restart. Apr 09 14:41:29 raspberrypi systemd[1]: Stopping HoymilesZeroExport Service... Apr 09 14:41:29 raspberrypi systemd[1]: Starting HoymilesZeroExport Service... Apr 09 14:41:29 raspberrypi systemd[1]: Started HoymilesZeroExport Service. Apr 09 14:41:29 raspberrypi python3[7918]: File "/home/pi/HoymilesZeroExport/HoymilesZeroExport.py", line 69 Apr 09 14:41:29 raspberrypi python3[7918]: url=f"http://{OPENDTU_IP}/api/limit/config" Apr 09 14:41:29 raspberrypi python3[7918]: ^ Apr 09 14:41:29 raspberrypi python3[7918]: SyntaxError: invalid syntax Apr 09 14:41:29 raspberrypi systemd[1]: HoymilesZeroExport.service: main process exited, code=exited, status=1/FAILURE Apr 09 14:41:29 raspberrypi systemd[1]: Unit HoymilesZeroExport.service entered failed state. Apr 09 14:41:29 raspberrypi systemd[1]: HoymilesZeroExport.service holdoff time over, scheduling restart. Apr 09 14:41:29 raspberrypi systemd[1]: Stopping HoymilesZeroExport Service... Apr 09 14:41:29 raspberrypi systemd[1]: Starting HoymilesZeroExport Service... Apr 09 14:41:29 raspberrypi systemd[1]: Started HoymilesZeroExport Service. Apr 09 14:41:29 raspberrypi python3[7920]: File "/home/pi/HoymilesZeroExport/HoymilesZeroExport.py", line 69 Apr 09 14:41:29 raspberrypi python3[7920]: url=f"http://{OPENDTU_IP}/api/limit/config" Apr 09 14:41:29 raspberrypi python3[7920]: ^ Apr 09 14:41:29 raspberrypi python3[7920]: SyntaxError: invalid syntax Apr 09 14:41:29 raspberrypi systemd[1]: HoymilesZeroExport.service: main process exited, code=exited, status=1/FAILURE Apr 09 14:41:29 raspberrypi systemd[1]: Unit HoymilesZeroExport.service entered failed state. Apr 09 14:41:29 raspberrypi systemd[1]: HoymilesZeroExport.service holdoff time over, scheduling restart. Apr 09 14:41:29 raspberrypi systemd[1]: Stopping HoymilesZeroExport Service... Apr 09 14:41:29 raspberrypi systemd[1]: Starting HoymilesZeroExport Service... Apr 09 14:41:29 raspberrypi systemd[1]: Started HoymilesZeroExport Service. Apr 09 14:41:29 raspberrypi python3[7923]: File "/home/pi/HoymilesZeroExport/HoymilesZeroExport.py", line 69 Apr 09 14:41:29 raspberrypi python3[7923]: url=f"http://{OPENDTU_IP}/api/limit/config" Apr 09 14:41:29 raspberrypi python3[7923]: ^ Apr 09 14:41:29 raspberrypi python3[7923]: SyntaxError: invalid syntax Apr 09 14:41:29 raspberrypi systemd[1]: HoymilesZeroExport.service: main process exited, code=exited, status=1/FAILURE Apr 09 14:41:29 raspberrypi systemd[1]: Unit HoymilesZeroExport.service entered failed state. Apr 09 14:41:29 raspberrypi systemd[1]: HoymilesZeroExport.service holdoff time over, scheduling restart. Apr 09 14:41:29 raspberrypi systemd[1]: Stopping HoymilesZeroExport Service... Apr 09 14:41:29 raspberrypi systemd[1]: Starting HoymilesZeroExport Service... Apr 09 14:41:29 raspberrypi systemd[1]: Started HoymilesZeroExport Service. Apr 09 14:41:30 raspberrypi python3[7925]: File "/home/pi/HoymilesZeroExport/HoymilesZeroExport.py", line 69 Apr 09 14:41:30 raspberrypi python3[7925]: url=f"http://{OPENDTU_IP}/api/limit/config" Apr 09 14:41:30 raspberrypi python3[7925]: ^ Apr 09 14:41:30 raspberrypi python3[7925]: SyntaxError: invalid syntax Apr 09 14:41:30 raspberrypi systemd[1]: HoymilesZeroExport.service: main process exited, code=exited, status=1/FAILURE Apr 09 14:41:30 raspberrypi systemd[1]: Unit HoymilesZeroExport.service entered failed state. Apr 09 14:41:30 raspberrypi systemd[1]: HoymilesZeroExport.service holdoff time over, scheduling restart. Apr 09 14:41:30 raspberrypi systemd[1]: Stopping HoymilesZeroExport Service... Apr 09 14:41:30 raspberrypi systemd[1]: Starting HoymilesZeroExport Service... Apr 09 14:41:30 raspberrypi systemd[1]: HoymilesZeroExport.service start request repeated too quickly, refusing to start. Apr 09 14:41:30 raspberrypi systemd[1]: Failed to start HoymilesZeroExport Service. Apr 09 14:41:30 raspberrypi systemd[1]: Unit HoymilesZeroExport.service entered failed state.