Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First stab at some Tesla Model S rules
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Tesla Model S Rules file... | ||
|
||
unique 508 1 | ||
|
||
# BRAKE pedal position | ||
decoder ID:165 brakepedalpos { (($d2<<8)+$d1,'%'); } | ||
coverage ID:165 1,2 | ||
|
||
# PACK info (chargingrate??) | ||
decoder ID:222 chargingrate { ((($d2<<8)+$d1)/100,'kph'); } | ||
decoder ID:222 essvoltage { ((($d4<<8)+$d3)/100,'V'); } | ||
coverage ID:222 1,2,3,4 | ||
|
||
# GEAR, ACCELERATOR, POWER | ||
decoder ID:254 gear { (&choice($d1,0x00,'off',0x04,'park',0x0c,'neutral',0x08,'reverse',0x10,'drive'),''); } | ||
decoder ID:254 brake { (($d2==0x10)?'on':'off',''); } | ||
decoder ID:254 accelpos { (($d4<<8)+$d3,'%'); } | ||
decoder ID:254 powerregen { ((($d6<<8)+$d5)/100,'kW'); } | ||
coverage ID:254 1,2,3,4,5,6 | ||
|
||
# SPEED (regenbrakelight?) | ||
decoder ID:256 driving { (($d1==0x21)?'driving':'stopped',''); } | ||
decoder ID:256 regenbrakelight { (($d2==0x09)?'on':'off',''); } | ||
decoder ID:256 speed { ((($d4<<8)+$d3)/10,'mph'); } | ||
coverage ID:256 1,2,3,4 | ||
|
||
# LIGHTS ? | ||
decoder ID:266 lights { (&choice($d1,0x89,'on',0x8a,'off'),''); } | ||
coverage ID:266 1 | ||
|
||
# WH/KM ???? | ||
decoder ID:26A whkm { (($d2<<8)+$d1,'wh/km'); } | ||
coverage ID:26A 1,2 | ||
|
||
# CHARGE LEVEL | ||
decoder ID:2C8 soc { ($d2,'%'); } | ||
coverage ID:2C8 2 | ||
|
||
# COUNTRY | ||
decoder ID:398 country { (chr($d1).chr($d2),''); } | ||
coverage ID:398 1,2 | ||
|
||
# 3D2: 2x 4 byte counters, count up when on | ||
# total Kwh used??? | ||
# 2B 5A 23 00 D4 0A 26 00 | ||
|
||
# VIN | ||
decoder ID:508:00 vin1 { (chr($d2).chr($d3).chr($d4).chr($d5).chr($d6).chr($d7).chr($d8),''); } | ||
decoder ID:508:01 vin2 { (chr($d2).chr($d3).chr($d4).chr($d5).chr($d6).chr($d7).chr($d8),''); } | ||
decoder ID:508:02 vin3 { (chr($d2).chr($d3).chr($d4),''); } | ||
coverage ID:508:00 1,2,3,4,5,6,7,8 | ||
coverage ID:508:01 1,2,3,4,5,6,7,8 | ||
coverage ID:508:02 1,2,3,4 |