Halmand / dbus-shelly-1pm-and-pm1-Plus-pvinverter-multi-instance

Integrate Shelly 1PM into Victron Energies Venus OS as a pv inverter
20 stars 8 forks source link

Fehlermeldung, #4

Open McGlenWin opened 1 year ago

McGlenWin commented 1 year ago

Hallo, der Service läuft auf einem Raspi. Das Device wird nicht in der Deviceliste angezeigt und ich bekomme folgenden Fehler im log angezeigt. Bin leider nicht versiert in der Programmierung. Was bedeutet der Fehler KeyError: 'sys' ChatGPT meint, das es den Eintrag sys nicht im Wörterbuch meter_data gibt. Damit kann ich leider nichts anfangen. Hast du einen Hinweis, was ich falsch gemacht haben könnte.

root@raspberrypi2:/data/dbus-shelly-1pm-pvinverter01# tail -n 40 current.log 2023-03-23 13:57:57,870 root DEBUG added /Position with start value 0. Writeable is False 2023-03-23 13:57:57,897 urllib3.connectionpool DEBUG Starting new HTTP connection (1): 192.168.0.60:80 2023-03-23 13:57:57,941 urllib3.connectionpool DEBUG http://192.168.0.60:80 "GET /status HTTP/1.1" 200 1073 2023-03-23 13:57:57,947 root CRITICAL Error at main Traceback (most recent call last): File "/data/dbus-shelly-1pm-pvinverter01/dbus-shelly-1pm-pvinverter.py", line 264, in main pvac_output = DbusShelly1pmService( File "/data/dbus-shelly-1pm-pvinverter01/dbus-shelly-1pm-pvinverter.py", line 53, in init self._dbusservice.add_path('/Serial', self._getShellySerial()) File "/data/dbus-shelly-1pm-pvinverter01/dbus-shelly-1pm-pvinverter.py", line 78, in _getShellySerial if not meter_data['sys']['mac']: KeyError: 'sys' 2023-03-23 13:58:00,710 root INFO Start 2023-03-23 13:58:00,733 root DEBUG VeDbusTreeExport / has been created 2023-03-23 13:58:00,734 root INFO registered ourselves on D-Bus as com.victronenergy.pvinverter.http_44 2023-03-23 13:58:00,735 root DEBUG com.victronenergy.pvinverter /DeviceInstance = 44 2023-03-23 13:58:00,736 root DEBUG VeDbusTreeExport /Mgmt has been created 2023-03-23 13:58:00,737 root DEBUG added /Mgmt/ProcessName with start value /data/dbus-shelly-1pm-pvinverter01/dbus-shelly-1pm-pvinverter.py. Writeable is False 2023-03-23 13:58:00,739 root DEBUG added /Mgmt/ProcessVersion with start value Unkown version, and running on Python 3.8.11. Writeable is False 2023-03-23 13:58:00,740 root DEBUG added /Mgmt/Connection with start value Shelly(Plus) 1PM HTTP JSON service. Writeable is False 2023-03-23 13:58:00,741 root DEBUG added /DeviceInstance with start value 44. Writeable is False 2023-03-23 13:58:00,742 root DEBUG added /ProductId with start value 65535. Writeable is False 2023-03-23 13:58:00,743 root DEBUG added /ProductName with start value Shelly(Plus) 1PM. Writeable is False 2023-03-23 13:58:00,744 root DEBUG added /CustomName with start value Klima. Writeable is False 2023-03-23 13:58:00,745 root DEBUG added /Connected with start value 1. Writeable is False 2023-03-23 13:58:00,746 root DEBUG added /Latency with start value None. Writeable is False 2023-03-23 13:58:00,747 root DEBUG added /FirmwareVersion with start value 0.1. Writeable is False 2023-03-23 13:58:00,747 root DEBUG added /HardwareVersion with start value 0. Writeable is False 2023-03-23 13:58:00,748 root DEBUG added /Position with start value 0. Writeable is False 2023-03-23 13:58:00,775 urllib3.connectionpool DEBUG Starting new HTTP connection (1): 192.168.0.60:80 2023-03-23 13:58:00,818 urllib3.connectionpool DEBUG http://192.168.0.60:80 "GET /status HTTP/1.1" 200 1073 2023-03-23 13:58:00,825 root CRITICAL Error at main Traceback (most recent call last): File "/data/dbus-shelly-1pm-pvinverter01/dbus-shelly-1pm-pvinverter.py", line 264, in main pvac_output = DbusShelly1pmService( File "/data/dbus-shelly-1pm-pvinverter01/dbus-shelly-1pm-pvinverter.py", line 53, in init self._dbusservice.add_path('/Serial', self._getShellySerial()) File "/data/dbus-shelly-1pm-pvinverter01/dbus-shelly-1pm-pvinverter.py", line 78, in _getShellySerial if not meter_data['sys']['mac']: KeyError: 'sys'

amcsSH commented 1 year ago

Hallo @McGlenWin ,

welche Version der Shelly 1PM Komponente setzt du ein:

Von der Gen1 zu Gen2 hat sich der API-Endpunkt für die Abfrage der Messdaten des Shellies geänderr. Dies kannst Du in der Konfiguration (config.ini) einstellen, zB aktivieren für Gen2 mit 'PlusPmSupport = True' oder deaktvieren für Gen1 mit 'PlusPmSupport = False'.

Viele Grüße