Tesla hardware module

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

Doler
Posts: 142
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: Tesla hardware module

Post 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
Mark: Domoticz Beta on Raspberry Pi 4 running Debian Bookworm - Z-Stick 7 - RFXCom - P1 - MySensors - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (plugin) - Zwave-js-ui - dzVents - Nodered
JanJaap
Posts: 191
Joined: Thursday 12 October 2017 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Dev
Location: the Netherlands
Contact:

Re: Tesla hardware module

Post 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
RPi 3, Domoticz dev version, Aeon ZWave stick (with a whole bunch of slaves), Zigbee using Zigbee2MQTT, Nest thermo, P1 smart meter on RPi Zero
JPSke
Posts: 32
Joined: Wednesday 11 November 2020 11:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Sint-Gillis-Waas, Belgium
Contact:

Re: Tesla hardware module

Post by JPSke »

Hi JanJaap. Do you think it is possible to add a switch to control charging of the car?
JanJaap
Posts: 191
Joined: Thursday 12 October 2017 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Dev
Location: the Netherlands
Contact:

Re: Tesla hardware module

Post 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
RPi 3, Domoticz dev version, Aeon ZWave stick (with a whole bunch of slaves), Zigbee using Zigbee2MQTT, Nest thermo, P1 smart meter on RPi Zero
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest