MyToyota Dashboard

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

Moderator: leecollings

mxpwr
Posts: 49
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MyToyota Dashboard

Post by mxpwr »

Code changes are added now. You can now change the settings using MQTT. The Example is updated in the readme.
You can send messages to the basetopic + /command (by default: mytoyota/command)
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: MyToyota Dashboard

Post by manjh »

That's great!
I am away from home for a week, looking forward to installing and testing next week!
Hans
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: MyToyota Dashboard

Post by manjh »

I'm back home, and installed the new version.
Took your example for the LUA code and copied it into my Domoticz setup.
Worked at first try! Great work.

One thing I looked for and could not find: the base topic seems to be hardcoded "mytoyota". I was expecting this as a parameter, same as the current MQTT base topic for outgoing messages.
But no big deal if you leave it as it is. Perhaps one change: in the "settings" page, change the text "Base topic (optional)" into "Base topic outgoing", or words like that.
Just so it is clear that this is the base topic going from the mytoyota-dashboard app into MQTT.

Alternative: have two fields, one for outgoing, and one for incoming base topics. I would prefer this option, if you don't mind the code change.

Perhaps for future development, there could be more settings to be allowed coming in this way. Can't think of one right now.
Hans
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: MyToyota Dashboard

Post by manjh »

I have a suggestion for a new command from Domoticz into the MyToyota app.

Currently, I can control the polling period through the MQTT command. This way I can set a relatively short period during the charging process, and a longer one once charging is complete.
But in some situations I would want an accurate reading instantly.
Would it be possible to create a command, causing the app to refresh the data instantly, not changing the set polling period?
Hans
mxpwr
Posts: 49
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MyToyota Dashboard

Post by mxpwr »

Yeah, that shouldn't be too hard. I'll add that.
mxpwr
Posts: 49
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MyToyota Dashboard

Post by mxpwr »

Code updated, you should now be able to trigger a data pull via mqtt. Set the payload in the lua script to:

Code: Select all

payload = string.format('{"command": "force_poll"}')
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: MyToyota Dashboard

Post by manjh »

mxpwr wrote: Monday 15 September 2025 20:34 Code updated, you should now be able to trigger a data pull via mqtt. Set the payload in the lua script to:

Code: Select all

payload = string.format('{"command": "force_poll"}')
Excellent work, this change worked at first try!
Hans
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: MyToyota Dashboard

Post by manjh »

Instead of implementing in LUA, I decided to see if it is more simple in Node Red.
A function node for sending the force_poll:

Code: Select all

// set up command to force polling (once)
msg.topic   = "mytoyota/command"
msg.payload = { "command": "force_poll" };
return msg;
This function node can be triggered by anything, e.g. a changing status of the power switch that controls charging the car. But it can also be a button on the Node Red dashboard.
The output of the function node is sent to the MQTT interface.

Same principle for setting the appropriate polling period, in my setup again based on the power switch that controls charging.
If it is switched on, then the polling period is set to a low value, in my setup 2 minutes.
If switched off, the polling period is set to a longer time, in my case 30 minutes.

Code: Select all

// Respond to changing power switch message from Domoticz
// set polling period accordingly
// default value when switched off: 30 minutes (1800 seconds)
var value = 1800

// set value when switched on: 2 minutes (120 seconds)
if (msg.payload.nvalue === 1)
    {value = 120}
    
// set up command and send to MyToyota_dashboard app
msg.topic   = "mytoyota/command"
msg.payload = {"setting": "polling", "value": {"mode": "interval", "interval_seconds": value}}

return msg;
In my setup, both function nodes are triggered by the output of a switch node, selecting the input from Domoticz based on idx of the power switch.
Hans
mxpwr
Posts: 49
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MyToyota Dashboard

Post by mxpwr »

That looks like a nice setup. I'll see if I can add some information to the readme.
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: MyToyota Dashboard

Post by manjh »

mxpwr wrote: Tuesday 16 September 2025 9:58 That looks like a nice setup. I'll see if I can add some information to the readme.
Good idea. Let me know if I can be of help somehow.
Hans
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: MyToyota Dashboard

Post by manjh »

Would it be possible to add a setting to show/suppress the debug lines in the log?
Hans
mxpwr
Posts: 49
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MyToyota Dashboard

Post by mxpwr »

You can change the log level only in the yaml directly at the moment. I'll add a fastAPI hook to allow setting it from the settings page.
mxpwr
Posts: 49
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MyToyota Dashboard

Post by mxpwr »

Changes are added. I also optimized the logging method; it shouldnt hang anymore.
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: MyToyota Dashboard

Post by manjh »

mxpwr wrote: Saturday 27 September 2025 12:14 Changes are added. I also optimized the logging method; it shouldnt hang anymore.
Installed and tested. Logs "feel" much faster.
One question: I don't see the options for the logging level in the settings...

updated: sorry, I found it. I expected this option in the settings tab, but it is on the logs page...
Hans
mxpwr
Posts: 49
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MyToyota Dashboard

Post by mxpwr »

Yeah, I had it on the settings page but then moved it to the logs page. Felt more useful to have it right there.
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: MyToyota Dashboard

Post by manjh »

Everything works great. :D
But when I click "Logs" it still takes a few minutes before data shows up, and in the mean time the app freezes.
It's not a big deal, but still...
Hans
mxpwr
Posts: 49
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MyToyota Dashboard

Post by mxpwr »

Yeah, I noticed that too. I'll take a look at it when I can find some time.
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: MyToyota Dashboard

Post by manjh »

mxpwr wrote: Tuesday 14 October 2025 9:41 Yeah, I noticed that too. I'll take a look at it when I can find some time.
:) no rush...
Hans
mxpwr
Posts: 49
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MyToyota Dashboard

Post by mxpwr »

I added some updates
- logging should be fixed now
- you can select rolling average for graphs
- you can reorder the tiles for the current statistics via drag and drop (I might add an edit button later)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest