sincze / Domoticz-Omnik-Local-Web-Plugin

Domoticz Python Plugin that can read data from the local inverter webinterface
5 stars 2 forks source link

Version 2.0.0 not working anymore #17

Closed HobbyKonijn closed 6 months ago

HobbyKonijn commented 6 months ago

Since today my Omnik solar logging stopped in Domoticz. Also the Omnik as device (Switch tab in Domoticz) remains off.

If I check http://inverter/js/status.js I see all inverter data.

I used a dzvents script to copy inverter status to local and linked domoticz to the raspbarry pi where the copied status.js was placed.

(Not all code are copied paste) execute = function(domoticz, timer) cmd = 'wget http://192.168.2.25/js/status.js --output-document=/home/pi/domoticz/www/js/status.js' os.execute(cmd) domoticz.log('Timer event was triggered by ' .. timer.trigger ..' wget command executed' , domoticz.LOG_INFO)

This is also still working correct. This was working fine till yesterday.

What is done so far: Updated plugin to 2.0.0 of @sincze Restored plug in link (hardware in domoticz) to 192.168.2.25 (Omnik adress) Stopped copy paste action of dzvents script to debug.

No I get following errors and no data is collected: Please advice :)

2024-02-25 13:58:48.018 Omnik: onStart called 2024-02-25 13:58:48.018 Omnik: Debug logging mask set to: PYTHON PLUGIN IMAGE DEVICE CONNECTION 2024-02-25 13:58:48.019 Omnik: 'HardwareID':'7' 2024-02-25 13:58:48.019 Omnik: 'HomeFolder':'/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/' 2024-02-25 13:58:48.019 Omnik: 'StartupFolder':'/home/pi/domoticz/' 2024-02-25 13:58:48.019 Omnik: 'UserDataFolder':'/home/pi/domoticz/' 2024-02-25 13:58:48.019 Omnik: 'Database':'/home/pi/domoticz/domoticz.db' 2024-02-25 13:58:48.019 Omnik: 'Language':'en' 2024-02-25 13:58:48.019 Omnik: 'Version':'2.0.0' 2024-02-25 13:58:48.019 Omnik: 'Author':'sincze' 2024-02-25 13:58:48.019 Omnik: 'Name':'Omnik' 2024-02-25 13:58:48.019 Omnik: 'Address':'192.168.2.25' 2024-02-25 13:58:48.019 Omnik: 'Port':'0' 2024-02-25 13:58:48.019 Omnik: 'Key':'OmnikLocalWeb2' 2024-02-25 13:58:48.019 Omnik: 'Mode1':'http' 2024-02-25 13:58:48.019 Omnik: 'Mode2':'2' 2024-02-25 13:58:48.019 Omnik: 'Mode6':'62' 2024-02-25 13:58:48.019 Omnik: 'DomoticzVersion':'2024.4' 2024-02-25 13:58:48.019 Omnik: 'DomoticzHash':'73xxxxxxx' 2024-02-25 13:58:48.020 Omnik: 'DomoticzBuildTime':'2024-01-30 09:16:34' 2024-02-25 13:58:48.020 Omnik: Device count: 3 2024-02-25 13:58:48.020 Omnik: Device: 1 - ID: 23, Name: 'Omnik - Inverter (kWh)', nValue: 0, sValue: '0.0;8563500.0' 2024-02-25 13:58:48.020 Omnik: Device ID: '23' 2024-02-25 13:58:48.020 Omnik: Device Name: 'Omnik - Inverter (kWh)' 2024-02-25 13:58:48.020 Omnik: Device nValue: 0 2024-02-25 13:58:48.020 Omnik: Device sValue: '0.0;8563500.0' 2024-02-25 13:58:48.020 Omnik: Device LastLevel: 0 2024-02-25 13:58:48.020 Omnik: Device: 2 - ID: 24, Name: 'Omnik - Inverter (W)', nValue: 0, sValue: '0.0' 2024-02-25 13:58:48.020 Omnik: Device ID: '24' 2024-02-25 13:58:48.020 Omnik: Device Name: 'Omnik - Inverter (W)' 2024-02-25 13:58:48.020 Omnik: Device nValue: 0 2024-02-25 13:58:48.020 Omnik: Device sValue: '0.0' 2024-02-25 13:58:48.020 Omnik: Device LastLevel: 0 2024-02-25 13:58:48.020 Omnik: Device: 3 - ID: 25, Name: 'Omnik - Inverter Status', nValue: 0, sValue: 'Off' 2024-02-25 13:58:48.020 Omnik: Device ID: '25' 2024-02-25 13:58:48.020 Omnik: Device Name: 'Omnik - Inverter Status' 2024-02-25 13:58:48.020 Omnik: Device nValue: 0 2024-02-25 13:58:48.020 Omnik: Device sValue: 'Off' 2024-02-25 13:58:48.020 Omnik: Device LastLevel: 0 2024-02-25 13:58:48.021 Omnik: Plugin started 2024-02-25 13:58:48.021 (Omnik) Creating images from file '/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/Omnik.zip'. 2024-02-25 13:58:48.028 Omnik: Local context: 2024-02-25 13:58:48.028 Omnik: ----> 'Devices' '{1: <Domoticz.Device object at 0x6c2bd9e0>, 2: <Domoticz.Device object at 0x668a6f80>, 3: <Domoticz.Device object at 0x668a6440>}' 2024-02-25 13:58:48.029 Omnik: ----> 'Domoticz' '<module 'Domoticz' (built-in)>' 2024-02-25 13:58:48.029 Omnik: ----> 'Images' '{'GasSens': <Domoticz.Image object at 0x64982ee0>}' 2024-02-25 13:58:48.029 Omnik: ----> 'Parameters' '{'HardwareID': 7, 'HomeFolder': '/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/', 'StartupFolder': '/home/pi/domoticz/', 'UserDataFolder': '/home/pi/domoticz/', 'WebRoot': '', 'Database': '/home/pi/domoticz/domoticz.db', 'Language': 'en', 'Version': '2.0.0', 'Author': 'sincze', 'Name': 'Omnik', 'Address': '192.168.2.25', 'Port': '0', 'SerialPort': '', 'Username': '', 'Password': '', 'Key': 'OmnikLocalWeb2', 'Mode1': 'http', 'Mode2': '2', 'Mode3': '', 'Mode4': '', 'Mode5': '', 'Mode6': '62', 'DomoticzVersion': '2024.4', 'DomoticzHash': '73xxxxxxx', 'DomoticzBuildTime': '2024-01-30 09:16:34'}' 2024-02-25 13:58:48.029 Omnik: ----> '_plugin' '<plugin.BasePlugin object at 0x7xxxxxb0>' 2024-02-25 13:58:48.029 Omnik: ----> 'local' 'False' 2024-02-25 13:58:48.030 Omnik: ----> 're' '<module 're' from '/usr/lib/python3.7/re.py'>' 2024-02-25 13:58:48.030 Omnik: ----> 'requests' '<module 'requests' from '/usr/lib/python3/dist-packages/requests/init.py'>' 2024-02-25 13:58:48.030 Omnik: ----> 'threading' '<module 'threading' from '/usr/lib/python3.7/threading.py'>' 2024-02-25 13:58:48.014 Status: Omnik: Initialized version 2.0.0, author 'sincze' 2024-02-25 13:58:48.026 Error: Omnik: Call to function 'onStart' failed, exception details: 2024-02-25 13:58:48.028 Error: Omnik: Traceback (most recent call last): 2024-02-25 13:58:48.028 Error: Omnik: File "/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/plugin.py", line 217, in onStart 2024-02-25 13:58:48.028 Error: Omnik: _plugin.onStart() 2024-02-25 13:58:48.028 Error: Omnik: File "/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/plugin.py", line 116, in onStart 2024-02-25 13:58:48.028 Error: Omnik: createDevices() 2024-02-25 13:58:48.028 Error: Omnik: File "/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/plugin.py", line 280, in createDevices 2024-02-25 13:58:48.028 Error: Omnik: image = Images["Omnik"].ID # Get id from database 2024-02-25 13:58:48.028 Error: Omnik: KeyError: 'Omnik' 2024-02-25 13:58:56.093 Omnik: onHeartbeat called, run again in 5 heartbeats. 2024-02-25 13:59:06.062 Omnik: onHeartbeat called, run again in 4 heartbeats.

