Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Plugin doesn't work when entering power station id #10

Open
JanJaapKo opened this issue Mar 15, 2020 · 28 comments
Open

Plugin doesn't work when entering power station id #10

JanJaapKo opened this issue Mar 15, 2020 · 28 comments

Comments

@JanJaapKo
Copy link

JanJaapKo commented Mar 15, 2020

Describe the bug
When entering the optional power station ID in the Plugin config an error occurs:
2020-03-15 20:53:37.559 Error: (Zonnepanelen) 'onMessage' failed 'AttributeError':''str' object has no attribute 'id''. 2020-03-15 20:53:37.559 Error: (Zonnepanelen) ----> Line 368 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage 2020-03-15 20:53:37.559 Error: (Zonnepanelen) ----> Line 192 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage 2020-03-15 20:53:37.559 Error: (Zonnepanelen) ----> Line 287 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function stationDataRequest

To Reproduce
Steps to reproduce the behavior:
add optional powerstation id and update plugin

Expected behavior
no error

Screenshots
If applicable, add screenshots to help explain your problem.

Domoticz environment (please complete the following information):

  • Domoticz Version: lastest dev
  • Python Version: 3.7
  • plugin version 1.2.2
@JanJaapKo
Copy link
Author

solution added to PR #9

@dentinox
Copy link

Describe the bug
When entering the optional power station ID in the Plugin config an error occurs:
2020-03-15 20:53:37.559 Error: (Zonnepanelen) 'onMessage' failed 'AttributeError':''str' object has no attribute 'id''. 2020-03-15 20:53:37.559 Error: (Zonnepanelen) ----> Line 368 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage 2020-03-15 20:53:37.559 Error: (Zonnepanelen) ----> Line 192 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage 2020-03-15 20:53:37.559 Error: (Zonnepanelen) ----> Line 287 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function stationDataRequest

To Reproduce
Steps to reproduce the behavior:
add optional powerstation id and update plugin

Expected behavior
no error

Screenshots
If applicable, add screenshots to help explain your problem.

Domoticz environment (please complete the following information):

  • Domoticz Version: lastest dev
  • Python Version: 3.7
  • plugin version 1.2.2

Forgot to log. Sorry. When disabling the station ID this is the error log. Only one inverter shows up.
I myself have 4 inverters. (None are showing up in devices)

2020-03-16 21:49:13.402 Status: (Zonnepanelen) Initialized version 1.2.1, author 'dylian94' 2020-03-16 21:49:15.166 Error: (Zonnepanelen) GoodWe SEMS API returned a Server Error. 2020-03-16 21:49:48.239 (Zonnepanelen) onStop - Plugin is stopping. 2020-03-16 21:49:48.142 Status: (Zonnepanelen) Stop directive received. 2020-03-16 21:49:48.143 Status: (Zonnepanelen) Exiting work loop. 2020-03-16 21:49:48.343 Status: (Zonnepanelen) Stopping threads. 2020-03-16 21:49:48.343 Status: (Zonnepanelen) Stopped. 2020-03-16 21:49:48.343 Status: (Zonnepanelen) Started. 2020-03-16 21:49:48.555 Status: (Zonnepanelen) Entering work loop. 2020-03-16 21:49:48.556 Status: (Zonnepanelen) Initialized version 1.2.1, author 'dylian94' 2020-03-16 21:49:49.877 (Zonnepanelen) PowerStation found: 44e9c3b5-8191-4fdc-87e7-9cfb23c2aa73 2020-03-16 21:49:49.878 (Zonnepanelen) PowerStation found: 03c6e13d-e5b7-40cb-b248-bce1ed79c9e8 2020-03-16 21:49:49.878 (Zonnepanelen) PowerStation found: e2d4aa7d-be7d-4bc0-b0e0-c3f2118d95d2 2020-03-16 21:49:49.878 (Zonnepanelen) PowerStation found: 6d9c4d93-6e07-4765-87cb-acab5bed2cd4 2020-03-16 21:49:49.878 (Zonnepanelen) PowerStation found: 3b2bf4d0-b9e6-4a3f-b2f5-0c46169f5b0a 2020-03-16 21:49:49.879 (Zonnepanelen) PowerStation found: ace66744-d50d-4cd0-8656-4fd21278f733 2020-03-16 21:49:49.879 Error: (Zonnepanelen) 'onMessage' failed 'TypeError':'can only concatenate str (not "NoneType") to str'. 2020-03-16 21:49:49.879 Error: (Zonnepanelen) ----> Line 317 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py' 2020-03-16 21:49:49.879 Error: (Zonnepanelen) ----> Line 185 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py' 2020-03-16 21:49:49.879 Error: (Zonnepanelen) ----> Line 234 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py' 2020-03-16 21:49:49.879 Error: (Zonnepanelen) ----> Line 174 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py' 2020-03-16 21:49:49.879 Error: (Zonnepanelen) ----> Line 73 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py' 2020-03-16 21:49:56.949 Status: (Zonnepanelen) Stop directive received. 2020-03-16 21:49:56.949 Status: (Zonnepanelen) Exiting work loop. 2020-03-16 21:49:57.046 (Zonnepanelen) onStop - Plugin is stopping. 2020-03-16 21:49:57.124 (Zonnepanelen) requeuing 'onHeartbeatCallback' message for 'Zonnepanelen' 2020-03-16 21:49:57.149 Status: (Zonnepanelen) Stopping threads. 2020-03-16 21:49:57.149 Status: (Zonnepanelen) Stopped. 2020-03-16 21:49:57.150 Status: (Zonnepanelen alle) Started. 2020-03-16 21:49:57.405 Status: (Zonnepanelen alle) Entering work loop. 2020-03-16 21:49:57.406 Status: (Zonnepanelen alle) Initialized version 1.2.1, author 'dylian94' 2020-03-16 21:49:57.406 Error: (Zonnepanelen) 'onConnect' failed 'AttributeError':''str' object has no attribute 'id''. 2020-03-16 21:49:57.407 Error: (Zonnepanelen) ----> Line 312 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py' 2020-03-16 21:49:57.407 Error: (Zonnepanelen) ----> Line 152 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py' 2020-03-16 21:49:57.407 Error: (Zonnepanelen) ----> Line 130 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py' 2020-03-16 21:49:57.407 Error: (Zonnepanelen) ----> Line 280 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py' 2020-03-16 21:49:58.776 (Zonnepanelen alle) PowerStation found: 44e9c3b5-8191-4fdc-87e7-9cfb23c2aa73 2020-03-16 21:49:58.776 (Zonnepanelen alle) PowerStation found: 03c6e13d-e5b7-40cb-b248-bce1ed79c9e8 2020-03-16 21:49:58.777 (Zonnepanelen alle) PowerStation found: e2d4aa7d-be7d-4bc0-b0e0-c3f2118d95d2 2020-03-16 21:49:58.777 (Zonnepanelen alle) PowerStation found: 6d9c4d93-6e07-4765-87cb-acab5bed2cd4 2020-03-16 21:49:58.777 (Zonnepanelen alle) PowerStation found: 3b2bf4d0-b9e6-4a3f-b2f5-0c46169f5b0a 2020-03-16 21:49:58.777 (Zonnepanelen alle) PowerStation found: ace66744-d50d-4cd0-8656-4fd21278f733 2020-03-16 21:49:58.778 Error: (Zonnepanelen alle) 'onMessage' failed 'TypeError':'can only concatenate str (not "NoneType") to str'. 2020-03-16 21:49:58.778 Error: (Zonnepanelen alle) ----> Line 317 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py' 2020-03-16 21:49:58.778 Error: (Zonnepanelen alle) ----> Line 185 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py' 2020-03-16 21:49:58.778 Error: (Zonnepanelen alle) ----> Line 234 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py' 2020-03-16 21:49:58.778 Error: (Zonnepanelen alle) ----> Line 174 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py' 2020-03-16 21:49:58.778 Error: (Zonnepanelen alle) ----> Line 73 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py'

@JanJaapKo
Copy link
Author

Hi @dentinox ,

From the log it is not clear:

  • did you pull the latest version? log sais 1.2.1 (please reboot pi or restart Domoticz so it will reload the plugin and show up to date version)
  • did you enable debug logging? I need the contents of the API data to see where the data is processed wrongly.

@dentinox
Copy link

dentinox commented Mar 17, 2020

Started fresh again. See log. And yes. I have done a git pull : ). Restart the services. Nothing. Powered down the pi. Still not showing up to date version.

2020-03-17 22:14:17.622 Status: Domoticz V4.10717 (c)2012-2019 GizMoCuz
2020-03-17 22:14:17.630 Status: Build Hash: b38b49e5, Date: 2019-05-09 12:04:08
2020-03-17 22:14:17.630 Status: Startup Path: /home/pi/domoticz/
2020-03-17 22:14:18.111 Status: PluginSystem: Started, Python version '3.7.3'.
2020-03-17 22:14:18.125 Active notification Subsystems: gcm, http (2/13)
2020-03-17 22:14:18.151 Status: WebServer(HTTP) started on address: :: with port 8080
2020-03-17 22:14:18.172 Status: WebServer(SSL) started on address: :: with port 443
2020-03-17 22:14:18.239 Starting shared server on: :::6144
2020-03-17 22:14:18.240 Status: TCPServer: shared server started...
2020-03-17 22:14:18.241 Status: RxQueue: queue worker started...
2020-03-17 22:14:20.241 Status: (Zonnepanelen) Started.
2020-03-17 22:14:20.242 Status: EventSystem: reset all events...
2020-03-17 22:14:20.248 Status: EventSystem: reset all device statuses...
2020-03-17 22:14:20.322 Status: PluginSystem: Entering work loop.
2020-03-17 22:14:20.381 Status: Python EventSystem: Initalizing event module.
2020-03-17 22:14:20.382 Status: EventSystem: Started
2020-03-17 22:14:20.382 Status: EventSystem: Queue thread started...
2020-03-17 22:14:20.664 Status: (Zonnepanelen) Entering work loop.
2020-03-17 22:14:20.666 Status: (Zonnepanelen) Initialized version 1.2.1, author 'dylian94'
2020-03-17 22:14:21.084 Error: (Zonnepanelen) 'onMessage' failed 'AttributeError':''str' object has no attribute 'id''.
2020-03-17 22:14:21.084 Error: (Zonnepanelen) ----> Line 317 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py'
2020-03-17 22:14:21.084 Error: (Zonnepanelen) ----> Line 174 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py'
2020-03-17 22:14:21.084 Error: (Zonnepanelen) ----> Line 280 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py'
2020-03-17 22:15:34.656 Status: (Zonnepanelen) Stop directive received.
2020-03-17 22:15:34.657 Status: (Zonnepanelen) Exiting work loop.
2020-03-17 22:15:34.665 (Zonnepanelen) onStop - Plugin is stopping.
2020-03-17 22:15:34.757 Status: (Zonnepanelen) Stopping threads.
2020-03-17 22:15:34.757 Status: (Zonnepanelen) Stopped.
2020-03-17 22:15:34.758 Status: (Zonnepanelen) Started.
2020-03-17 22:15:34.976 Status: (Zonnepanelen) Entering work loop.
2020-03-17 22:15:34.978 Status: (Zonnepanelen) Initialized version 1.2.1, author 'dylian94'
2020-03-17 22:15:35.186 Error: (Zonnepanelen) 'onMessage' failed 'AttributeError':''str' object has no attribute 'id''.
2020-03-17 22:15:35.186 Error: (Zonnepanelen) ----> Line 317 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py'
2020-03-17 22:15:35.186 Error: (Zonnepanelen) ----> Line 174 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py'
2020-03-17 22:15:35.186 Error: (Zonnepanelen) ----> Line 280 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py'

@JanJaapKo
Copy link
Author

JanJaapKo commented Mar 18, 2020

Hi @dentinox ,

2 things:
first you do not have debug logging switched on, in debug a lot more info is dumped, oa the API data. I really need that to fix anything.

Secondly, from the line numbers of the errors I also see you do not have the latest version. Please check the following:
cd domoticz/plugins/domoticz-GoodWeSEMS
git status

This should return oa:
on branch addExceptions
Your branch is up to date with

to be 100% sure, you pull using:
git pull https://github.com/JanJaapKo/domoticz-GoodWeSEMS

likely some Git thing. I'm not really a Git expert......

@dentinox
Copy link

pi@raspberrypi:~/domoticz/plugins/domoticz-GoodWeSEMS $ git status
warning: could not open directory 'pycache/': Permission denied
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

    modified:   GoodWe.py

no changes added to commit (use "git add" and/or "git commit -a")

Is this right?

@JanJaapKo
Copy link
Author

Again, I'm no Git expert, but:
No this is not good, looks like your 'plugin.py' is part of another branch (it does not give a delta to master)

did you use?
git pull https://github.com/JanJaapKo/domoticz-GoodWeSEMS

@dentinox
Copy link

yes.
Let me tell you what I did.

Freshly installed raspian buster lite.
curl -L https://install.domoticz.com | bash
sudo apt install python3
sudo apt-get update
sudo apt-get install git
sudo systemctl restart domoticz.service

Same issue.

I then reinstalled everything again. But then the plugin didn't show up in the hardware list. After installing pp-manager I can see it. That is the set up I am running now.
I can start over and follow your installation instructions if needed.

Also : I tried to git pull dylian94 and JanjaapKo on freshly installed SD's. Same issue.

@JanJaapKo
Copy link
Author

Hi,

Installing the plugin via the PP-manager I never tried. Can not guarantee that that will work. How I did it, on clean system:
cd domoticz/plugins
git clone https://github.com/dylian94/domoticz-GoodWeSEMS.git
git pull https://github.com/JanJaapKo/domoticz-GoodWeSEMS

I do not know what the pp-manager does so if you can try again without that?

@dentinox
Copy link

Did a complete new install

GoodWeSEMS not appearing in Hardware

  • sudo apt install python3
  • sudo apt install python3-dev

GoodWeSEMS appears in hardware. But no devices

