nmakel / solaredge_setapp

SolarEdge SetApp protocol buffers parser library
MIT License
16 stars 1 forks source link

Error #3

Closed jonesPD closed 4 years ago

jonesPD commented 4 years ago

Hi I get an error when trying it out:

python3 example.py 172.16.0.1

    CPU 4.8.28 | DSP1: 1.0.1020 | DSP2: 2.0.905

    xxxxxxxx-xx     Producing       47°C

Traceback (most recent call last): File "example.py", line 51, in production_total=(data["status"]["energy"]["total"] / 1000) UnicodeEncodeError: 'latin-1' codec can't encode character '\u2211' in position 20: ordinal not in range(256)

Tried playing with the code a bit, but I couldn't figure it out. Any ideas? My git clone is still in sync. dump_all does show energy readings and does not result in errors. I'm connected to the set_app wifi. Thanks for looking into this.

nmakel commented 4 years ago

Looks like the "sum" unicode character isn't being displayed.

Have a look on line 48 of example.py, you'll see "{production_today:.2f}kWh ∑ {production_total:.2f}". Are you running the script using python3, because that will automatically interpret the code as UTF-8.

jonesPD commented 4 years ago

Check, removing these characters solves the issue. It seems to be some package missing from my python3 installation. Thanks.