Python Plugin: Toyota Topic is solved

Python and python framework

Moderator: leecollings

joro75
Posts: 2
Joined: Sunday 03 October 2021 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Python Plugin: Toyota

Post by joro75 »

Hi all,

I have created a Python plugin that is able to retrieve the information from a Toyota car, when it is using the Toyota Connected Services. It is using the same API that is used by the Toyota MyT connected services app. This API is however only useable for cars that are purchased in Europe. For more information on Toyota MyT see: https://www.toyota-europe.com/service-a ... toyota/myt

The Toyota car should first be made available in the MyT connected services app, after which the Toyota plugin can retrieve the information, which is then provided as several devices in Domoticz.

At this moment the following devices will be available in Domoticz:
  • Mileage - Shows the daily and total mileage
  • Fuel level - Shows actual fuel level percentage
  • Distance to home - Shows the distance between the car and home
  • Locked - Shows the locked / unlocked state of the car
The devices that are provided by the Toyota plugin
The devices that are provided by the Toyota plugin
multiple_toyota_plugin_devices.png (40.5 KiB) Viewed 3439 times
The plugin and additional instructions on how it can be installed, can be found on: https://github.com/joro75/Domoticz-Toyota-Plugin.

This is the initial (v0.8.0) release, but I plan to add additional devices in upcoming versions.

Any feedback or suggestions are appreciated.

Thansk, and with best regards,
John
Jan01
Posts: 3
Joined: Saturday 30 December 2023 7:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Contact:

Re: Python Plugin: Toyota

Post by Jan01 »

Hello,
I tried to install this plugin to Domoticz but I got errors - see in the attachment.

Where is the issue?

Thank you for help.
Attachments
errors.txt
(4.08 KiB) Downloaded 73 times
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

Has this problem been solved?
Hans
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

Other question. I expect delivery of a new RAV4 PHEV in the next few weeks, and obviously would like to link it to my Domoticz.
Does anyone have experience using this plugin on a PHEV?
Hans
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

I installed the plugin, plus the required pytoyoda and geopy.
When I add the plugin to Domoticz, I get these errors:

Code: Select all

2025-03-16 12:33:10.522 Toyota: Worker thread started.
2025-03-16 12:33:10.521 Status: Toyota: Entering work loop.
2025-03-16 12:33:10.522 Status: Toyota: Started.
2025-03-16 12:33:10.780 Error: Toyota: (Toyota) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-Toyota-Plugin/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2025-03-16 12:33:10.782 Error: Toyota: Traceback (most recent call last):
2025-03-16 12:33:10.782 Error: Toyota: File "/home/pi/domoticz/plugins/Domoticz-Toyota-Plugin/plugin.py", line 76, in <module>
2025-03-16 12:33:10.782 Error: Toyota: import arrow # pylint:disable=import-error
2025-03-16 12:33:10.782 Error: Toyota: ModuleNotFoundError: No module named 'arrow'

Any clues as to what this means?
Hans
User avatar
waltervl
Posts: 6002
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by waltervl »

That the python arrow module also needs to be installed.
As the plugin has not been touched for years be prepared for some changes. Also you need a recent python version...
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

I tried to pip install arrow, but it comes back saying that has already been satisfied....
Hans
User avatar
waltervl
Posts: 6002
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by waltervl »

Did you try with sudo pip install? As that is known solution to solve module loading errors
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

waltervl wrote: Sunday 16 March 2025 18:46 Did you try with sudo pip install? As that is known solution to solve module loading errors
tried that, no luck.

This morning I discovered there is a NodeRed module for Toyota support, I'll give that a try.
Hans
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

Just to report that I've succeeded in pulling a lot of information from my Toyota into Domoticz.
Starting point was pytoyoda, running on my R-Pi. I modified the example file to write the information into a json formatted file.
This file then triggers a flow in Node Red, which reads the file and pulls out the data elements I want.
These are then sent over to Domoticz.

It would have been nice to have a local Domoticz plugin, but once this solution runs it has the same result...
Hans
mxpwr
Posts: 28
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Toyota

Post by mxpwr »

I tried to use the pytoyoda package to feed data to domoticz which sort of works, but it's not pretty, so I wrote an independent frontend for it

https://github.com/stone17/mytoyota-dashboard

I plan on adding domoticz integration next using mqtt, but maybe someone wants to try this one and give input
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

mxpwr wrote: Sunday 03 August 2025 14:04 I tried to use the pytoyoda package to feed data to domoticz which sort of works, but it's not pretty, so I wrote an independent frontend for it

https://github.com/stone17/mytoyota-dashboard

I plan on adding domoticz integration next using mqtt, but maybe someone wants to try this one and give input
Installation instruction contains an error:

Code: Select all

git clone <repository_url>
Hans
mxpwr
Posts: 28
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Toyota

Post by mxpwr »

Thanks, I can fix that. Do you get any other error?
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

mxpwr wrote: Monday 04 August 2025 18:09 Thanks, I can fix that. Do you get any other error?
Yes.

Code: Select all

docker-compose up -d --build
should be

Code: Select all

docker compose up -d --build
Hans
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

No other errors found! Aside from these two typo's in the installation instruction, the setup went very smoothly.

I am impressed with this plugin!
Will be playing with it some more.

Already see one change request: in "historical data" the options are 7, 30 or 90 days. Could you add "all"?
Hans
mxpwr
Posts: 28
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Toyota

Post by mxpwr »

manjh wrote: Tuesday 05 August 2025 13:33 No other errors found! Aside from these two typo's in the installation instruction, the setup went very smoothly.

I am impressed with this plugin!
Will be playing with it some more.

Already see one change request: in "historical data" the options are 7, 30 or 90 days. Could you add "all"?
Thanks for trying. I vibe coded this in less than 10h with Gemini 2.5pro. I'll add the "view all" this weekend.
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

Great work!
Hans
manjh
Posts: 780
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Toyota

Post by manjh »

Missing on the dashboard panel: battery level (%), and EV consumption (kWh/100).
Perhaps because the author has a hybrid, not a PHEV?
If you want, I can do the testing!
Hans
mxpwr
Posts: 28
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Toyota

Post by mxpwr »

manjh wrote: Thursday 07 August 2025 18:34 Missing on the dashboard panel: battery level (%), and EV consumption (kWh/100).
Perhaps because the author has a hybrid, not a PHEV?
If you want, I can do the testing!
Yes, I have a hybrid. I was wondering if this will work with other types of cars. If you get me your logs, I can probably fix this.
mxpwr
Posts: 28
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Toyota

Post by mxpwr »

manjh wrote: Tuesday 05 August 2025 13:33 No other errors found! Aside from these two typo's in the installation instruction, the setup went very smoothly.

I am impressed with this plugin!
Will be playing with it some more.

Already see one change request: in "historical data" the options are 7, 30 or 90 days. Could you add "all"?
i added "all" option and some other things (heatmap and histogram plot).
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest