Files
esphome-configs/mcu-nrf-dk.yaml
T
randy 3f9a8c3117
CI / YAML lint (push) Successful in 8s
CI / ESPHome config validation (push) Successful in 50s
nrf-ant: Garmin HRM-Dual, HRM-Tri, Rally RS200, Speed Sensor 2, SRAM Force AXS
Also sets the unused UART1 RX to P1.02: without it the fork keeps the DK's
default RX pin, P1.01, and the UART hears its own transmissions.
2026-09-30 22:13:33 +02:00

294 lines
8.2 KiB
YAML

---
# Hardware: Nordic nRF52840 DK
# Pinout:
# P0.11 Button 1 (active low) -> Button 1 (binary_sensor gpio)
# P0.12 Button 2 (active low) -> Button 2 (binary_sensor gpio)
# P0.13 LED 1 (active low) -> LED 1 (light binary)
# P0.14 LED 2 (active low) -> LED 2 (light binary)
# P0.15 LED 3 (active low) -> LED 3 (light binary)
# P0.16 LED 4 (active low) -> LED 4 (light binary)
# P0.24 Button 3 (active low) -> Button 3 (binary_sensor gpio)
# P0.25 Button 4 (active low) -> Button 4 (binary_sensor gpio)
# P1.01 UART1 RX <- mcu-nrf-ant UART1 TX (P1.01), packet_transport; plus GND
# ANT+ values (Garmin HRM-Pro, Concept2 PM5, Garmin Tempe, Garmin Varia RTL515) come from mcu-nrf-ant
esphome:
name: mcu-nrf-dk
friendly_name: nRF DK
# needs the esphomeplatformzephyr fork (esphome-zephyr), upstream has no zephyr: platform yet
zephyr:
variant: NRF52
board: nrf52840dk/nrf52840
framework:
type: zephyr
logger:
network:
enable_ipv6: true
# Active dataset of the Thread network (HA: Settings > Thread > ... > dataset TLV)
openthread:
tlv: !secret thread_tlv
# end device, doesn't route for others; saves flash (FTD fills the MCUboot slot)
device_type: MTD
api:
encryption:
key: !secret api_key
# ANT+ values from mcu-nrf-ant (second nRF52840 DK) over UART
uart:
id: ant_link
port: UART1
rx_pin: P1.01
baud_rate: 115200
packet_transport:
- platform: uart
uart_id: ant_link
providers:
- name: mcu-nrf-ant
sensor:
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: hrm_pro_heart_rate
name: Garmin HRM-Pro Heart Rate
internal: false
unit_of_measurement: bpm
icon: mdi:heart-pulse
filters:
- throttle: 1s
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: hrm_pro_battery
name: Garmin HRM-Pro Battery
internal: false
unit_of_measurement: "%"
device_class: battery
entity_category: diagnostic
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: pm5_power
name: Concept2 PM5 Power
internal: false
unit_of_measurement: W
device_class: power
filters:
- throttle: 1s
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: pm5_stroke_rate
name: Concept2 PM5 Stroke Rate
internal: false
unit_of_measurement: spm
icon: mdi:rowing
filters:
- throttle: 1s
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: tempe_temperature
name: Garmin Tempe Temperature
internal: false
unit_of_measurement: °C
device_class: temperature
accuracy_decimals: 1
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: tempe_temperature_min
name: Garmin Tempe Temperature 24h Min
internal: false
unit_of_measurement: °C
device_class: temperature
accuracy_decimals: 1
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: tempe_temperature_max
name: Garmin Tempe Temperature 24h Max
internal: false
unit_of_measurement: °C
device_class: temperature
accuracy_decimals: 1
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: tempe_battery
name: Garmin Tempe Battery
internal: false
unit_of_measurement: V
device_class: voltage
accuracy_decimals: 2
entity_category: diagnostic
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: varia_battery
name: Garmin Varia RTL515 Battery
internal: false
unit_of_measurement: V
device_class: voltage
accuracy_decimals: 2
entity_category: diagnostic
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: hrm_dual_heart_rate
name: Garmin HRM-Dual Heart Rate
internal: false
unit_of_measurement: bpm
icon: mdi:heart-pulse
filters:
- throttle: 1s
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: hrm_dual_battery
name: Garmin HRM-Dual Battery
internal: false
unit_of_measurement: "%"
device_class: battery
entity_category: diagnostic
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: hrm_tri_heart_rate
name: Garmin HRM-Tri Heart Rate
internal: false
unit_of_measurement: bpm
icon: mdi:heart-pulse
filters:
- throttle: 1s
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: hrm_tri_battery
name: Garmin HRM-Tri Battery
internal: false
unit_of_measurement: "%"
device_class: battery
entity_category: diagnostic
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: rally_power
name: Garmin Rally RS200 Power
internal: false
unit_of_measurement: W
device_class: power
filters:
- throttle: 1s
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: rally_cadence
name: Garmin Rally RS200 Cadence
internal: false
unit_of_measurement: rpm
icon: mdi:rotate-right
filters:
- throttle: 1s
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: speed2_speed
name: Garmin Speed Sensor 2 Speed
internal: false
unit_of_measurement: m/s
device_class: speed
accuracy_decimals: 2
filters:
- throttle: 1s
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: speed2_battery
name: Garmin Speed Sensor 2 Battery
internal: false
unit_of_measurement: V
device_class: voltage
accuracy_decimals: 2
entity_category: diagnostic
output:
- platform: gpio
id: led_1_out
pin: {number: P0.13, inverted: true}
- platform: gpio
id: led_2_out
pin: {number: P0.14, inverted: true}
- platform: gpio
id: led_3_out
pin: {number: P0.15, inverted: true}
- platform: gpio
id: led_4_out
pin: {number: P0.16, inverted: true}
light:
- {platform: binary, name: LED 1, id: led_1, output: led_1_out}
- {platform: binary, name: LED 2, id: led_2, output: led_2_out}
- {platform: binary, name: LED 3, id: led_3, output: led_3_out}
- {platform: binary, name: LED 4, id: led_4, output: led_4_out}
# each button toggles its LED locally and is visible in HA
binary_sensor:
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: ant_connected
name: ANT+ Connected
internal: false
device_class: connectivity
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: ant_unknown_device
name: ANT+ Unknown Device
internal: false
icon: mdi:access-point
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: pm5_in_use
name: Concept2 PM5 In Use
internal: false
device_class: running
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: tempe_battery_low
name: Garmin Tempe Battery Low
internal: false
device_class: battery
entity_category: diagnostic
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: varia_battery_low
name: Garmin Varia RTL515 Battery Low
internal: false
device_class: battery
entity_category: diagnostic
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: rally_battery_low
name: Garmin Rally RS200 Battery Low
internal: false
device_class: battery
entity_category: diagnostic
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: speed2_battery_low
name: Garmin Speed Sensor 2 Battery Low
internal: false
device_class: battery
entity_category: diagnostic
- platform: packet_transport
provider: mcu-nrf-ant
remote_id: sram_battery_low
name: SRAM Force AXS Battery Low
internal: false
device_class: battery
entity_category: diagnostic
- platform: gpio
name: Button 1
pin: {number: P0.11, inverted: true, mode: {input: true, pullup: true}}
on_press: {light.toggle: led_1}
- platform: gpio
name: Button 2
pin: {number: P0.12, inverted: true, mode: {input: true, pullup: true}}
on_press: {light.toggle: led_2}
- platform: gpio
name: Button 3
pin: {number: P0.24, inverted: true, mode: {input: true, pullup: true}}
on_press: {light.toggle: led_3}
- platform: gpio
name: Button 4
pin: {number: P0.25, inverted: true, mode: {input: true, pullup: true}}
on_press: {light.toggle: led_4}