Support for electric vehicles

Hi all,

So, the first part of the EV update is here. This update contains the possibilities to add your own codes specific to your EV. You can now add specific formulas to each code, to make sure it’s formatted correctly. This should make it possible for you to add a code, setup a logger for the code and then have the code visualized in the dashboard. See this guide on how to get started with everything:

The next update will contain more about how to configure the trips settings for the EV.

best

Peter

Like that ? But seem not work. It’s miss something …

image image

I just added SOH and SOC for the Hyundai Kona to the community library - I think this will be the same for the Hyundai Ioniq and Kia eNero.

40

16

PID info from https://github.com/JejuSoul/OBD-PIDs-for-HKMC-EVs/blob/master/Hyundai%20Kona%20EV%20%26%20Kia%20Niro%20EV/extendedpids/003_Kona%26Niro_EV_BMS.csv

To test, add single quotes around the header and hit run.

$ obd.query SOC_Display mode=220 pid=105 header='7E4' bytes=54 formula='bytes_to_int(messages[0].data[38:39])/2' unit=% baudrate=500000
 protocol=6 verify=false force=true
value: 99
_stamp: '2019-03-04T18:21:05.640377'
_type: soc_display
unit: '%'

$ obd.query SOH mode=220 pid=105 header='7E4' bytes=54 formula='(bytes_to_int(messages[0].data[31:32])*256+bytes_to_int(messages[0].data[32:33]))/10' unit=% baudrate=500000 protocol=6 verify=false force=true
value: 100
_stamp: '2019-03-04T19:16:47.213884'
_type: soh
unit: '%'
1 Like

Thank’s
But i can’t find it …

image

I’m not sure … maybe something needs to be done by the autopi folks. I see -

12

Note SOC_Display and SOH towards the bottom.

Maybe try 2018 ?

1 Like

Yes. Thanks. I found all in kona EV 2018
Very thank you
So we need to make widget now, isn’t it ?

Yea, that bit isn’t working for me yet. I mentioned in How to use the "Car Explorer" feature

1 Like

Ok. Thanks. And before make widgets, we need to do this ?:
image image

And I have this error …

image

Yea, there is a known issue -

So

header='7E4'

rather than

header=7E4

plord do you use custom can settings or standard autodetect ? my code return NO VALUE

I have [6] ISO 15765-4 (CAN 11/500) at 500000 baud. I think it was auto detected.

2 Likes

Ok but do you ve idea about NO VALUE

About ‘…’ I can’t save, value is not accepted

@Malte please update code to resolve quote issue, therefore is useful an editor text box to modify directly and save
at now I use custom code to collect data manually !
06

@asetyde
Did you get data like this ? Can you show me by screen ? Thanks.

Thanks for the great work adding this! I suspect the SoC reading/formula might not be quite right though. My car is currently charging and is somewhere in the mid-70% range, but the value reported when running the query is 94%.

Hi Alexandro

The fix to the quote issue should be out in a few hours.
But to avoid the issue, you can just add quotes around the header as @plord says.

The preview code is just a preview, if you want to edit it, just copy and paste the code into the terminal, that way you can edit it before executing it.

The custom code module that you show does not quite work like that. (FYI @Remy_Tsuihiji)
You can execute modules like the obd.query via the custom code modules, but you will have to call the module like this instead.

def test():
    """
    This calls the salt module obd.query, with the specified args and kwargs
    """
    args = [
        'SOH'
    ]
    kwargs = {
        'mode': '220',
        'pid': '105',
        'header': '7E4',
        'bytes': '54',
        'formula': '(bytes_to_int(messages[0].data[31:32])*256+bytes_to_int(messages[0].data[32:33]))/10',
        'baudrate': 500000,
        'protocol': '6',
        'verify': False,
        'force': True,
    }
    return __salt__['obd.query'](*args, **kwargs)

NOTE:
The above example is just to say that it’s possible to do that, I’m still not sure exactly why you would not just create a logger that uses the PID?

Best regards
/Malte

@plord also I not find correct formula, with 94% result 101 , I see excel documenti but I not find a legend to understand it and correct idi I can, probably new sms update change something, BMS is update to adapt new WLTP cycle correction done by Hyundai 3 month ago

For display state of charge ? Formula on the kona is -

Mode: 220
Code: 105
Header: 7E4
Bytes: 54
Formula: bytes_to_int(message.data[34:35])/2.0
Unit: %
Min: 0
Max: 100

I recently fixed the formula ( community library should have been updated ).

I’ve also got a number of other PID’s in-place, but not yet shared since I wanted to see them plotted first.

4 Likes