Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on connecting to one of my valves, and the add on stops #15

Closed
G-Christ opened this issue Sep 28, 2021 · 1 comment
Closed

Error on connecting to one of my valves, and the add on stops #15

G-Christ opened this issue Sep 28, 2021 · 1 comment

Comments

@G-Christ
Copy link

Hi,
When the etrv2mqtt home assistant addon tries to connect to one of my valves, it generates this error and the Add on stops.

`'MainProcess' (8), thread 'MainThread' (548024991760):
Traceback (most recent call last):

File "/usr/local/bin/etrv2mqtt", line 8, in
sys.exit(entrypoint())
│ │ └ <function entrypoint at 0x7f97bf4e50>
│ └
└ <module 'sys' (built-in)>
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/cli.py", line 28, in entrypoint
main(sys.argv[1])
│ │ └ ['/usr/local/bin/etrv2mqtt', '/data/options.json']
│ └ <module 'sys' (built-in)>
└ <function main at 0x7f98b32550>
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/cli.py", line 17, in main
deviceManager.poll_forever()
│ └ <function DeviceManager.poll_forever at 0x7f97a51c10>
└ <etrv2mqtt.devices.DeviceManager object at 0x7f9800d250>
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/devices.py", line 94, in poll_forever
schedule.run_all(delay_seconds=1)
│ └ <function run_all at 0x7f97a51550>
└ <module 'schedule' from '/usr/local/lib/python3.8/site-packages/schedule/init.py'>
File "/usr/local/lib/python3.8/site-packages/schedule/init.py", line 570, in run_all
default_scheduler.run_all(delay_seconds=delay_seconds)
│ │ └ 1
│ └ <function Scheduler.run_all at 0x7f97a50160>
└ <schedule.Scheduler object at 0x7f97a47ee0>
File "/usr/local/lib/python3.8/site-packages/schedule/init.py", line 109, in run_all
self._run_job(job)
│ │ └ Every 3600 seconds do _poll_devices() (last run: [never], next run: 2021-09-29 00:57:08)
│ └ <function Scheduler._run_job at 0x7f97a503a0>
└ <schedule.Scheduler object at 0x7f97a47ee0>
File "/usr/local/lib/python3.8/site-packages/schedule/init.py", line 147, in _run_job
ret = job.run()
│ └ <function Job.run at 0x7f97a513a0>
└ Every 3600 seconds do _poll_devices() (last run: [never], next run: 2021-09-29 00:57:08)
File "/usr/local/lib/python3.8/site-packages/schedule/init.py", line 466, in run
ret = self.job_func()
│ └ functools.partial(<bound method DeviceManager._poll_devices of <etrv2mqtt.devices.DeviceManager object at 0x7f9800d250>>)
└ Every 3600 seconds do _poll_devices() (last run: [never], next run: 2021-09-29 00:57:08)
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/devices.py", line 82, in _poll_devices
device.poll(self._mqtt)
│ │ │ └ <etrv2mqtt.mqtt.Mqtt object at 0x7f97a535e0>
│ │ └ <etrv2mqtt.devices.DeviceManager object at 0x7f9800d250>
│ └ <function TRVDevice.poll at 0x7f97a519d0>
└ <etrv2mqtt.devices.TRVDevice object at 0x7f97a534f0>
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/devices.py", line 44, in poll
ret = eTRVUtils.read_device(self._device)
│ │ │ └ <libetrv.device.eTRVDevice object at 0x7f97a536a0>
│ │ └ <etrv2mqtt.devices.TRVDevice object at 0x7f97a534f0>
│ └ <staticmethod object at 0x7f97ad5be0>
└ <class 'etrv2mqtt.etrvutils.eTRVUtils'>
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/etrvutils.py", line 34, in read_device
return eTRVData(device.name, device.battery, device.temperature.room_temperature, device.temperature.set_point_temperature, datetime.now())
│ │ │ │ │ │ │ │ │ │ └ <method 'now' of 'datetime.datetime' objects>
│ │ │ │ │ │ │ │ │ └ <class 'datetime.datetime'>
│ │ │ │ │ │ │ │ └ <libetrv.properties.eTRVProperty object at 0x7f97ade340>
│ │ │ │ │ │ │ └ <libetrv.device.eTRVDevice object at 0x7f97a536a0>
│ │ │ │ │ │ └ <libetrv.properties.eTRVProperty object at 0x7f97ade340>
│ │ │ │ │ └ <libetrv.device.eTRVDevice object at 0x7f97a536a0>
│ │ │ │ └ <libetrv.properties.eTRVProperty object at 0x7f97ade2b0>
│ │ │ └ <libetrv.device.eTRVDevice object at 0x7f97a536a0>
│ │ └ <libetrv.properties.eTRVProperty object at 0x7f97ade490>
│ └ <libetrv.device.eTRVDevice object at 0x7f97a536a0>
└ <class 'etrv2mqtt.etrvutils.eTRVData'>
File "/usr/local/lib/python3.8/site-packages/libetrv/properties.py", line 22, in get
return self.get_data_object(device).retrieve()
│ │ └ <libetrv.device.eTRVDevice object at 0x7f97a536a0>
│ └ <function eTRVProperty.get_data_object at 0x7f97af2700>
└ <libetrv.properties.eTRVProperty object at 0x7f97ade490>
File "/usr/local/lib/python3.8/site-packages/libetrv/properties.py", line 61, in retrieve
return self.retrieve_object(self.device)
│ │ │ └ <libetrv.device.eTRVDevice object at 0x7f97a536a0>
│ │ └ <libetrv.data_struct.NameData object at 0x7f970e8580>
│ └ <function eTRVSingleData.retrieve_object at 0x7f97af2f70>
└ <libetrv.data_struct.NameData object at 0x7f970e8580>
File "/usr/local/lib/python3.8/site-packages/libetrv/properties.py", line 129, in retrieve_object
return getattr(self, self.get_direct_field())
│ │ └ <function eTRVSingleData.get_direct_field at 0x7f97af2ee0>
│ └ <libetrv.data_struct.NameData object at 0x7f970e8580>
└ <libetrv.data_struct.NameData object at 0x7f970e8580>
File "/usr/local/lib/python3.8/site-packages/libetrv/fields/base.py", line 22, in get
return self.from_raw_value(raw_value, data)
│ │ │ └ <libetrv.data_struct.NameData object at 0x7f970e8580>
│ │ └ b'Sovev\xc3\xa6relset\x00\x00\x00'
│ └ <function TextField.from_raw_value at 0x7f97aecdc0>
└ <libetrv.fields.string.TextField object at 0x7f97af56a0>
File "/usr/local/lib/python3.8/site-packages/libetrv/fields/string.py", line 18, in from_raw_value
return raw_value.decode('ascii').strip('\0')
│ └ <method 'decode' of 'bytes' objects>
└ b'Sovev\xc3\xa6relset\x00\x00\x00'
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)`

Any hint on what the cause is and eventually what I can do to resolve it?

Three other valves are working perfectly

Thanks,
/Ghassan

@G-Christ
Copy link
Author

I found the cause: the error happened because the name of the valve in the Danfoss app, included a Danish letter “soveværelset” that could not be decoded. I changed the name to “Sove” and it did not crash any more.

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

No branches or pull requests

1 participant