Status
Error
Filter:
X
2020-03-20 14:14:10.469 Sunrise: 05:33:00 SunSet: 17:46:00
2020-03-20 14:14:10.469 Day length: 12:13:00 Sun at south: 11:40:00
2020-03-20 14:14:10.469 Civil twilight start: 04:59:00 Civil twilight end: 18:20:00
2020-03-20 14:14:10.469 Nautical twilight start: 04:18:00 Nautical twilight end: 19:01:00
2020-03-20 14:14:10.469 Astronomical twilight start: 03:35:00 Astronomical twilight end: 19:44:00
2020-03-20 14:14:10.782 Active notification Subsystems: (0/13)
2020-03-20 14:14:10.837 Starting shared server on: :::6144
2020-03-20 14:14:10.294 Status: Domoticz V4.10717 (c)2012-2019 GizMoCuz
2020-03-20 14:14:10.302 Status: Build Hash: b38b49e5, Date: 2019-05-09 12:04:08
2020-03-20 14:14:10.302 Status: Startup Path: /home/pi/domoticz/
2020-03-20 14:14:10.766 Status: PluginSystem: Started, Python version '3.4.4'.
2020-03-20 14:14:10.809 Status: WebServer(HTTP) started on address: :: with port 8080
2020-03-20 14:14:10.831 Status: WebServer(SSL) started on address: :: with port 443
2020-03-20 14:14:10.839 Status: RxQueue: queue worker started...
2020-03-20 14:14:10.838 Status: TCPServer: shared server started...
2020-03-20 14:14:12.840 Status: EventSystem: reset all events...
2020-03-20 14:14:12.844 Status: EventSystem: reset all device statuses...
2020-03-20 14:14:12.985 Status: PluginSystem: Entering work loop.
2020-03-20 14:14:12.993 Status: Python EventSystem: Initalizing event module.
2020-03-20 14:14:12.993 Status: EventSystem: Started
2020-03-20 14:14:12.994 Status: EventSystem: Queue thread started...
2020-03-20 14:15:03.732 Status: (Zonnepanelen) Started.
2020-03-20 14:15:04.070 Status: (Zonnepanelen) Entering work loop.
2020-03-20 14:15:04.071 Status: (Zonnepanelen) Initialized version 1.2.1, author 'dylian94'
2020-03-20 14:15:04.497 Error: (Zonnepanelen) 'onMessage' failed 'AttributeError':''str' object has no attribute 'id''.
2020-03-20 14:15:04.497 Error: (Zonnepanelen) ----> Line 317 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-20 14:15:04.497 Error: (Zonnepanelen) ----> Line 174 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-20 14:15:04.497 Error: (Zonnepanelen) ----> Line 280 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function stationDataRequest
2020-03-20 14:20:41.043 Active notification Subsystems: (0/13)
2020-03-20 14:20:55.066 (Zonnepanelen) onStop - Plugin is stopping.
2020-03-20 14:20:55.338 (Zonnepanelen) Debug logging mask set to: PYTHON
2020-03-20 14:20:55.338 (Zonnepanelen) 'UserDataFolder':'/home/pi/domoticz/'
2020-03-20 14:20:55.338 (Zonnepanelen) 'Port':'443'
2020-03-20 14:20:55.338 (Zonnepanelen) 'Language':'en'
2020-03-20 14:20:55.338 (Zonnepanelen) 'Mode6':'Debug'
2020-03-20 14:20:55.338 (Zonnepanelen) 'DomoticzHash':'b38b49e5'
2020-03-20 14:20:55.338 (Zonnepanelen) 'Version':'1.2.1'
2020-03-20 14:20:55.338 (Zonnepanelen) 'Mode1':'858f9c60-ba99-471f-851f-df52895bc931'
2020-03-20 14:20:55.338 (Zonnepanelen) 'Address':'eu.semsportal.com'
2020-03-20 14:20:55.338 (Zonnepanelen) 'Key':'GoodWeSEMS'
2020-03-20 14:20:55.339 (Zonnepanelen) 'Author':'dylian94'
2020-03-20 14:20:55.339 (Zonnepanelen) 'Mode2':'30'
2020-03-20 14:20:55.339 (Zonnepanelen) 'Name':'Zonnepanelen'
2020-03-20 14:20:55.339 (Zonnepanelen) 'Password':''
2020-03-20 14:20:55.339 (Zonnepanelen) 'DomoticzVersion':'4.10717'
2020-03-20 14:20:55.339 (Zonnepanelen) 'HomeFolder':'/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/'
2020-03-20 14:20:55.339 (Zonnepanelen) 'HardwareID':'2'
2020-03-20 14:20:55.339 (Zonnepanelen) 'Database':'/home/pi/domoticz/domoticz.db'
2020-03-20 14:20:55.339 (Zonnepanelen) 'Username':''
2020-03-20 14:20:55.339 (Zonnepanelen) 'DomoticzBuildTime':'2019-05-09 12:04:08'
2020-03-20 14:20:55.339 (Zonnepanelen) 'StartupFolder':'/home/pi/domoticz/'
2020-03-20 14:20:55.339 (Zonnepanelen) Device count: 0
2020-03-20 14:20:55.515 (Zonnepanelen) Connected to SEMS portal API successfully.
2020-03-20 14:20:55.516 (Zonnepanelen) build tokenRequest with UN: '
', pwd: '
'
2020-03-20 14:20:55.516 (Zonnepanelen) build apiRequestHeaders with token: '{"token": "", "timestamp": 0, "version": "", "uid": "", "client": "web", "language": "en-GB"}'
2020-03-20 14:20:55.516 CConnection_send, send request from 'Zonnepanelen' ignored. Plugin is stopping.
2020-03-20 14:20:55.567 (Zonnepanelen) onDisconnect called for connection to: eu.semsportal.com:443
2020-03-20 14:20:55.567 (Zonnepanelen) onStop - Plugin is stopping.
2020-03-20 14:20:55.829 (Zonnepanelen) Debug logging mask set to: PYTHON
2020-03-20 14:20:55.829 (Zonnepanelen) 'UserDataFolder':'/home/pi/domoticz/'
2020-03-20 14:20:55.829 (Zonnepanelen) 'Port':'443'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Language':'en'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Mode6':'Debug'
2020-03-20 14:20:55.830 (Zonnepanelen) 'DomoticzHash':'b38b49e5'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Version':'1.2.1'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Mode1':'858f9c60-ba99-471f-851f-df52895bc931'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Address':'eu.semsportal.com'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Key':'GoodWeSEMS'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Author':'dylian94'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Mode2':'30'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Name':'Zonnepanelen'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Password':'
'
2020-03-20 14:20:55.830 (Zonnepanelen) 'DomoticzVersion':'4.10717'
2020-03-20 14:20:55.830 (Zonnepanelen) 'HomeFolder':'/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/'
2020-03-20 14:20:55.830 (Zonnepanelen) 'HardwareID':'2'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Database':'/home/pi/domoticz/domoticz.db'
2020-03-20 14:20:55.830 (Zonnepanelen) 'Username':'********'
2020-03-20 14:20:55.830 (Zonnepanelen) 'DomoticzBuildTime':'2019-05-09 12:04:08'
2020-03-20 14:20:55.830 (Zonnepanelen) 'StartupFolder':'/home/pi/domoticz/'
2020-03-20 14:20:55.830 (Zonnepanelen) Device count: 0
2020-03-20 14:20:55.999 (Zonnepanelen) Connected to SEMS portal API successfully.
2020-03-20 14:20:55.032 Status: (Zonnepanelen) Stop directive received.
2020-03-20 14:20:55.033 Status: (Zonnepanelen) Exiting work loop.
2020-03-20 14:20:55.133 Status: (Zonnepanelen) Stopping threads.
2020-03-20 14:20:55.133 Status: (Zonnepanelen) Stopped.
2020-03-20 14:20:55.133 Status: (Zonnepanelen) Started.
2020-03-20 14:20:55.333 Status: (Zonnepanelen) Entering work loop.
2020-03-20 14:20:55.334 Status: (Zonnepanelen) Initialized version 1.2.1, author 'dylian94'
2020-03-20 14:20:55.513 Status: (Zonnepanelen) Stop directive received.
2020-03-20 14:20:55.513 Status: (Zonnepanelen) Exiting work loop.
2020-03-20 14:20:55.613 Status: (Zonnepanelen) Stopping threads.
2020-03-20 14:20:55.613 Status: (Zonnepanelen) Stopped.
2020-03-20 14:20:55.613 Status: (Zonnepanelen) Started.
2020-03-20 14:20:55.824 Status: (Zonnepanelen) Entering work loop.
2020-03-20 14:20:55.826 Status: (Zonnepanelen) Initialized version 1.2.1, author 'dylian94'
2020-03-20 14:20:55.517 Error: (Zonnepanelen): Async Secure Read Exception: 1, stream truncated
2020-03-20 14:20:56.000 (Zonnepanelen) build tokenRequest with UN: '
', pwd: '***'
2020-03-20 14:20:56.000 (Zonnepanelen) build apiRequestHeaders with token: '{"token": "", "timestamp": 0, "version": "", "uid": "", "client": "web", "language": "en-GB"}'
2020-03-20 14:20:56.101 (Zonnepanelen) message received: CrossLogin
2020-03-20 14:20:56.102 (Zonnepanelen) SEMS API Token: {"token": "22ba117b0af1f908051057cdb5ab5d34", "timestamp": 1584714056038, "version": "", "uid": "35761bf5-112b-4cd5-95d0-6a964d53cd0b", "client": "web", "language": "en-GB"}
2020-03-20 14:20:56.102 (Zonnepanelen) build stationDataRequest with number of stations (len powerStationList) = 1
2020-03-20 14:20:56.102 Error: (Zonnepanelen) 'onMessage' failed 'AttributeError':''str' object has no attribute 'id''.
2020-03-20 14:20:56.102 Error: (Zonnepanelen) ----> Line 317 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-20 14:20:56.102 Error: (Zonnepanelen) ----> Line 174 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-20 14:20:56.102 Error: (Zonnepanelen) ----> Line 280 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function stationDataRequest
2020-03-20 14:21:05.873 (Zonnepanelen) onHeartbeat called, Connection is alive.

