Archived
243 lines
11 KiB
YAML
243 lines
11 KiB
YAML
# HassBle Configuration File
|
|
#
|
|
# Host config.yaml and templates.yaml in a Git repository (e.g., GitHub).
|
|
# In the HassBle app: enter owner/repo and branch (e.g. eigger/hassble-config, main).
|
|
# The app loads config.yaml for the gateway and templates.yaml for Import template.
|
|
#
|
|
# Do NOT put any Home Assistant credentials (URL/Token) in this file. Enter them in the app.
|
|
|
|
version: 1
|
|
|
|
defaults:
|
|
publish:
|
|
on_change_only: true
|
|
min_interval: 10s
|
|
|
|
devices:
|
|
# ──────────────────────────────────────────────────────────────
|
|
# Path A: BLE Passive Scanning (Advertisements)
|
|
# ──────────────────────────────────────────────────────────────
|
|
# Jaalee JHT — instance_mode: mac → 스캔된 MAC마다 jaalee_jht_{MAC} 엔티티 자동 생성
|
|
# Ref: https://github.com/eigger/espcomponents/tree/master/components/jaalee_jht
|
|
# Temp/Humidity formula: https://sensor.jaalee.com/scan_api.html
|
|
#- id: jaalee_jht
|
|
# name: "Jaalee JHT"
|
|
# source: advertisement
|
|
# instance_mode: mac
|
|
# match:
|
|
# manufacturer_id: 76 # Apple Inc. (0x004C) — decimal 사용 필수 (hex 0x... 파싱 불안정)
|
|
# manufacturer_min_length: 24
|
|
# manufacturer_hex_prefix: "0215" # iBeacon 타입 마커 (0x02=subtype, 0x15=length 21)
|
|
# 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 }
|
|
|
|
# 지하주차장 위치 요청 비콘 (BLE 광고 송신 및 수신 예제)
|
|
# UUID는 본인의 패킷 캡처에서 추출한 고유값으로 교체하세요.
|
|
#- id: mytown_parking
|
|
# name: "마이타운 주차위치"
|
|
# source: advertisement
|
|
# instance_mode: shared # 기둥 MAC이 매번 달라도 엔티티 1벌 유지
|
|
# match:
|
|
# manufacturer_id: 861 # 0x035D — kaml 파싱을 위해 10진수(decimal) 사용 권장
|
|
# manufacturer_hex_prefix: "06" # 06 응답 포맷 (본인 16B UUID 접두사)
|
|
# manufacturer_min_length: 18
|
|
# advertise:
|
|
# manufacturer_id: 861
|
|
# payload: "05<본인_16BYTE_UUID_HEX>40{counter:02X}"
|
|
# counter_mode: reset # reset(기본) | persist
|
|
# counter_start: 0 # reset 모드 시작값 (기본 0)
|
|
# mode: balanced # low_power | balanced | low_latency
|
|
# tx_power: high # ultra_low | low | medium | high
|
|
# timeout: 15s # 이 시간 지나면 자동 송신 중단
|
|
# repeat_interval: 1s # (선택) 이 주기로 payload 갱신 = counter 증가
|
|
# stop_on_response: true # 06 응답 수신 시 즉시 송신 중단
|
|
# controls:
|
|
# - key: request_location
|
|
# type: button
|
|
# name: "주차위치 요청"
|
|
# action: advertise # command 대신 앱 내부 광고 송신 동작 실행
|
|
# icon: mdi:car-search
|
|
# sensors:
|
|
# - key: parking_floor
|
|
# platform: text_sensor
|
|
# icon: mdi:layers-outline
|
|
# source_field: manufacturer_data
|
|
# decode:
|
|
# offset: 17
|
|
# length: 1
|
|
# type: uint8
|
|
# map:
|
|
# "251": "B5"
|
|
# "252": "B4"
|
|
# "253": "B3"
|
|
# "254": "B2"
|
|
# "255": "B1"
|
|
# "0": "LB"
|
|
# "1": "1F"
|
|
# "2": "2F"
|
|
# "3": "3F"
|
|
# - key: parking_location
|
|
# platform: text_sensor
|
|
# icon: mdi:map-marker-outline
|
|
# source_field: manufacturer_data
|
|
# decode: { offset: 18, length: 0, type: string }
|
|
|
|
# Parking beacon — instance_mode: shared → MAC 무관, manufacturer 0x035D 광고가 하나의 엔티티 공유
|
|
# 요청 6바이트: [0]=02 [1]=05 [2]=00 [3]=battery [4]=state [5]=counter
|
|
# 응답 14바이트: [0]=04(응답타입), [1..6]=KeyMAC, [7..10]=월·일·시·분, [11]=층(256-raw), [12..13]=구역코드
|
|
# 04xx: 주차위치 응답 비콘, 07xx: SmartKey 인증(22B 암호화), 02xx: 출입 이벤트(6B) — prefix "04" 로 응답만 매칭
|
|
- id: parking_beacon
|
|
name: "Parking Beacon"
|
|
source: advertisement
|
|
instance_mode: shared
|
|
match:
|
|
manufacturer_id: 861 # 0x035D
|
|
manufacturer_hex_prefix: "04" # 응답 비콘만 매칭 (07=SmartKey 인증, 02=출입 이벤트 제외)
|
|
manufacturer_min_length: 14 # 최소 14바이트
|
|
advertise:
|
|
manufacturer_id: 861 # 0x035D
|
|
# 02 05 00 | battery 100% | {state} | {counter} — 카운터는 버튼마다 +1, 버스트 중 고정
|
|
payload: "02050064{state:02X}{counter:02X}"
|
|
counter_mode: persist # 요청마다 누적. 0xFF 다음은 0
|
|
counter_start: 0
|
|
mode: low_latency # ~100ms → press 200ms 동안 약 1~2패킷
|
|
tx_power: high
|
|
timeout: 4s # 페이즈 합(3.2s)보다 약간 큰 상한
|
|
payload_phases:
|
|
- state: 65 # 0x41 버튼 누름 + ACK 대기
|
|
duration: 200ms
|
|
- state: 64 # 0x40 홀드 + ACK 대기
|
|
duration: 3s
|
|
stop_on_response: true
|
|
controls:
|
|
- key: request_location
|
|
type: button
|
|
name: "주차위치 요청"
|
|
action: advertise
|
|
icon: mdi:car-search
|
|
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 }
|
|
|
|
# APT SmartKey 출입문 이벤트 — 고정 MAC으로 하드웨어 필터, 02xx 6바이트 패킷만 파싱
|
|
# payload 6바이트: [0]=02(이벤트타입), [1..3]=05 00 55, [4]=상태, [5]=카운터
|
|
# byte[4] 상태값: 0x41(65)=entering_start, 0x01(1)=entering, 0x40(64)=exiting, 0x00(0)=idle
|
|
# 0x41→0x01 두 값 모두 "entering"으로 매핑 → on_change_only가 중간 전환 노이즈 제거
|
|
- id: apt_key_door
|
|
name: "APT Door Event"
|
|
source: advertisement
|
|
instance_mode: shared
|
|
match:
|
|
manufacturer_id: 861 # 0x035D
|
|
manufacturer_hex_prefix: "02" # 출입 이벤트 타입만 (07xx=인증 22B, 04xx=주차응답 14B 제외)
|
|
sensors:
|
|
- key: door_status
|
|
platform: text_sensor
|
|
icon: mdi:door
|
|
source_field: manufacturer_data
|
|
length: 6
|
|
publish:
|
|
min_interval: 1s # 기본 10s 오버라이드 — 이벤트가 수 초 내 전환됨
|
|
decode:
|
|
offset: 4
|
|
length: 1
|
|
type: uint8
|
|
map:
|
|
"65": "entering" # 0x41 인증 시작
|
|
"1": "entering" # 0x01 인증 완료 (entering과 동일 → 전환 노이즈 제거)
|
|
"64": "exiting" # 0x40
|
|
"0": "idle" # 0x00
|
|
|
|
# ──────────────────────────────────────────────────────────────
|
|
# Path C: OBD (ELM327) over BLE
|
|
# ──────────────────────────────────────────────────────────────
|
|
- 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: engine_load, preset: engine_load, update_interval: 1s }
|
|
#- { key: throttle, preset: throttle, update_interval: 1s }
|
|
#- { key: coolant_temp, preset: coolant_temp, update_interval: 10s }
|
|
#- { key: intake_temp, preset: intake_air_temp, update_interval: 10s }
|
|
#- { key: ambient_temp, preset: ambient_temp, update_interval: 30s }
|
|
- { key: battery, preset: battery_voltage, update_interval: 10s }
|
|
- { key: run_time, preset: run_time, update_interval: 5s }
|
|
- { key: odometer, preset: odometer, update_interval: 30s }
|
|
- key: fuel_level
|
|
preset: fuel_level
|
|
update_interval: 30s
|
|
publish:
|
|
deadband: 0.5
|
|
min_interval: 60s
|
|
# GM Extensions (mode 22)
|
|
#- { key: gear, preset: gm_current_gear, update_interval: 1s }
|
|
#- { key: prnd, preset: gm_prnd_status_alt, update_interval: 1s }
|
|
#- { key: torque, preset: actual_torque, update_interval: 1s }
|
|
#- { key: oil_pressure, preset: gm_oil_pressure, update_interval: 2s }
|
|
#- { key: trans_temp, preset: gm_trans_temp, update_interval: 10s }
|
|
|
|
# ──────────────────────────────────────────────────────────────
|
|
# Path B: GATT Notify & Write (Bi-directional Control)
|
|
# ──────────────────────────────────────────────────────────────
|
|
#- 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" }
|