hansij66 / trannergy2mqtt

Read Trannergy solar inverter and create MQTT messages
GNU General Public License v3.0
2 stars 0 forks source link

UTF-8 error: trannergy-mqtt.trannergy_tcpclient #1

Closed janwbouma closed 1 year ago

janwbouma commented 1 year ago

Thanks for this component. I receive the statistics from my Trannergy inverter succesfully.

Unfortunately I received the following error.

trannergy-mqtt.trannergy_tcpclient WARNING: FUNCTION:run LINE:178: Exception 'utf-8' codec can't decode byte 0xe9 in position 14: invalid continuation byte

Any Idea how I can fix this?

hansij66 commented 1 year ago

Hoi Jan Willem

Sorry, no idea what the cause is; which inverter do you have; I am using pvl5400

Maybe your inverter does not use utf8 coding

You can try to change

serial = str(rawdata[15:31], encoding="UTF-8")

to eg "ISO-8859-1"

On which OS are your running this? Which python version?

Groet Hans

On Sun, Dec 11, 2022 at 12:17 PM Jan Willem Bouma @.***> wrote:

Thanks for this component. I receive the statistics from my Trannergy inverter succesfully.

Unfortunately I received the following error.

trannergy-mqtt.trannergy_tcpclient WARNING: FUNCTION:run LINE:178: Exception 'utf-8' codec can't decode byte 0xe9 in position 14: invalid continuation byte

Any Idea how I can fix this?

— Reply to this email directly, view it on GitHub https://github.com/hansij66/trannergy2mqtt/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFFPZD4UNJMLOWQ2OWCEAH3WMWZ4PANCNFSM6AAAAAAS247KME . You are receiving this because you are subscribed to this thread.Message ID: @.***>

janwbouma commented 1 year ago

Hi Hans,

Thanks for your response. I get the total of produced KWH through to mqtt in Home Assistant. Works great!

I have a PVL4000.

I made the adjustment to "ISO-8859-1". Let's see tomorrow if it works tomorrow without any encoding errors.

I have dockerized the script with python 3.9 base container and run it in a docker on a Synology. When the inverter is not available the container stops unexpectedly. maybe due to the connection errors. I bypass container stops at this moment with an auto restart of the container.