@JanJaapKo
Copy link
Author

Hi @dentinox ,

At first glance everything you do seems perfect. But still you are stuck on version 1.2.1 of the plugin which is causing this issue. onMessage is calling stationDataRequest without a valid ID, that part I fixed in 1.2.3......

1 question: before making the fresh install, did you format your SD card? If not, the old information will still be present.

The only thing I can see so far is that you should update Domoticz to beta:

And I'm running Python 3.7.3 but that shouldn't matter

@dentinox
Copy link

dentinox commented Mar 21, 2020

I have tested it on another PI (3). Brand new SD. Exactly the same error message.
I guess there is something wrong with the git.
Can you send me the files you have so I put them on my PI manually.

Here is the update log.
pi@raspberrypi:/domoticz/plugins $ cd domoticz-GoodWeSEMS
pi@raspberrypi:
/domoticz/plugins/domoticz-GoodWeSEMS $ git pull https://github.com/JanJaapKo/domoticz-GoodWeSEMS
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 4 (delta 2), reused 4 (delta 2), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/JanJaapKo/domoticz-GoodWeSEMS

  • branch HEAD -> FETCH_HEAD
    Updating 45c2184..5d958e0
    Fast-forward
    GoodWe.py | 284 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    plugin.py | 212 ++++++++++++++++++++++++----------------------
    2 files changed, 395 insertions(+), 101 deletions(-)
    create mode 100644 GoodWe.py

@JanJaapKo
Copy link
Author

JanJaapKo commented Mar 21, 2020

I fixed it. I had to merge the last changes via a PR on my own fork.... Works like a charm now. On a clean install you can do:
cd domoticz/plugins
git clone https://github.com/janjaapko/domoticz-GoodWeSEMS.git

for an exisiting install
cd domoticz/plugins/domoticz-GoodWeSEMS
git pull https://github.com/JanJaapKo/domoticz-GoodWeSEMS

On a previously pulled 1.2.1 version I now get 1.2.3.........

You're right, it does have something to do with GIT. I tried the same thing in \tmp ad I also get 1.2.1 as plugin version. Really strange: when I use Git desktop to pull the version that is in the PR addException, I doe get version 1.2.3 in Windows........

Please find attached my version (although GIT's idea is to prevent manual file sharing ;) ) I had to rename them to .txt.....

I'll try to figure out what I'm doing wrong with GIt. In the mean whie, please see what happens with this version and your multiple inverters. Given this whole corona situation, it is nice to have a hobby like this ;)

plugin.txt
GoodWe.txt

@dentinox
Copy link

That's it. Running 1.2.3 now.

It finds the complete families inverters. I cut these out of the log due all of the address information.
All my inverters are found. But nothing showing up under devices.

2020-03-21 16:10:46.982 (Zonnepanelen) inverter created: 'Inverter type: 'Huis 12x' with serial number: '93000SSN17BW1990''
2020-03-21 16:10:46.982 (Zonnepanelen) inverter created: 'Inverter type: 'Sauna' with serial number: '92000SSN17CW0025''
2020-03-21 16:10:46.983 (Zonnepanelen) inverter created: 'Inverter type: 'Afdak' with serial number: '94200DSN181W0693''
2020-03-21 16:10:46.983 (Zonnepanelen) inverter created: 'Inverter type: 'Loods panelen' with serial number: '54200DSN198W0056''
2020-03-21 16:10:46.983 (Zonnepanelen) PowerStation found: 858f9c60-ba99-471f-851f-df52895bc931
2020-03-21 16:10:46.983 (Zonnepanelen) Station found: 858f9c60-ba99-471f-851f-df52895bc931
2020-03-21 16:10:46.983 (Zonnepanelen) build stationDataRequest with number of stations (len powerStationList) = 1
2020-03-21 16:10:46.983 Error: (Zonnepanelen) 'onMessage' failed 'KeyError'.
2020-03-21 16:10:46.983 Error: (Zonnepanelen) ----> Line 365 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-21 16:10:46.983 Error: (Zonnepanelen) ----> Line 209 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-21 16:10:46.983 Error: (Zonnepanelen) ----> Line 281 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function stationDataRequest

@JanJaapKo
Copy link
Author

That's good news!

Was this log created with debug logging? I need the input from the API data to fix this. I'll have a look tonight if you can send the logs.

Regards

@dentinox
Copy link

debug log domoticz.txt

