Page 15 of 15

Re: Tesla hardware module

Posted: Tuesday 16 July 2024 10:25
by Doler
@JanJaap

I recently bought a Tesla Model Y and thought I should try the integration with Domoticz. All did go well until the start of the new hardware were I met the following error:

Code: Select all

2024-07-16 10:13:47.938 Status: Tesla: Started.
2024-07-16 10:13:48.387 Status: Tesla: Initialized version 0.8.1, author 'Jan-Jaap Kostelijk'
2024-07-16 10:13:48.389 Tesla: Plugin starting
2024-07-16 10:13:48.392 Tesla: Starting version: 0.8.1
2024-07-16 10:13:49.018 Error: Tesla: Call to function 'onStart' failed, exception details:
2024-07-16 10:13:49.020 Error: Tesla: Traceback (most recent call last):
2024-07-16 10:13:49.020 Error: Tesla: File "/home/pi/domoticz/plugins/TeslaDomoticz/plugin.py", line 380, in onStart
2024-07-16 10:13:49.020 Error: Tesla: _plugin.onStart()
2024-07-16 10:13:49.020 Error: Tesla: File "/home/pi/domoticz/plugins/TeslaDomoticz/plugin.py", line 172, in onStart
2024-07-16 10:13:49.020 Error: Tesla: self.updateDevices(self.vehicle_dict[vehicle['vin']])
2024-07-16 10:13:49.020 Error: Tesla: File "/home/pi/domoticz/plugins/TeslaDomoticz/plugin.py", line 305, in updateDevices
2024-07-16 10:13:49.020 Error: Tesla: UpdateDeviceEx(deviceId, 2, vehicle.battery_range, "{:.1f}".format(vehicle.battery_range)) # range
2024-07-16 10:13:49.020 Error: Tesla: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-16 10:13:49.020 Error: Tesla: File "/home/pi/domoticz/plugins/TeslaDomoticz/plugin.py", line 451, in UpdateDeviceEx
2024-07-16 10:13:49.020 Error: Tesla: Devices[Device].Units[Unit].nValue = nValue
2024-07-16 10:13:49.020 Error: Tesla: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-16 10:13:49.020 Error: Tesla: TypeError: 'float' object cannot be interpreted as an integer
With my limited knowledge of Python I succeeded in bringing it a step further by typecasting a float to integer in line 451 of plugin.py like:

Code: Select all

Devices[Device].Units[Unit].nValue = int(nValue)
I don't understand why the error occurs since the percentage device should be able to accept float values.

Can you explain this and help me further?

Thanks, Mark

Re: Tesla hardware module

Posted: Tuesday 16 July 2024 12:22
by JanJaap
Odd indeed. But nvalue should be an int, if I remember correctly. I'm on holiday now, will have a look early August when back home

Re: Tesla hardware module

Posted: Tuesday 26 November 2024 10:23
by JPSke
Hi JanJaap. Do you think it is possible to add a switch to control charging of the car?

Re: Tesla hardware module

Posted: Tuesday 26 November 2024 19:37
by JanJaap
Yes sorry. Got a bit distracted in another app and other hobbies..... But with winter around more time to spend. Hope before christmas to have something in