status.js info: var version= "H4.01.51MW.2.01W1.0.65(2018-02-271-D)"; var m2mMid = "643xxxxxxxx"; var wlanMac= "F0:xx:xx:xx:xx:xx"; var m2mRssi= "100%"; var wanIp= "192.168.2.25"; var nmac= "F0xxxxxxxxxx"; var fephy= "off"; var yz_device_type="258"; var yz_device_num="1"; var init_inv_type="0"; var myDeviceArray=new Array(); myDeviceArray[0]="AARN202019191183,V5.06Build243,V4.13Build262,Omnik2000tl ,2000,307,220,85657,,0,"; ; function initPageText() {

sincze commented 6 months ago

I notice 2 things:

2024-02-25 13:58:48.019 Omnik: 'Address':'192.168.2.25'
2024-02-25 13:58:48.019 Omnik: 'Port':'0'

I would expect port 80 for http traffic here.

2024-02-25 13:58:48.028 Error: Omnik: image = Images["Omnik"].ID # Get id from database
2024-02-25 13:58:48.028 Error: Omnik: KeyError: 'Omnik'

Can be resolved by removing the existing images from Domoticz. They will be re-added.

By itself the Plugin did not change here, and still reports data: image

HobbyKonijn commented 6 months ago

Can be resolved by removing the existing images from Domoticz. They will be re-added.

Removed all related omnik images (devices), after disable and enable in HW setting no new devices are created.

In original script v2.0.0 is writen:

HobbyKonijn commented 6 months ago

Actions done: -Removed Hardware from domoticz -Removed Plugin directory from raspberry pi -Restart raspberry pi

Installed version 2.0.0 of website Swithed on new hardware for 5 minutes in domoticz Added new hardware in domoticz and added all data required to log from the Omnik inverter

https://github.com/sincze/Domoticz-Omnik-Local-Web-Plugin/issues/12#issuecomment-1328323442 This worked perfect for a while ...

Note: Remain port: 0 in logging instead of port 80 No new devices created called OmnikSolar no Omnik icons added in switches and utilities.

Logging: 2024-02-25 16:25:54.689 OmnikSolar: Worker thread started. 2024-02-25 16:25:54.689 Status: OmnikSolar: Entering work loop. 2024-02-25 16:25:54.689 Status: OmnikSolar: Started. 2024-02-25 16:25:55.877 OmnikSolar: onStart called 2024-02-25 16:25:55.877 OmnikSolar: Debug logging mask set to: PYTHON PLUGIN IMAGE DEVICE CONNECTION 2024-02-25 16:25:55.877 OmnikSolar: 'HardwareID':'22' 2024-02-25 16:25:55.878 OmnikSolar: 'HomeFolder':'/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/' 2024-02-25 16:25:55.878 OmnikSolar: 'StartupFolder':'/home/pi/domoticz/' 2024-02-25 16:25:55.878 OmnikSolar: 'UserDataFolder':'/home/pi/domoticz/' 2024-02-25 16:25:55.878 OmnikSolar: 'Database':'/home/pi/domoticz/domoticz.db' 2024-02-25 16:25:55.878 OmnikSolar: 'Language':'en' 2024-02-25 16:25:55.878 OmnikSolar: 'Version':'2.0.0' 2024-02-25 16:25:55.878 OmnikSolar: 'Author':'sincze' 2024-02-25 16:25:55.878 OmnikSolar: 'Name':'OmnikSolar' 2024-02-25 16:25:55.878 OmnikSolar: 'Address':'192.168.2.25' 2024-02-25 16:25:55.878 OmnikSolar: 'Port':'0' 2024-02-25 16:25:55.878 OmnikSolar: 'Key':'OmnikLocalWeb2' 2024-02-25 16:25:55.878 OmnikSolar: 'Mode1':'http' 2024-02-25 16:25:55.878 OmnikSolar: 'Mode2':'2' 2024-02-25 16:25:55.878 OmnikSolar: 'Mode6':'62' 2024-02-25 16:25:55.878 OmnikSolar: 'DomoticzVersion':'2024.4' 2024-02-25 16:25:55.878 OmnikSolar: 'DomoticzHash':'73xxxxxxxx' 2024-02-25 16:25:55.878 OmnikSolar: 'DomoticzBuildTime':'2024-01-30 09:16:34' 2024-02-25 16:25:55.878 OmnikSolar: Device count: 0 2024-02-25 16:25:55.878 OmnikSolar: Plugin started 2024-02-25 16:25:55.878 (OmnikSolar) Creating images from file '/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/Omnik.zip'. 2024-02-25 16:25:55.904 OmnikSolar: Local context: 2024-02-25 16:25:55.904 OmnikSolar: ----> 'Devices' '{}' 2024-02-25 16:25:55.904 OmnikSolar: ----> 'Domoticz' '<module 'Domoticz' (built-in)>' 2024-02-25 16:25:55.904 OmnikSolar: ----> 'Images' '{'GasSens': <Domoticz.Image object at 0x631d15e0>}' 2024-02-25 16:25:55.904 OmnikSolar: ----> 'Parameters' '{'HardwareID': 22, 'HomeFolder': '/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/', 'StartupFolder': '/home/pi/domoticz/', 'UserDataFolder': '/home/pi/domoticz/', 'WebRoot': '', 'Database': '/home/pi/domoticz/domoticz.db', 'Language': 'en', 'Version': '2.0.0', 'Author': 'sincze', 'Name': 'OmnikSolar', 'Address': '192.168.2.25', 'Port': '0', 'SerialPort': '', 'Username': '', 'Password': '', 'Key': 'OmnikLocalWeb2', 'Mode1': 'http', 'Mode2': '2', 'Mode3': '', 'Mode4': '', 'Mode5': '', 'Mode6': '62', 'DomoticzVersion': '2024.4', 'DomoticzHash': '731719420', 'DomoticzBuildTime': '2024-01-30 09:16:34'}' 2024-02-25 16:25:55.904 OmnikSolar: ----> 'Settings' '{'DB_Version': '167', 'Title': 'Domoticz', ' 2024-02-25 16:25:55.905 OmnikSolar: ----> '_plugin' '<plugin.BasePlugin object at 0x64ab1f30>' 2024-02-25 16:25:55.905 OmnikSolar: ----> 'local' 'False' 2024-02-25 16:25:55.905 OmnikSolar: ----> 're' '<module 're' from '/usr/lib/python3.7/re.py'>' 2024-02-25 16:25:55.905 OmnikSolar: ----> 'requests' '<module 'requests' from '/usr/lib/python3/dist-packages/requests/init.py'>' 2024-02-25 16:25:55.905 OmnikSolar: ----> 'threading' '<module 'threading' from '/usr/lib/python3.7/threading.py'>' 2024-02-25 16:25:55.875 Status: OmnikSolar: Initialized version 2.0.0, author 'sincze' 2024-02-25 16:25:55.901 Error: OmnikSolar: Call to function 'onStart' failed, exception details: 2024-02-25 16:25:55.903 Error: OmnikSolar: Traceback (most recent call last): 2024-02-25 16:25:55.903 Error: OmnikSolar: File "/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/plugin.py", line 217, in onStart 2024-02-25 16:25:55.903 Error: OmnikSolar: _plugin.onStart() 2024-02-25 16:25:55.903 Error: OmnikSolar: File "/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/plugin.py", line 116, in onStart 2024-02-25 16:25:55.904 Error: OmnikSolar: createDevices() 2024-02-25 16:25:55.904 Error: OmnikSolar: File "/home/pi/domoticz/plugins/Domoticz-Omnik-Local-Web-Plugin/plugin.py", line 280, in createDevices 2024-02-25 16:25:55.904 Error: OmnikSolar: image = Images["Omnik"].ID # Get id from database 2024-02-25 16:25:55.904 Error: OmnikSolar: KeyError: 'Omnik'

2024-02-25 16:26:04.071 OmnikSolar: onHeartbeat called, run again in 5 heartbeats. 2024-02-25 16:26:14.088 OmnikSolar: onHeartbeat called, run again in 4 heartbeats.

HobbyKonijn commented 6 months ago

Issue solved:

Is a possibility available or workaround to restore old inverter data?

Update: Disabled Omnik from hardware tab Removed Omnik devices from devices tab Removed created images from Custom Icons tab Restored backup Enable new hardware for 5 minutes Enabled Omnik in hardware tab and new device created by plugin and old data is shown again. Sometimes receiving time out to read data as also occuring last year. This can be solved by:

sincze commented 6 months ago

Ok, nicely done.