2020-03-21 16:37:54.527 Status: Domoticz V4.11799 (c)2012-2020 GizMoCuz
2020-03-21 16:37:54.531 Status: Build Hash: 87bfd914d, Date: 2020-03-19 15:39:50
2020-03-21 16:37:54.532 Status: Startup Path: /home/pi/domoticz/
2020-03-21 16:37:55.034 Status: PluginSystem: Started, Python version '3.7.3'.
2020-03-21 16:37:55.047 Active notification Subsystems: gcm, http (2/13)
2020-03-21 16:37:55.068 Status: WebServer(HTTP) started on address: :: with port 8080
2020-03-21 16:37:55.087 Status: WebServer(SSL) started on address: :: with port 443
2020-03-21 16:37:55.130 Starting shared server on: :::6144
2020-03-21 16:37:55.130 Status: TCPServer: shared server started...
2020-03-21 16:37:55.131 Status: RxQueue: queue worker started...
2020-03-21 16:37:57.132 Status: (Zonnepanelen) Started.
2020-03-21 16:37:57.132 Status: NotificationSystem: thread started...
2020-03-21 16:37:57.138 Status: EventSystem: reset all events...
2020-03-21 16:37:57.143 Status: EventSystem: reset all device statuses...
2020-03-21 16:37:57.207 Status: PluginSystem: Entering work loop.
2020-03-21 16:37:57.276 Status: Python EventSystem: Initalizing event module.
2020-03-21 16:37:57.277 Status: EventSystem: Started
2020-03-21 16:37:57.277 Status: EventSystem: Queue thread started...
2020-03-21 16:37:57.522 Status: (Zonnepanelen) Entering work loop.
2020-03-21 16:37:57.527 Status: (Zonnepanelen) Initialized version 1.2.3, author 'dylian94'
2020-03-21 16:37:57.530 (Zonnepanelen) Debug logging mask set to: PYTHON
2020-03-21 16:37:57.530 (Zonnepanelen) 'HardwareID':'2'
2020-03-21 16:37:57.530 (Zonnepanelen) 'HomeFolder':'/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/'
2020-03-21 16:37:57.530 (Zonnepanelen) 'StartupFolder':'/home/pi/domoticz/'
2020-03-21 16:37:57.531 (Zonnepanelen) 'UserDataFolder':'/home/pi/domoticz/'
2020-03-21 16:37:57.531 (Zonnepanelen) 'Database':'/home/pi/domoticz/domoticz.db'
2020-03-21 16:37:57.531 (Zonnepanelen) 'Language':'en'
2020-03-21 16:37:57.531 (Zonnepanelen) 'Version':'1.2.3'
2020-03-21 16:37:57.531 (Zonnepanelen) 'Author':'dylian94'
2020-03-21 16:37:57.531 (Zonnepanelen) 'Name':'Zonnepanelen'
2020-03-21 16:37:57.531 (Zonnepanelen) 'Address':'eu.semsportal.com'
2020-03-21 16:37:57.531 (Zonnepanelen) 'Port':'443'
2020-03-21 16:37:57.531 (Zonnepanelen) 'Username':''
2020-03-21 16:37:57.531 (Zonnepanelen) 'Password':'
'
2020-03-21 16:37:57.531 (Zonnepanelen) 'Key':'GoodWeSEMS'
2020-03-21 16:37:57.531 (Zonnepanelen) 'Mode1':'858f9c60-ba99-471f-851f-df52895bc931'
2020-03-21 16:37:57.532 (Zonnepanelen) 'Mode2':'30'
2020-03-21 16:37:57.532 (Zonnepanelen) 'Mode6':'Debug'
2020-03-21 16:37:57.532 (Zonnepanelen) 'DomoticzVersion':'4.11799'
2020-03-21 16:37:57.532 (Zonnepanelen) 'DomoticzHash':'87bfd914d'
2020-03-21 16:37:57.532 (Zonnepanelen) 'DomoticzBuildTime':'2020-03-19 15:39:50'
2020-03-21 16:37:57.532 (Zonnepanelen) Device count: 0
2020-03-21 16:37:57.714 (Zonnepanelen) onConnect: Status: '0', Description: 'Success'
2020-03-21 16:37:57.714 (Zonnepanelen) Connected to SEMS portal API successfully.
2020-03-21 16:37:57.714 (Zonnepanelen) startDeviceUpdate, token availability: 'False'
2020-03-21 16:37:57.715 (Zonnepanelen) build tokenRequest with UN: '
', pwd: '*'
2020-03-21 16:37:57.715 (Zonnepanelen) build apiRequestHeaders with token: '{"uid": "", "timestamp": 0, "token": "", "client": "web", "version": "", "language": "en-GB"}'
2020-03-21 16:37:57.967 (Zonnepanelen) message received: CrossLogin
2020-03-21 16:37:57.968 (Zonnepanelen) message apiData: '{'uid': '35761bf5-112b-4cd5-95d0-6a964d53cd0b', 'timestamp': 1584808689420, 'token': 'c51d7d219c607dac6c52e9faa2923d92', 'client': 'web', 'version': '', 'language': 'en-GB'}'
2020-03-21 16:37:57.968 (Zonnepanelen) SEMS API Token: {"uid": "35761bf5-112b-4cd5-95d0-6a964d53cd0b", "timestamp": 1584808689420, "token": "c51d7d219c607dac6c52e9faa2923d92", "client": "web", "version": "", "language": "en-GB"}
2020-03-21 16:37:57.968 (Zonnepanelen) build stationListRequest
2020-03-21 16:37:57.969 (Zonnepanelen) build apiRequestHeaders with token: '{"uid": "35761bf5-112b-4cd5-95d0-6a964d53cd0b", "timestamp": 1584808689420, "token": "c51d7d219c607dac6c52e9faa2923d92", "client": "web", "version": "", "language": "en-GB"}'
2020-03-21 16:37:59.276 (Zonnepanelen) message received: QueryPowerStationByHistory
2020-03-21 16:37:59.279 (Zonnepanelen) message apiData: '{'record': 18, 'list': [{'id': '47cd8045-38e6-496b-8ea8-48aa2ba8f678', 'pw_name': HERE IS ALL FAMILY MEMBER INFO SCRAPED FROM THE PORTAL
2020-03-21 16:37:59.280 (Zonnepanelen) station element: 'id', value: '47cd8045-38e6-496b-8ea8-48aa2ba8f678'
2020-03-21 16:37:59.280 (Zonnepanelen) station element: 'EVERY FAMILY MEMBERS INFO
2020-03-21 16:37:59.293 (Zonnepanelen) station element: 'inverters', value: '[{'sn': '94200DSN183W0480', 'name': None, 'change_num': 0, 'change_type': 0, 'relation_sn': None, 'relation_name': None, 'status': 1}]'
2020-03-21 16:37:59.294 (Zonnepanelen) inverter created: 'Inverter type: 'Huis 12x' with serial number: '93000SSN17BW1990''
2020-03-21 16:37:59.294 (Zonnepanelen) inverter created: 'Inverter type: 'Sauna' with serial number: '92000SSN17CW0025''
2020-03-21 16:37:59.294 (Zonnepanelen) inverter created: 'Inverter type: 'Afdak' with serial number: '94200DSN181W0693''
2020-03-21 16:37:59.295 (Zonnepanelen) inverter created: 'Inverter type: 'Loods panelen' with serial number: '54200DSN198W0056''
2020-03-21 16:37:59.295 (Zonnepanelen) PowerStation found: 858f9c60-ba99-471f-851f-df52895bc931
2020-03-21 16:37:59.295 (Zonnepanelen) Station found: 858f9c60-ba99-471f-851f-df52895bc931
2020-03-21 16:37:59.295 (Zonnepanelen) build stationDataRequest with number of stations (len powerStationList) = 1
2020-03-21 16:37:59.295 Error: (Zonnepanelen) 'onMessage' failed 'KeyError'.
2020-03-21 16:37:59.295 Error: (Zonnepanelen) ----> Line 365 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-21 16:37:59.295 Error: (Zonnepanelen) ----> Line 209 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-21 16:37:59.296 Error: (Zonnepanelen) ----> Line 281 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function stationDataRequest
2020-03-21 16:38:07.565 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-21 16:38:29.162 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-21 16:38:39.185 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-21 16:38:49.157 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-21 16:38:59.180 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-21 16:39:09.201 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-21 16:39:10.906 (Zonnepanelen) onDisconnect called for connection to: eu.semsportal.com:443
2020-03-21 16:39:19.174 (Zonnepanelen) onHeartbeat called, run again in 29 heartbeats.
2020-03-21 16:39:29.196 (Zonnepanelen) onHeartbeat called, run again in 28 heartbeats.
2020-03-21 16:39:39.168 (Zonnepanelen) onHeartbeat called, run again in 27 heartbeats.
2020-03-21 16:39:49.190 (Zonnepanelen) onHeartbeat called, run again in 26 heartbeats.
2020-03-21 16:39:59.212 (Zonnepanelen) onHeartbeat called, run again in 25 heartbeats.
2020-03-21 16:40:09.185 (Zonnepanelen) onHeartbeat called, run again in 24 heartbeats.
2020-03-21 16:40:19.207 (Zonnepanelen) onHeartbeat called, run again in 23 heartbeats.
2020-03-21 16:40:29.179 (Zonnepanelen) onHeartbeat called, run again in 22 heartbeats.
2020-03-21 16:40:39.201 (Zonnepanelen) onHeartbeat called, run again in 21 heartbeats.
2020-03-21 16:40:49.223 (Zonnepanelen) onHeartbeat called, run again in 20 heartbeats.
2020-03-21 16:40:59.197 (Zonnepanelen) onHeartbeat called, run again in 19 heartbeats.
2020-03-21 16:41:09.219 (Zonnepanelen) onHeartbeat called, run again in 18 heartbeats.
2020-03-21 16:41:19.194 (Zonnepanelen) onHeartbeat called, run again in 17 heartbeats.
2020-03-21 16:41:29.216 (Zonnepanelen) onHeartbeat called, run again in 16 heartbeats.

