chrishrb / solarlog-exporter Goto Github PK
View Code? Open in Web Editor NEWSolarLog exporter to influxdb
SolarLog exporter to influxdb
Hi, there is no information about the current version of the software on the Solarlog or the model.
Does it also work with software versions 2.X.X ?
I have a similar problem as in #3 but it seems to be with the ftp part. I used the release 0.0.3.
I tested with ftp server and with a local directory, the issue seems to be the same. What can i do do fix this?
solarlog_exporter | DEBUG:urllib3.connectionpool:http://influxdb:8086 "GET /query?q=SELECT+%2A+FROM+solarlog_min+WHERE+system+%3D+%27PV-System%27+ORDER+BY+time+DESC+LIMIT+1%3B&db=solarlog HTTP/1.1" 200 None
solarlog_exporter | WARNING:root:No last record found
solarlog_exporter | DEBUG:root:Starting..
solarlog_exporter | DEBUG:root:Used directory: /
solarlog_exporter | DEBUG:root:Last Record 2023-02-25 12:52:20.456000+00:00
solarlog_exporter | Traceback (most recent call last):
solarlog_exporter | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
solarlog_exporter | return _run_code(code, main_globals, None,
solarlog_exporter | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
solarlog_exporter | exec(code, run_globals)
solarlog_exporter | File "/app/./__main__.py", line 47, in <module>
solarlog_exporter | sys.exit(main())
solarlog_exporter | File "/app/./__main__.py", line 33, in main
solarlog_exporter | start_ftp_import(
solarlog_exporter | File "/app/./solarlog_exporter/core.py", line 89, in start_ftp_import
solarlog_exporter | config_parser.parse_ftp_file(ftp, path + "/base_vars.js")
solarlog_exporter | File "/app/./solarlog_exporter/parser.py", line 33, in parse_ftp_file
solarlog_exporter | ftp.retrlines(f'RETR {ftp_file_path}', string_list.append)
solarlog_exporter | File "/usr/local/lib/python3.8/ftplib.py", line 461, in retrlines
solarlog_exporter | line = fp.readline(self.maxline + 1)
solarlog_exporter | File "/usr/local/lib/python3.8/codecs.py", line 322, in decode
solarlog_exporter | (result, consumed) = self._buffer_decode(data, self.errors, final)
solarlog_exporter | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 1046: invalid start byte
There seem to be some parsing issues with special chars in the base_vars.js:
solarlog-exporter | Traceback (most recent call last): solarlog-exporter | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main solarlog-exporter | return _run_code(code, main_globals, None, solarlog-exporter | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code solarlog-exporter | exec(code, run_globals) solarlog-exporter | File "/app/./__main__.py", line 53, in <module> solarlog-exporter | sys.exit(main()) solarlog-exporter | File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1137, in __call__ solarlog-exporter | return self.main(*args, **kwargs) solarlog-exporter | File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1062, in main solarlog-exporter | rv = self.invoke(ctx) solarlog-exporter | File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke solarlog-exporter | return ctx.invoke(self.callback, **ctx.params) solarlog-exporter | File "/usr/local/lib/python3.8/site-packages/click/core.py", line 763, in invoke solarlog-exporter | return __callback(*args, **kwargs) solarlog-exporter | File "/app/./__main__.py", line 49, in main solarlog-exporter | start_import(directory) solarlog-exporter | File "/app/./solarlog_exporter/core.py", line 25, in start_import solarlog-exporter | config_parser = ConfigParser(path + "/base_vars.js") solarlog-exporter | File "/app/./solarlog_exporter/parser.py", line 39, in __init__ solarlog-exporter | self.parse_file(config_path) solarlog-exporter | File "/app/./solarlog_exporter/parser.py", line 23, in parse_file solarlog-exporter | for line in file: solarlog-exporter | File "/usr/local/lib/python3.8/codecs.py", line 322, in decode solarlog-exporter | (result, consumed) = self._buffer_decode(data, self.errors, final) solarlog-exporter | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 620: invalid start byte solarlog-exporter exited with code 1
This is triggered by e.g. German Umlauts:
WRInfo[0]=new Array("QS3200/Pro","XXXXXXXXX",2760,1,"MV QS3500, Süd",2,null,null,0,null,16,0,1,1000,null)
Changing this to
WRInfo[0]=new Array("QS3200/Pro","XXXXXXXXX",2760,1,"MV QS3500, Sued",2,null,null,0,null,16,0,1,1000,null)
helps.
Same on some other characters:
var HPAusricht="30°SSO, 30°NNW"
var Currency ="<80>"
Solarlog pushes all files using ftp daily, therefore manually fixing base_vars.js does not really help.
I really like what you put together here and like to point it to my Solarlog.
Unfortunately I get stuck already when trying to launch the docker images:
solarlog-db | 2022-03-07T12:34:56. info found existing boltdb file, skipping setup wrapper {"system": "docker", "bolt_path": "/var/lib/influxdb2/influxd.bolt"}
solarlog-db | 2022-03-07T12:34:56. info found existing boltdb file, skipping setup wrapper {"system": "docker", "bolt_path": "/var/lib/influxdb2/influxd.bolt"}
solarlog-exporter | Usage: python -m [OPTIONS]
solarlog-exporter | Try 'python -m --help' for help.
solarlog-exporter |
solarlog-exporter | Error: Missing option '-d' / '--directory'.
Probably something very easy, but I don't know much about Python I am afraid.
I tried with the image from your repo as well as built locally. Here's my test docker-compose.yml
cat docker-compose.yml
version: '2'
services:
solarlog-exporter:
image: solarlog-exporter:latest
container_name: solarlog-exporter
volumes:
- ./tests/assets:/data
environment:
- INFLUXDB_DB=solarlog
influxdb:
image: influxdb:2.1-alpine
container_name: solarlog-db
ports:
- "8086:8086"
environment:
- INFLUXDB_HOST=influxdb
- INFLUXDB_DB=solarlog
volumes:
- ./influxdb:/var/lib/influxdb2
When starting up with docker-compose solarlog-exporter crashes immediately, complaining about "No inverters in config found", which is probably correct because I did not provide a config file.
The readme says:
What does this config file look like and where should it come from? An export from SolarLog?
I just wanted to test this container.
The container crashes on startup:
# docker logs solarlog-exporter
Usage: python -m [OPTIONS]
Try 'python -m --help' for help.
Error: Missing option '-d' / '--directory'.
Any idea?
Best, Dirk
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.