This repository has been archived on 2026-11-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
hassble-config/templates.yaml
T
eiggerandClaude Opus 5 0d4e2a4ba9 feat(obd): scan candidate blocks for a dash-matching odometer
The previous probes read byte 0 with formula "a" and never looked at an
odometer at all, so they could not answer the question they were added for.

Sweep the offset instead. 21 01 at 7C6 and 21 A0 at 7E1 each get sixteen
sensors reading three bytes as an unsigned big-endian value in kilometres,
at offsets 0 through 15. Whichever one reports 195958 has found the odometer,
and the rest can be deleted along with it.

The sweep is safe because decode returns null when offset plus length runs
past the response, and emit drops nulls, so offsets that do not exist stay
empty rather than publishing noise. Length 3 with type uint32 reads 24 bits,
since toLong only shifts across the slice it is given and uint32 skips sign
handling. Twenty-four bits scaled by one is the shape the cluster odometer
takes in 22 B002 on this platform; the engine's 32-bit thousandths form is
already covered by the working odometer sensor.

22 B001 and 22 B003 stay as single existence probes because nothing is known
about whether they answer at all. If they do, their response lands in the log
and the same sweep can be pointed at them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 14:35:51 +09:00

537 lines
26 KiB
YAML

# Device templates for HassBle app → Sensors tab → Import template
# Loaded from repo root as templates.yaml (same branch as config.yaml)
templates:
- id: jaalee_jht
name: "Jaalee JHT"
description: "Temperature / humidity / battery (iBeacon, Apple manufacturer 76)"
device:
id: jaalee_jht
name: "Jaalee JHT"
source: advertisement
instance_mode: mac
match:
manufacturer_id: 76
manufacturer_min_length: 24
manufacturer_hex_prefix: "0215"
sensors:
- key: temperature
device_class: temperature
unit: "°C"
state_class: measurement
accuracy_decimals: 2
source_field: manufacturer_data
decode: { offset: 18, length: 2, type: uint16, endian: big, scale: 0.002670288, offset_value: -45 }
- key: humidity
device_class: humidity
unit: "%"
state_class: measurement
accuracy_decimals: 2
source_field: manufacturer_data
decode: { offset: 20, length: 2, type: uint16, endian: big, scale: 0.001524504 }
- key: battery
device_class: battery
unit: "%"
state_class: measurement
source_field: manufacturer_data
decode: { offset: 23, length: 1, type: uint8 }
- id: parking_beacon
name: "Parking Beacon"
description: "Shared parking beacon (manufacturer 861 / 0x035D)"
device:
id: parking_beacon
name: "Parking Beacon"
source: advertisement
instance_mode: shared
match:
manufacturer_id: 861
sensors:
- key: parking_time
device_class: timestamp
icon: mdi:clock-time-four-outline
source_field: manufacturer_data
length: 14
decode: { offset: 7, length: 4, type: timestamp }
- key: parking_floor
icon: mdi:layers-outline
source_field: manufacturer_data
length: 14
accuracy_decimals: 0
decode: { offset: 11, length: 1, type: uint8, scale: -1, offset_value: 256 }
- key: parking_location
platform: text_sensor
icon: mdi:map-marker-outline
source_field: manufacturer_data
length: 14
decode: { offset: 12, length: 2, type: string }
- id: obd_standard
name: "OBD-II (standard PIDs)"
description: "RPM, speed, coolant, fuel — bind ELM327 adapter in app"
device:
id: obd_vehicle
name: "OBD Vehicle"
source: obd
obd:
service_uuid: "FFF0"
tx_char_uuid: "FFF2"
rx_char_uuid: "FFF1"
tx_delay: 50ms
init_commands: []
sensors:
- { key: rpm, preset: rpm, update_interval: 1s }
- { key: speed, preset: speed, update_interval: 1s }
- { key: coolant_temp, preset: coolant_temp, update_interval: 10s }
- { key: fuel_level, preset: fuel_level, update_interval: 30s }
- id: obd_gm_extended
name: "OBD-II + GM extensions"
description: "Standard PIDs plus GM mode-22 sensors (ATSP6 init)"
device:
id: car_obd
name: "Vehicle OBD"
source: obd
obd:
service_uuid: "18F0"
tx_char_uuid: "2AF1"
rx_char_uuid: "2AF0"
tx_delay: 50ms
init_commands: ["ATSP6"]
sensors:
- { key: rpm, preset: rpm, update_interval: 1s }
- { key: speed, preset: speed, update_interval: 1s }
- { key: coolant_temp, preset: coolant_temp, update_interval: 10s }
- key: fuel_level
preset: fuel_level
update_interval: 30s
publish: { deadband: 0.5, min_interval: 60s }
- { key: gear, preset: gm_current_gear, update_interval: 1s }
- { key: prnd, preset: gm_prnd_status_alt, update_interval: 1s }
- { key: oil_pressure, preset: gm_oil_pressure, update_interval: 2s }
- { key: trans_temp, preset: gm_trans_temp, update_interval: 10s }
- id: obd_hyundai_kia
name: "OBD-II + 현대/기아 계기판"
description: "RPM, 속도, 총 주행거리, 연료잔량(L), 계기판 전압 — 계기판 7C6 / 22B002"
device:
id: car_obd_hk
name: "Hyundai/Kia OBD"
source: obd
obd:
service_uuid: "18F0"
tx_char_uuid: "2AF1"
rx_char_uuid: "2AF0"
tx_delay: 50ms
init_commands: ["ATSP6"]
# default_commands 생략 — 아래 ATSH7C6 센서가 있으므로 앱이 ATSH7DF로 자동 복원
sensors:
- { key: rpm, preset: rpm, update_interval: 1s }
- { key: speed, preset: speed, update_interval: 1s }
# 계기판(CLU) UDS. 요청 7C6 → 응답 7CE. 한 응답에 주행거리·연료·전압이 함께 온다.
# 응답: 62 B0 02 [a][b][c][d][e][f][g][h][i][j][k][l]…
# (a = 62B002 에코 바로 다음 바이트)
# e → 연료잔량 e*0.5 L
# f → 계기판 전압 f/12.8 = f*0.078125 V
# g:h:i → 총 주행거리 24bit km
# j:k:l → 위와 같은 주행거리의 mile 값 (북미 사양 계기판)
# 출처: OBDb(obdb.community)에서 현대·기아 11개 차종이 동일한 바이트 배치로 확인.
# awesomeit Torque 플러그인(35개 차종)·Elantra CN7 PID 목록과도 일치.
# 2013년식 이후에서 널리 동작하며, 미지원 차는 NO DATA를 반환한다.
#
# 예외: 엑센트(RB)는 계기판이 이 DID를 열지 않는다. 2013/2015/2019 실차 캡처에서
# unsupported로 확인됐고 (2018년식만 예외), 요청하면 7F 22 22를 돌려준다.
# 엑센트는 아래 obd_hyundai_accent_rb_diesel 템플릿을 쓸 것.
- key: odometer
mode: "22"
pid: "B002"
pre_commands: ["ATSH7C6"]
formula: "g*65536+h*256+i"
unit: "km"
device_class: distance
state_class: total_increasing
accuracy_decimals: 0
icon: mdi:counter
update_interval: 60s
- key: fuel_level
mode: "22"
pid: "B002"
pre_commands: ["ATSH7C6"]
formula: "e*0.5"
unit: "L"
state_class: measurement
accuracy_decimals: 1
icon: mdi:gas-station
update_interval: 30s
publish: { deadband: 0.5, min_interval: 60s }
- key: cluster_voltage
mode: "22"
pid: "B002"
pre_commands: ["ATSH7C6"]
formula: "f*0.078125"
unit: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 2
entity_category: diagnostic
update_interval: 60s
- id: obd_hyundai_accent_rb_diesel
name: "OBD-II 엑센트(RB) 디젤"
description: "RPM, 속도, 연료 %, 흡기온도, 대기압 + 총주행거리 프로브 — 엑센트 RB 1.6 TCI-U2"
device:
id: car_obd_accent
name: "Accent RB Diesel"
source: obd
obd:
service_uuid: "18F0"
tx_char_uuid: "2AF1"
rx_char_uuid: "2AF0"
tx_delay: 50ms
init_commands: ["ATSP6"]
# 아래 ATSH7E0 센서가 있으므로 표준 센서 앞에 ATSH7DF가 자동 삽입된다
sensors:
- { key: rpm, preset: rpm, update_interval: 1s }
- { key: speed, preset: speed, update_interval: 1s }
# 연료량은 이 차에서 읽을 방법이 없다. 표준 01 2F는 실차에서 NO DATA를
# 돌려주고(OBDb 캡처는 북미 가솔린 기준이라 디젤에는 맞지 않았다),
# 계기판 22B002도 7F 22 22로 거부한다.
# awesomeit 엑센트RB 2013 D 1.6 TCI-U2 프로필에서 확인된 값들
- key: intake_temp
mode: "21"
pid: "01"
pre_commands: ["ATSH7E0"]
formula: "k*0.980392-50"
unit: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
update_interval: 10s
- key: barometric_pressure
mode: "21"
pid: "01"
pre_commands: ["ATSH7E0"]
formula: "j*1.372549"
unit: "kPa"
device_class: pressure
state_class: measurement
accuracy_decimals: 1
update_interval: 30s
# ── 총주행거리 (엔진 ECU의 DPF 블록에 같이 실려 온다) ──────────────
# 엑센트 RB는 계기판(7C6 / 22B002)이 주행거리를 열지 않는다 — 요청하면 7F 22 22.
# 대신 엔진 ECU의 21 03 블록에 있다 (OBDb 메이커 공용 HYUNDAI_ODO_V2):
# byte 49~52 마지막 DPF 재생 시점의 주행거리 /1000 km
# byte 53~56 재생 이후 달린 거리 /1000 km
# byte 57~60 총주행거리 /1000 km ← 목표
# 셋은 서로 다른 필드다. awesomeit이 "DPF 주행거리"로 부르는 건 byte 53(재생 후 거리).
# 그 프로필이 같은 21 03에서 byte 53~55를 읽으므로, 이 차의 응답은 최소
# byte 55까지 도착한다 — 목표는 두 바이트 뒤다.
#
# 응답이 byte 57까지 도착하지 않으면 decode가 null을 돌려주고 아무것도
# 발행되지 않는다 — 미지원 차에서 엉뚱한 값이 올라오지 않는다.
#
# offset_value = -1436.5 는 계기판 대조 보정이다. 2026-07-30 실측에서
# ECU 카운터 197394.5 km, 계기판 195958 km 로 0.733% 높게 나왔다.
# 이 카운터는 DPF 서비스 주기용이라 법정 계기판 수치와 별개로 관리되고,
# 속도 신호원이 달라 장기간에 걸쳐 벌어진다.
# 측정이 한 번뿐이라 상수 오차인지 비례 오차인지 구분되지 않아 우선 상수로 뒀다.
# 100km 이상 주행 후 재확인할 것:
# 차이가 1436.5 그대로면 상수가 맞고, 1437.2 근처로 늘면 비례이므로
# offset_value 를 빼고 scale 을 0.000992723 으로 바꾼다.
- key: odometer
mode: "21"
pid: "03"
pre_commands: ["ATSH7E0"]
decode: { offset: 57, length: 4, type: uint32, endian: big, scale: 0.001, offset_value: -1436.5 }
unit: "km"
device_class: distance
state_class: total_increasing
accuracy_decimals: 1
icon: mdi:counter
update_interval: 60s
# 검산용: 재생시점 주행거리 + 재생후 거리 = 총주행거리.
# 재생시점 값도 같은 ECU 카운터라 위와 같은 보정을 걸어야 이 관계가 유지된다.
# 재생후 거리는 차분이라 편향이 없으므로 보정하지 않는다.
- key: odometer_at_last_dpf_regen
mode: "21"
pid: "03"
pre_commands: ["ATSH7E0"]
decode: { offset: 49, length: 4, type: uint32, endian: big, scale: 0.001, offset_value: -1436.5 }
unit: "km"
device_class: distance
state_class: total_increasing
accuracy_decimals: 1
entity_category: diagnostic
update_interval: 60s
- key: distance_since_dpf_regen
mode: "21"
pid: "03"
pre_commands: ["ATSH7E0"]
decode: { offset: 53, length: 4, type: uint32, endian: big, scale: 0.001 }
unit: "km"
device_class: distance
state_class: measurement
accuracy_decimals: 1
entity_category: diagnostic
update_interval: 60s
# ── 계기판 일치 오도미터 탐색용 프로브 (확인 끝나면 이 블록만 지울 것) ──
#
# 위 odometer 는 엔진 ECU 카운터라 계기판보다 1436.5 km 높고 offset_value 로
# 맞춰둔 상태다. 7E0 의 다른 블록을 더 뒤져도 같은 카운터라 편향이 같으므로,
# 계기판 값을 얻으려면 독립된 ECU(계기판 7C6 / 변속기 7E1)를 봐야 한다.
#
# 배제된 것 — 다시 넣지 말 것:
# 22 B002 @ 7C6 이 차가 7F 22 22 (conditionsNotCorrect)로 직접 거부.
# OBDb 실차 캡처도 2013/2015/2019 엑센트 unsupported.
# 01 2F 연료량. NO DATA. 오도미터와 무관하지만 재시도 방지용 기록.
#
# 주의: OBDb 의 엑센트 캡처는 북미 가솔린 차량이라 이 디젤을 대변하지 못한다.
# 실제로 7E0.2103 이 거기서는 unsupported 인데 이 차에서는 동작한다.
# 그래서 아래 후보들은 캡처로 배제하지 않고 실차에서 직접 확인한다.
#
# 계기판(7C6) 과 변속기(7E1) 는 바이트 배치가 알려져 있지 않다. awesomeit(2000여 개
# 차량 설정)에도 OBDb 에도 7C6 에는 22B002 하나뿐이라 참고할 공식이 없다.
# 그래서 오프셋을 훑는다. decode 는 offset+length 가 응답 범위를 넘으면 null 을
# 돌려주고 아무것도 발행하지 않으므로, 존재하지 않는 오프셋은 그냥 빈 채로 남는다.
#
# 길이 3 + uint32 는 24bit 읽기다 (toLong 이 slice 길이만큼만 시프트한다).
# 이 플랫폼의 계기판 오도미터는 22B002 에서 24bit·스케일 1(km) 형태이므로
# 같은 형태로 찾는다. 엔진 쪽 32bit/1000 형태는 이미 odometer 센서가 쓰고 있다.
#
# 찾을 값: 195958 km = 0x02FD76. 이 값을 보이는 센서 하나만 남기고
# 나머지 odo_* 와 probe_* 는 전부 지우면 된다.
#
# 22 B001 / 22 B003 은 응답 여부조차 모르므로 우선 존재만 확인한다.
# 응답하면 그 hex 를 보고 같은 방식으로 스캔을 붙인다.
- key: probe_7c6_22b001
mode: "22"
pid: "B001"
pre_commands: ["ATSH7C6"]
formula: "a"
entity_category: diagnostic
update_interval: 120s
- key: probe_7c6_22b003
mode: "22"
pid: "B003"
pre_commands: ["ATSH7C6"]
formula: "a"
entity_category: diagnostic
update_interval: 120s
# 2101 @ 7C6 — offset 0~15 훑기
- { key: odo_7c6_2101_00, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 0, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_01, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 1, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_02, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 2, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_03, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 3, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_04, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 4, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_05, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 5, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_06, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 6, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_07, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 7, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_08, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 8, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_09, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 9, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_10, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 10, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_11, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 11, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_12, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 12, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_13, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 13, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_14, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 14, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7c6_2101_15, mode: "21", pid: "01", pre_commands: ["ATSH7C6"],
decode: { offset: 15, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
# 21A0 @ 7E1 — offset 0~15 훑기
- { key: odo_7e1_21a0_00, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 0, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_01, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 1, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_02, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 2, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_03, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 3, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_04, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 4, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_05, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 5, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_06, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 6, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_07, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 7, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_08, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 8, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_09, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 9, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_10, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 10, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_11, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 11, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_12, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 12, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_13, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 13, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_14, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 14, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
- { key: odo_7e1_21a0_15, mode: "21", pid: "A0", pre_commands: ["ATSH7E1"],
decode: { offset: 15, length: 3, type: uint32, endian: big },
unit: "km", state_class: measurement, accuracy_decimals: 0,
entity_category: diagnostic, update_interval: 120s }
# 표준 오도미터 PID (SAE J1979). 2013 엑센트의 mode 01 지원 목록이 0145 에서
# 끊겨 가능성은 낮지만, 되면 그대로 계기판 값이다. 공식은 표준이라 확정이다.
- key: odometer_standard
preset: odometer
entity_category: diagnostic
update_interval: 60s
# ── 변속기(TCU) 21A0 @ 7E1 ────────────────────────────────────────
# awesomeit 엑센트RB 2013 D 1.6 TCI-U2 프로필의 공식 그대로다. 이 블록이
# 이 차에 존재한다는 뜻이므로 프로브가 아니라 실센서로 넣는다.
# 응답하면 오도미터 탐색용 raw hex 도 같이 확보된다.
# N(byte 13) 미션오일온도, U(byte 20) 기어위치, V(byte 21) 기어단수
- key: trans_oil_temp
mode: "21"
pid: "A0"
pre_commands: ["ATSH7E1"]
formula: "n-40"
unit: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
icon: mdi:oil-temperature
update_interval: 10s
- key: gear_position
mode: "21"
pid: "A0"
pre_commands: ["ATSH7E1"]
platform: text_sensor
icon: mdi:car-shift-pattern
decode:
offset: 20
length: 1
type: uint8
map:
"8": "D"
"9": "N"
"10": "R"
"11": "P"
"12": "Sport"
"16": "E Mode"
update_interval: 1s
- key: gear
mode: "21"
pid: "A0"
pre_commands: ["ATSH7E1"]
platform: text_sensor
icon: mdi:numeric
decode:
offset: 21
length: 1
type: uint8
map:
"0": "P/N"
"1": "1"
"2": "2"
"3": "3"
"4": "4"
"5": "5"
"6": "6"
"7": "7"
"8": "8"
update_interval: 1s
- id: gatt_meter_relay
name: "GATT power meter + relay"
description: "Notify characteristic + switch control example"
device:
id: custom_meter
name: "Custom BLE Meter"
source: gatt_notify
gatt:
service_uuid: "ffe0"
notify_char_uuid: "ffe1"
write_char_uuid: "ffe2"
sensors:
- key: power
unit: "W"
device_class: power
state_class: measurement
decode: { offset: 0, length: 2, type: uint16, endian: little }
controls:
- key: relay
type: switch
command: { on: "A10100", off: "A10000" }