@JanJaapKo
Copy link
Author

Hi,

I looked at your logging and it seems quite fine (apart from the error of coarse...) Some things I find strange:

  • your 'inverters' list logline has a S/N that is not listed in the created list of inverters (the inverters will get devices as soon as we receive data for the inverter. The data request is created in the step that fails). Is that line truncated? Did you remove info there?

Anyhow, I did some modifications, please pull new version and let me know.

@dentinox
Copy link

I removed 12 members of the portal from the log. My serials are the four shown (afdak/sauna/loods/huis)
It does scrape all the members of the portal. All serials are correct, address info etc.
It just doesn't make devices. I removed the station ID and tested it again. No devices are shown and almost the same errors appear.

2020-03-22 21:34:49.447 (Zonnepanelen) inverter created: 'Inverter type: 'Huis 12x' with serial number: '93000SSN17BW1990''
2020-03-22 21:34:49.447 (Zonnepanelen) inverter created: 'Inverter type: 'Sauna' with serial number: '92000SSN17CW0025''
2020-03-22 21:34:49.447 (Zonnepanelen) inverter created: 'Inverter type: 'Afdak' with serial number: '94200DSN181W0693''
2020-03-22 21:34:49.447 (Zonnepanelen) inverter created: 'Inverter type: 'Loods panelen' with serial number: '54200DSN198W0056''
2020-03-22 21:34:49.448 (Zonnepanelen) PowerStation found: 858f9c60-ba99-471f-851f-df52895bc931
2020-03-22 21:34:49.448 (Zonnepanelen) Station found: 858f9c60-ba99-471f-851f-df52895bc931
2020-03-22 21:34:49.448 (Zonnepanelen) build stationDataRequest with number of stations (len powerStationList) = '1' for PS index: '0'
2020-03-22 21:34:49.448 Error: (Zonnepanelen) 'onMessage' failed 'KeyError'.
2020-03-22 21:34:49.448 Error: (Zonnepanelen) ----> Line 365 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-22 21:34:49.448 Error: (Zonnepanelen) ----> Line 209 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-22 21:34:49.448 Error: (Zonnepanelen) ----> Line 282 in (WAS 281 before)
'/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function stationDataRequest
2020-03-22 21:34:58.068 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-22 21:35:08.091 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-22 21:35:18.064 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-22 21:35:28.087 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-22 21:35:38.060 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-22 21:35:48.083 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-22 21:35:49.437 (Zonnepanelen) onDisconnect called for connection to: eu.semsportal.com:443
2020-03-22 21:35:58.107 (Zonnepanelen) onHeartbeat called, run again in 29 heartbeats.
2020-03-22 21:36:08.080 (Zonnepanelen) onHeartbeat called, run again in 28 heartbeats.

