Automatic trip administration tools for Hyundai Bluelink users

Discussion in 'Hyundai' started by Zuinige Rijder, Sep 28, 2022.

To remove this ad click here.

  1. Zuinige Rijder

    Zuinige Rijder New Member

    Automatic trip administration tools for Hyundai Bluelink or Kia UVO Connect users. Determining afterwards your private and/or business trips and information about those trips and usage of the car. See here for the scripts and for more information.

    Run monitor.py e.g. once per hour (I use it on a Raspberry Pi and on Windows 10 with pure Python) and you can always check afterwards:
    • captured locations
    • odometer at specific day/hour
    • how much driven at a specific day
    • how much battery% used at a specific day (for BEV or HEV users)
    • where you have been at a specific day/hour
    • when you have charged and how much
    • see your 12 volt battery percentage fluctuation
    Idea is that you can analyze the information over time with other scripts or e.g. with Excel:
    • summaries (see summary.py script)
    • odometer trend over the lifetime
    • SOC trend and charging trend
    • 12V battery fluctuations

    Summary of captured data (you can also configure miles and dollars):
    Code:
    C:\Users\Rick\git\monitor>python summary.py
    Label, date      , driven km, charged%, discharged%, charges, drives, km/kWh, kWh/100km, cost Euro
    DAY  , 2022-09-17,       0.0,      +3%,           0,       1,      0,    0.0,       0.0,      0.00
    DAY  , 2022-09-18,       0.0,      +2%,           0,       0,      0,    0.0,       0.0,      0.00
    WEEK , 2022 W37  ,       0.0,      +5%,           0,       1,      0,    0.0,       0.0,      0.00
    DAY  , 2022-09-19,       6.5,      +0%,           0,       0,      2,    0.0,       0.0,      0.00
    DAY  , 2022-09-20,      47.6,      +0%,         -14,       0,      2,    4.9,      20.6,      2.41
    DAY  , 2022-09-21,       5.2,     +19%,           0,       2,      2,    0.0,       0.0,      0.00
    DAY  , 2022-09-22,       1.9,      +2%,           0,       1,      1,    0.0,       0.0,      0.00
    DAY  , 2022-09-23,       1.7,     +24%,           0,       2,      1,    0.0,       0.0,      0.00
    DAY  , 2022-09-24,     407.8,     +37%,         -95,       1,      6,    6.1,      16.3,     16.36
    DAY  , 2022-09-25,       0.0,      +6%,           0,       0,      0,    0.0,       0.0,      0.00
    WEEK , 2022 W38  ,     470.7,     +88%,         -98,       6,     14,    6.9,      14.6,     16.88
    MONTH, 2022-09   ,     470.7,     +93%,         -97,       7,     14,    6.9,      14.4,     16.70
    YEAR , 2022      ,     470.7,     +93%,         -97,       7,     14,    6.9,      14.4,     16.70
    
    Screenshot of Excel using symmary day data:

    Convert captured data to kml and show it on a map e.g. with Google My Maps:
    Code:
    C:\Users\Rick\git\monitor>python kml.py
      1: 20220917 15:00    (5.124957,51.68260 ) SOC: 54% 12V: 90% ODO: 17324.2
      2: 20220917 23:00 C  (5.124957,51.68260 ) SOC: 55% 12V: 91% ODO: 17324.2 charging plugged:2
      3: 20220918 01:00    (5.124957,51.68260 ) SOC: 60% 12V: 91% ODO: 17324.2 plugged:2
      4: 20220919 15:00  D (5.125942,51.679128) SOC: 61% 12V: 85% ODO: 17324.3 (+0.1 since 20220919 14:00) drive
      5: 20220919 16:00    (5.124957,51.68260 ) SOC: 59% 12V: 86% ODO: 17330.7 (+6.4 since 20220919 15:00)
      6: 20220920 07:00  D (5.091594,51.684361) SOC: 59% 12V: 88% ODO: 17330.7 drive
      7: 20220920 08:00    (5.124957,51.68260 ) SOC: 53% 12V: 91% ODO: 17358.9 (+28.2 since 20220920 07:00)
      8: 20220920 14:30  D (5.135242,51.692605) SOC: 50% 12V: 87% ODO: 17358.9 drive
      9: 20220920 15:00  D (5.078042,51.693758) SOC: 49% 12V: 91% ODO: 17358.9 drive
     10: 20220920 15:30    (5.04708 ,51.688192) SOC: 48% 12V: 92% ODO: 17371.5 (+12.6 since 20220920 15:00)
     11: 20220920 15:58    (5.124957,51.68260 ) SOC: 47% 12V: 91% ODO: 17378.3 (+6.8 since 20220920 15:30)
     12: 20220921 10:30 C  (5.124957,51.68260 ) SOC: 46% 12V: 91% ODO: 17378.3 charging plugged:2
     13: 20220921 12:30    (5.135183,51.692608) SOC: 52% 12V: 92% ODO: 17380.8 (+2.5 since 20220921 12:00)
     14: 20220921 13:00    (5.124957,51.68260 ) SOC: 51% 12V: 91% ODO: 17383.5 (+2.7 since 20220921 12:30)
     15: 20220921 14:31 C  (5.124957,51.68260 ) SOC: 52% 12V: 91% ODO: 17383.5 charging plugged:2
     16: 20220922 06:00    (5.124957,51.68260 ) SOC: 70% 12V: 91% ODO: 17383.5 plugged:2
     17: 20220923 11:21    (5.132119,51.685055) SOC: 71% 12V: 88% ODO: 17385.4 (+1.9 since 20220923 11:00)
     18: 20220923 12:00 C  (5.124957,51.68260 ) SOC: 72% 12V: 87% ODO: 17387.1 (+1.7 since 20220923 11:21) charging plugged:2
     19: 20220923 15:00    (5.124957,51.68260 ) SOC: 80% 12V: 87% ODO: 17387.1 plugged:2
     20: 20220924 08:00  D (5.124957,51.68260 ) SOC:100% 12V: 95% ODO: 17387.1 drive
     21: 20220924 08:30    (5.124957,51.68260 ) SOC:100% 12V: 95% ODO: 17387.1
     22: 20220924 11:00  D (5.129967,51.674819) SOC: 98% 12V: 92% ODO: 17390.8 drive
     23: 20220924 11:30  D (5.204728,51.883719) SOC: 91% 12V: 97% ODO: 17390.8 drive
     24: 20220924 12:00  D (5.250064,52.256122) SOC: 81% 12V: 98% ODO: 17390.8 drive
     25: 20220924 12:30  D (5.540714,52.575733) SOC: 69% 12V: 98% ODO: 17390.8 drive
     26: 20220924 13:00  D (5.768325,52.898894) SOC: 57% 12V: 98% ODO: 17390.8 drive
     27: 20220924 13:21    (5.683261,53.036686) SOC: 52% 12V: 96% ODO: 17589.2 (+198.4 since 20220924 13:00)
     28: 20220924 14:31    (5.681147,53.016858) SOC: 51% 12V: 94% ODO: 17592.5 (+3.3 since 20220924 14:00)
     29: 20220924 15:00  D (5.686422,53.030697) SOC: 51% 12V: 93% ODO: 17592.5 drive
     30: 20220924 15:23    (5.68325 ,53.036683) SOC: 50% 12V: 96% ODO: 17597.3 (+4.8 since 20220924 15:00)
     31: 20220924 16:30  D (5.6802  ,53.035853) SOC: 50% 12V: 94% ODO: 17597.3 drive
     32: 20220924 17:00  D (5.771994,52.709039) SOC: 40% 12V: 94% ODO: 17597.3 drive
     33: 20220924 17:30  D (5.375436,52.411236) SOC: 30% 12V: 95% ODO: 17597.3 drive
     34: 20220924 18:00  D (5.158522,52.095317) SOC: 21% 12V: 94% ODO: 17597.3 drive
     35: 20220924 18:30  D (5.293333,51.748758) SOC: 10% 12V: 96% ODO: 17597.3 drive
     36: 20220924 19:00 C  (5.124957,51.68260 ) SOC:  5% 12V: 97% ODO: 17794.9 (+197.6 since 20220924 18:30) charging plugged:2
    
    Screenshot of Google My Maps example:


    And an Excel example of shrink.py output:
     
  2. To remove this ad click here.

  3. Zuinige Rijder

    Zuinige Rijder New Member

    New release with improvements to summary.py:

    • added charge/discharge in kWh
    • use location to determine moved
    • small delta SOC improvement
    • examples adapted to new columns

    Example output:
    Code:
    C:\Users\Rick\git\monitor>python summary.py
    Period, date      , driven km, charged%, charged kWh, discharged%, discharged kWh, #charges, #drives, km/kWh, kWh/100km, cost Euro
    DAY   , 2022-09-17,       0.0,      +4%,         2.8,          0%,            0.0,        1,       0,    0.0,       0.0,      0.00
    DAY   , 2022-09-18,       0.0,      +2%,         1.4,          0%,            0.0,        0,       0,    0.0,       0.0,      0.00
    WEEK  , 2022 W37  ,       0.0,      +6%,         4.2,          0%,            0.0,        1,       0,    0.0,       0.0,      0.00
    DAY   , 2022-09-19,       6.5,      +0%,         0.0,         -1%,           -0.7,        0,       2,    0.0,       0.0,      0.00
    DAY   , 2022-09-20,      47.6,      +0%,         0.0,        -14%,           -9.8,        0,       2,    4.9,      20.6,      2.41
    DAY   , 2022-09-21,       5.2,     +26%,        18.2,         -1%,           -0.7,        2,       2,    0.0,       0.0,      0.00
    DAY   , 2022-09-22,       1.9,      +2%,         1.4,         -1%,           -0.7,        1,       1,    0.0,       0.0,      0.00
    DAY   , 2022-09-23,       1.7,     +29%,        20.3,          0%,            0.0,        2,       1,    0.0,       0.0,      0.00
    DAY   , 2022-09-24,     407.8,     +37%,        25.9,        -95%,          -66.5,        1,       6,    6.1,      16.3,     16.36
    DAY   , 2022-09-25,       0.0,      +8%,         5.6,          0%,            0.0,        0,       0,    0.0,       0.0,      0.00
    WEEK  , 2022 W38  ,     470.7,    +102%,        71.4,       -112%,          -78.4,        6,      14,    6.0,      16.7,     19.29
    MONTH , 2022-09   ,     470.7,    +108%,        75.6,       -112%,          -78.4,        7,      14,    6.0,      16.7,     19.29
    YEAR  , 2022      ,     470.7,    +108%,        75.6,       -112%,          -78.4,        7,      14,    6.0,      16.7,     19.29
    
    Excel screenshot:

    summary.day.png
     
  4. Zuinige Rijder

    Zuinige Rijder New Member

    New release R1.5.0



    Many improvements to summary.py:

    • added TRIP information
    • added average, minimum, maximum State Of Charge%
    • added average, minimum, maximum 12 Volt %
    • added possibility of combination of arguments
    • added information after 1 month of use
    • added option to not show zero values for better readability
    • configuration when consumption data should be shown (minimum discharge in kWh)
    • configuration when small delta's are not seen as charging/discharging when not charging and not moved (e.g. 2% SOC)
    Example output:
    Code:
    C:\Users\Rick\git\monitor>python summary.py
    Period, date      , info , delta km,    +kWh,     -kWh, km/kWh, kWh/100km, cost Euro, SOC%AVG,MIN,MAX, 12V%AVG,MIN,MAX, #charges, #drives
    DAY   , 2022-09-17, Sat  ,         ,     0.7,         ,       ,          ,          ,      54, 55, 55,      90, 91, 91,        1,
    DAY   , 2022-09-18, Sun  ,         ,     2.8,         ,       ,          ,          ,      59, 58, 60,      91, 91, 91,         ,
    WEEK  , 2022-09-18, WK 37,         ,     3.5,         ,       ,          ,          ,      59, 55, 60,      91, 91, 91,        1,
    TRIP  , 2022-09-19, 15:00,      0.1,        ,         ,       ,          ,          ,      60, 59, 61,      90, 85, 91,         ,       1
    TRIP  , 2022-09-19, 16:00,      6.4,        ,     -1.4,       ,          ,          ,      60, 59, 59,      86, 86, 86,         ,       1
    DAY   , 2022-09-19, Mon  ,      6.5,        ,         ,       ,          ,          ,      60, 59, 61,      89, 85, 91,         ,       2
    TRIP  , 2022-09-20, 08:00,     28.2,        ,     -4.2,    6.7,      14.9,      1.03,      58, 53, 59,      88, 86, 91,         ,       1
    TRIP  , 2022-09-20, 15:30,     12.6,        ,     -2.1,    6.0,      16.7,      0.52,      50, 48, 51,      90, 87, 92,         ,       1
    TRIP  , 2022-09-20, 15:58,      6.8,        ,     -0.7,       ,          ,          ,      48, 47, 47,      92, 91, 91,         ,       1
    DAY   , 2022-09-20, Tue  ,     47.6,        ,     -7.0,    6.8,      14.7,      1.72,      54, 47, 59,      89, 86, 92,         ,       3
    TRIP  , 2022-09-21, 12:30,      2.5,     3.5,         ,       ,          ,          ,      46, 45, 52,      91, 91, 92,        1,       1
    TRIP  , 2022-09-21, 13:00,      2.7,        ,     -0.7,       ,          ,          ,      52, 51, 51,      92, 91, 91,         ,       1
    DAY   , 2022-09-21, Wed  ,      5.2,    15.4,     -0.7,       ,          ,          ,      50, 45, 68,      91, 91, 92,        2,       2
    DAY   , 2022-09-22, Thu  ,         ,     1.4,         ,       ,          ,          ,      69, 70, 72,      91, 91, 91,        1,
    TRIP  , 2022-09-23, 11:21,      1.9,        ,     -0.7,       ,          ,          ,      72, 71, 72,      91, 88, 91,         ,       1
    TRIP  , 2022-09-23, 12:00,      1.7,     0.7,         ,       ,          ,          ,      72, 72, 72,      88, 87, 87,        1,       1
    DAY   , 2022-09-23, Fri  ,      3.6,     6.3,     -0.7,       ,          ,          ,      73, 71, 80,      90, 87, 91,        1,       2
    TRIP  , 2022-09-24, 09:57,      3.7,    14.0,     -0.7,       ,          ,          ,      91, 99,100,      88, 87, 95,        1,       1
    TRIP  , 2022-09-24, 13:21,    198.4,        ,    -32.9,    6.0,      16.6,      8.09,      80, 52, 98,      96, 92, 98,         ,       1
    TRIP  , 2022-09-24, 14:31,      3.3,        ,     -0.7,       ,          ,          ,      52, 51, 51,      95, 94, 94,         ,       1
    TRIP  , 2022-09-24, 15:23,      4.8,        ,     -0.7,       ,          ,          ,      51, 50, 51,      94, 93, 96,         ,       1
    TRIP  , 2022-09-24, 19:00,    197.6,        ,    -31.5,    6.3,      15.9,      7.75,      30,  5, 50,      95, 94, 97,        1,       1
    DAY   , 2022-09-24, Sat  ,    407.8,    15.4,    -66.5,    6.1,      16.3,     16.36,      75,  5,100,      91, 87, 98,        2,       5
    DAY   , 2022-09-25, Sun  ,         ,    30.1,         ,       ,          ,          ,      29, 42, 50,      97, 97, 97,         ,
    WEEK  , 2022-09-25, WK 38,    470.7,    67.2,    -73.5,    6.4,      15.6,     18.08,      60,  5,100,      91, 85, 98,        6,      14
    MONTH , 2022-09-25, Sep  ,    470.7,    70.7,    -73.5,    6.4,      15.6,     18.08,      59,  5,100,      91, 85, 98,        7,      14
    YEAR  , 2022-09-25, 2022 ,    470.7,    70.7,    -73.5,    6.4,      15.6,     18.08,      59,  5,100,      91, 85, 98,        7,      14
    
    
     
  5. Zuinige Rijder

    Zuinige Rijder New Member

    Explanation for someone with no knowledge of python. I don't know what computer you have. Part of the tools is the regular retrieval of the data with the Python script monitor.py. For this you need to install Python. Here's more information about installing Python .

    Then download the source code of hyundai_kia_connect_api V1.34.2 here .
    And of course also download the hyundai_kia_connect_monitor R1.5.0 here .

    Extract both and move the hyundai_kia_connect_api subfolder of hyundai_kia_connect_api-1.34.2 under hyundai_kia_connect_monitor.

    Then configure the monitor.cfg.

    Then run: python monitor.py

    Probably some packages needed for Hyundai Connect API are not installed (error messages). Learn more about installing Python packages. I have installed the following packages:
    • python-dateutil
    • beautifulsoup4
    If everything works, it's a matter of regularly collecting the information, for example by running the "python monitor.py" command once an hour. A server is of course best, I use a Raspberry Pi, but it can also regularly be done on a Windows 10 or Mac computer, provided the computer is on.

    By then, if you want to show the summary information in monitor.csv, configure the summary.cfg once and run the command: python summary.py
     

Share This Page