ekul135 / Powerwall2PVOutput

Send Tesla Powerwall data to PVOutput
24 stars 5 forks source link

[ERROR] object of type 'bool' has no len() #10

Open rnnall opened 6 years ago

rnnall commented 6 years ago

Hello,

I am struggling with the below error trying to run from cron. I am out of practice with Linux commands and cold use some help. I get the following error when trying to run PW_PVOExport.py from cron. I have tried to ran as local user and root. I am able to run form command line python PW_PVOExport.py and have successful uploaded PW2EG. I am running this form a NetGear ReadyNAS system.

Version PowerWall 1.17.2 Python 2.7.9 (default, Aug 13 2016, 17:33:18) [GCC 4.9.2] Linux 4.4.116.armada.1

Changes PW_Helper.py Disable the HTTPS to HTTP From https://'+PowerwallIP+'/api/meters/aggregates to http://'+PowerwallIP+'/api/meters/aggregates as my Powerwall does not answer to HTTPS

ERROR

2018-08-05 14:04:02,232 - Start PVOutput export
2018-08-05 14:04:03,328 - get_sqlite_data: no such table: View_pw
2018-08-05 14:04:03,455 - [ERROR] object of type 'bool' has no len()
2018-08-05 14:04:03,460 - delete_sqlite_data: no such table: pw
2018-08-05 14:04:03,489 - End PVOutput export

crontab configuraiton

* * * * * /usr/bin/python /home/user/path/PW_PVOExport.py >/home/user/path/err.log 2>&1

Noticed that the directory above /home/user/path/ two additional files get created pvo.log & pw.sqlite the Working Directory has these files and being populated with data as I see the pw.sqlite being populated .

Additional Files

.
├── [4.0K]  Powerwall2PVOutput (Working Directory)
├── [9.4K]  pvo.log
├── [4.0K]  pw.sqlite

Working Directory

.
├── [4.0K]  Powerwall2PVOutput
│   ├── [4.0K]  BAK
│   │   ├── [ 311]  PW_Config.py
│   │   ├── [1.1K]  PW_Datalogger.py
│   │   ├── [5.4K]  PW_Helper.py
│   │   ├── [2.2K]  PW_PVOExport.py
│   │   └── [3.0K]  PW_Simple.py
│   ├── [9.4K]  err.log
│   ├── [ 60K]  ExtendedData7_8.png
│   ├── [ 95K]  ExtendedData9_12.png
│   ├── [ 22K]  pvo.log
│   ├── [ 311]  PW_Config.py
│   ├── [ 432]  PW_Config.pyc
│   ├── [1.1K]  PW_Datalogger.py
│   ├── [5.4K]  PW_Helper.py
│   ├── [6.3K]  PW_Helper.pyc
│   ├── [2.3K]  PW_PVOExport.py
│   ├── [3.0K]  PW_Simple.py
│   ├── [859K]  pw.sqlite
│   ├── [4.0K]  pyc
│   │   ├── [ 439]  PW_Config.pyc
│   │   └── [6.4K]  PW_Helper.pyc
│   └── [1.4K]  README.md

Thanks,

RN

ekul135 commented 6 years ago

Do you have the correct path to the sqlite file? Also did you download the sqlite file? Error suggests your sqlite db does not have the appropriate table.

On Mon, Aug 6, 2018 at 7:25 AM rnnall notifications@github.com wrote:

Hello,

I am struggling with the below error trying to run from the cron. I am out of practice with Linux commands and cold use some help. I get the following error when trying to run PW_PVOExport.py from cron. Ran as local user and root. PowerWall version 1.17.2. I had to disable the HTTPS to HTTP From https://'+PowerwallIP+'/api/meters/aggregates to http:// '+PowerwallIP+'/api/meters/aggregates as my system does not answer to HTTPS I am able to run form command line python PW_PVOExport.py and have successful uploads.

ERROR

2018-08-05 14:04:02,232 - Start PVOutput export 2018-08-05 14:04:03,328 - get_sqlite_data: no such table: View_pw 2018-08-05 14:04:03,455 - [ERROR] object of type 'bool' has no len() 2018-08-05 14:04:03,460 - delete_sqlite_data: no such table: pw 2018-08-05 14:04:03,489 - End PVOutput export

crontab configuraiton

          • /usr/bin/python /home/user/path/PW_PVOExport.py >/home/user/path/err.log 2>&1

Noticed that the directory above /home/user/path/ two files get crated

. ├── Powerwall2PVOutput ├── pvo.log ├── pw.sqlite

Working Directory

. ├── err.log ├── ExtendedData7_8.png ├── ExtendedData9_12.png ├── pvo.log ├── PW_Config.py ├── PW_Config.pyc ├── PW_Datalogger.py ├── PW_Helper.py ├── PW_Helper.pyc ├── PW_PVOExport.py ├── PW_Simple.py ├── pw.sqlite ├── pyc │ ├── PW_Config.pyc │ └── PW_Helper.pyc └── README.md

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ekul135/Powerwall2PVOutput/issues/10, or mute the thread https://github.com/notifications/unsubscribe-auth/AATId6ZTi0sJ3ihtlVoQWZCGQpak5KuPks5uN2LJgaJpZM4VviqZ .

rnnall commented 6 years ago

Doh!

Thank you for the quick repose you pointed me into the right direction. Turns out I need to include the absolute path in the PW_Config.py

Changed from:

log_file = "pvo.log"
sqlite_file = "pw.sqlite"

TO:

log_file = "/home/user/path/pvo.log"
sqlite_file = "/home/user/path/pw.sqlite"
blokl commented 6 years ago

Hello Ekul,

I will change the config file and see is it stay’s away.

Thx,

Leo

Van: rnnall notifications@github.com Verzonden: maandag 6 augustus 2018 06:00 Aan: ekul135/Powerwall2PVOutput Powerwall2PVOutput@noreply.github.com CC: Subscribed subscribed@noreply.github.com Onderwerp: Re: [ekul135/Powerwall2PVOutput] [ERROR] object of type 'bool' has no len() (#10)

Doh!

Thank you for the quick repose you pointed me into the right direction. Turns out I need to include the absolute path in the PW_Config.py

Changed from:

log_file = "pvo.log"

sqlite_file = "pw.sqlite"

TO:

log_file = "/home/user/path/pvo.log"

sqlite_file = "/home/user/path/pw.sqlite"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ekul135/Powerwall2PVOutput/issues/10#issuecomment-410582373, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AkBhT042QNqOfQGfLgZUm-xLoB_c1k0tks5uN78ygaJpZM4VviqZ.