new errors

2020-03-22 21:33:14.634 Status: (Zonnepanelen) Initialized version 1.2.4, author 'dylian94'
2020-03-22 21:33:15.889 Error: (Zonnepanelen) 'onMessage' failed 'TypeError':'can only concatenate str (not "NoneType") to str'.
2020-03-22 21:33:15.889 Error: (Zonnepanelen) ----> Line 365 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-22 21:33:15.890 Error: (Zonnepanelen) ----> Line 206 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-22 21:33:15.890 Error: (Zonnepanelen) ----> Line 241 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function createStation
2020-03-22 21:33:15.890 Error: (Zonnepanelen) ----> Line 181 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function init
2020-03-22 21:33:15.890 Error: (Zonnepanelen) ----> Line 76 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function repr
2020-03-22 21:34:47.711 Status: (Zonnepanelen) Stop directive received.

@dentinox
Copy link

dentinox commented Mar 23, 2020

I narrowed the issue down to users with multiple inverters.

If I enter the station ID of my dad (2 inverters) I get the following error

2020-03-23 07:31:26.406 Error: (Zonnepanelen) 'onMessage' failed 'TypeError':'can only concatenate str (not "NoneType") to str'.
2020-03-23 07:31:26.406 Error: (Zonnepanelen) ----> Line 365 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-23 07:31:26.406 Error: (Zonnepanelen) ----> Line 206 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-23 07:31:26.406 Error: (Zonnepanelen) ----> Line 241 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function createStation
2020-03-23 07:31:26.406 Error: (Zonnepanelen) ----> Line 181 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function init
2020-03-23 07:31:26.406 Error: (Zonnepanelen) ----> Line 76 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function repr

If I select my brother with 1 inverter it works fine. I can select the devices and everything shows up.

@JanJaapKo
Copy link
Author

Hi,

Please add complete loggings. I mis too many lines now to do something with it. You can also switch on logging to file which may be easier to capture everything:

sudo systemctl stop domoticz.service
sudo nano /etc/init.d/domoticz.sh
uncomment the line:
DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"
sudo systemctl start domoticz.service

@dentinox
Copy link

I noticed that when I create a Goodwe Guest account for my 4 inverters only it works without issues. Do you still want the log to fix it for the global account issues?

@JanJaapKo
Copy link
Author

Hi,

Apparently you have an interesting account structure, so yes ;)

Can you also add a description of how your account is setup? Since I only have 1 single inverter in my house (powerstation) and 1 house in my account.....

@dentinox
Copy link

I have 12 family member on my portal. All have 1 inverter. I have 4.
When I add the plugin without station ID it scrapes all the data. That is visible in the log.
205 sensors appear in devices. But not all of them are working. It seems that only 1 works.

When I add my station ID you get the error we are talking about.
When I add a station ID from another family member (1 inverter) it works without issues.
When I add no station ID and log in using my guest account (newly created and connected the powerplant) it seems to be working also.

I'll give you a log with my station ID and one with all stations. Keep in mind that it takes some time as I need to remove all address information : )

@JanJaapKo
Copy link
Author

Hi @dentinox I did some modifications and I 'd really like to know if they work for multiple inverters. Please pull using:
git pull https://github.com/JanJaapKo/domoticz-GoodWeSEMS addUnitTest

@CodingEJ
Copy link

CodingEJ commented Apr 2, 2020

Although I'm just having a single inverter (2 MPPT) I tried this code because the normal release did not work for me. I got same result, so decided to do some debugging and found an issue.

The line Domoticz.Debug("inverter created: '" + str(self.inverters[inverter['sn']]) + "'") in GoodWe.py causes a python (3.7.3) error for me.
By modifying this to Domoticz.Debug("inverter created: '" + str(inverter['sn']) + "'") the error is resolved and all works as expected.

@JanJaapKo
Copy link
Author

Hi @CodingEJ ,

Thanks for trying the plugin. Strange that this leads to an error for 2 reasons:

  • I have a single inverter as well, works like a charm
  • on the line below in the code, I also lookup the inverter in the inverters list in the same way ( for the domoticzDevices property).

Can you run the plugin in debug mode so I can get the logging? I need:

  • the exact error
  • the API data because maybe you have a different model (I have a DNS dual MPPT series inverter, likely the same?)?

@CodingEJ
Copy link

CodingEJ commented Apr 2, 2020

Hi JanJaapKo,

It's not so much related to the API data, it's a python error where it does not know how to print the serial number. By replacing the construct by the simpler one you get your desired result and it works.

Error detail:
2020-04-02 22:02:34.994 Error: (GoodWe) 'onMessage' failed 'TypeError':'can only concatenate str (not "NoneType") to str'.
2020-04-02 22:02:34.994 Error: (GoodWe) ----> Line 345 in '.../plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-04-02 22:02:34.994 Error: (GoodWe) ----> Line 186 in '.../plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-04-02 22:02:34.994 Error: (GoodWe) ----> Line 269 in '.../plugins/domoticz-GoodWeSEMS/GoodWe.py', function createStation
2020-04-02 22:02:34.994 Error: (GoodWe) ----> Line 194 in '.../plugins/domoticz-GoodWeSEMS/GoodWe.py', function init
2020-04-02 22:02:34.994 Error: (GoodWe) ----> Line 202 in '.../plugins/domoticz-GoodWeSEMS/GoodWe.py', function createInverters
2020-04-02 22:02:34.994 Error: (GoodWe) ----> Line 84 in '.../plugins/domoticz-GoodWeSEMS/GoodWe.py', function repr

@JanJaapKo
Copy link
Author

@dentinox Is the plugin now working (when you pull latest version from my fork)? If not please add a logfille with all the loglines as I need the API data from GoodWe so I can run some test by entering this info manually.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants