mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-12-06 09:06:52 +01:00
nrf: packet_interface link with reliability and session, add Tacx Neo 2
The DK <-> ANT UART link now runs packet_transport over packet_interface: HDLC retransmits lost frames and the session layer reports in HA whether mcu-nrf-ant is reachable (ANT Link). Tacx Neo 2 (FE-C, ANT ID 13888) publishes power, cadence and in use.
This commit is contained in:
1 parent
0383ea9871
commit
9c20f605d2
2 files changed
+62
-3
No files matched your search
+24
-1
@@ -20,6 +20,7 @@
|
|||||||
# 886796 Garmin Rally RS200 power + cadence
|
# 886796 Garmin Rally RS200 power + cadence
|
||||||
# 343922 Garmin Speed Sensor 2 speed
|
# 343922 Garmin Speed Sensor 2 speed
|
||||||
# 42898 SRAM Force AXS shifting (Cube Litening C:68X), battery only
|
# 42898 SRAM Force AXS shifting (Cube Litening C:68X), battery only
|
||||||
|
# 13888 Tacx Neo 2 fitness equipment (FE-C), basement trainer
|
||||||
esphome:
|
esphome:
|
||||||
name: mcu-nrf-ant
|
name: mcu-nrf-ant
|
||||||
friendly_name: nRF ANT+
|
friendly_name: nRF ANT+
|
||||||
@@ -141,6 +142,17 @@ ant_plus:
|
|||||||
battery_low:
|
battery_low:
|
||||||
id: speed2_battery_low
|
id: speed2_battery_low
|
||||||
name: Garmin Speed Sensor 2 Battery Low
|
name: Garmin Speed Sensor 2 Battery Low
|
||||||
|
- type: fitness_equipment # Tacx Neo 2
|
||||||
|
device_number: 13888
|
||||||
|
power:
|
||||||
|
id: neo_power
|
||||||
|
name: Tacx Neo 2 Power
|
||||||
|
cadence:
|
||||||
|
id: neo_cadence
|
||||||
|
name: Tacx Neo 2 Cadence
|
||||||
|
in_use:
|
||||||
|
id: neo_in_use
|
||||||
|
name: Tacx Neo 2 In Use
|
||||||
- type: shifting # SRAM Force AXS (Cube Litening C:68X)
|
- type: shifting # SRAM Force AXS (Cube Litening C:68X)
|
||||||
device_number: 42898
|
device_number: 42898
|
||||||
battery_low:
|
battery_low:
|
||||||
@@ -155,9 +167,17 @@ uart:
|
|||||||
rx_pin: P1.01
|
rx_pin: P1.01
|
||||||
baud_rate: 115200
|
baud_rate: 115200
|
||||||
|
|
||||||
packet_transport:
|
# same layers as mcu-nrf-dk, both ends must match
|
||||||
|
packet_interface:
|
||||||
- platform: uart
|
- platform: uart
|
||||||
|
id: link_packets
|
||||||
uart_id: link
|
uart_id: link
|
||||||
|
reliability:
|
||||||
|
session:
|
||||||
|
|
||||||
|
packet_transport:
|
||||||
|
- platform: packet_interface
|
||||||
|
packet_interface: link_packets
|
||||||
update_interval: 1s
|
update_interval: 1s
|
||||||
sensors:
|
sensors:
|
||||||
- hrm_pro_heart_rate
|
- hrm_pro_heart_rate
|
||||||
@@ -177,6 +197,8 @@ packet_transport:
|
|||||||
- rally_cadence
|
- rally_cadence
|
||||||
- speed2_speed
|
- speed2_speed
|
||||||
- speed2_battery
|
- speed2_battery
|
||||||
|
- neo_power
|
||||||
|
- neo_cadence
|
||||||
binary_sensors:
|
binary_sensors:
|
||||||
- ant_connected
|
- ant_connected
|
||||||
- ant_unknown_device
|
- ant_unknown_device
|
||||||
@@ -186,3 +208,4 @@ packet_transport:
|
|||||||
- rally_battery_low
|
- rally_battery_low
|
||||||
- speed2_battery_low
|
- speed2_battery_low
|
||||||
- sram_battery_low
|
- sram_battery_low
|
||||||
|
- neo_in_use
|
||||||
+38
-2
@@ -13,7 +13,7 @@
|
|||||||
# P0.25 Button 4 (active low) -> Button 4 (binary_sensor gpio)
|
# P0.25 Button 4 (active low) -> Button 4 (binary_sensor gpio)
|
||||||
# P1.01 UART1 RX <- mcu-nrf-ant UART1 TX (P1.02), packet_transport; plus GND
|
# P1.01 UART1 RX <- mcu-nrf-ant UART1 TX (P1.02), packet_transport; plus GND
|
||||||
# P1.02 UART1 TX -> mcu-nrf-ant UART1 RX (P1.01), packet_transport
|
# P1.02 UART1 TX -> mcu-nrf-ant UART1 RX (P1.01), packet_transport
|
||||||
# ANT+ values (Garmin HRM-Pro, Concept2 PM5, Garmin Tempe, Garmin Varia RTL515) come from mcu-nrf-ant
|
# ANT+ values (Garmin HRM-Pro, Concept2 PM5, Garmin Tempe, Garmin Varia RTL515, Tacx Neo 2, ...) come from mcu-nrf-ant
|
||||||
esphome:
|
esphome:
|
||||||
name: mcu-nrf-dk
|
name: mcu-nrf-dk
|
||||||
friendly_name: nRF DK
|
friendly_name: nRF DK
|
||||||
@@ -49,9 +49,21 @@ uart:
|
|||||||
tx_pin: P1.02
|
tx_pin: P1.02
|
||||||
baud_rate: 115200
|
baud_rate: 115200
|
||||||
|
|
||||||
packet_transport:
|
# retransmits lost frames; the session's keep-alives show whether mcu-nrf-ant is reachable
|
||||||
|
packet_interface:
|
||||||
- platform: uart
|
- platform: uart
|
||||||
|
id: ant_link_packets
|
||||||
uart_id: ant_link
|
uart_id: ant_link
|
||||||
|
reliability:
|
||||||
|
session:
|
||||||
|
binary_sensor:
|
||||||
|
name: ANT Link
|
||||||
|
device_class: connectivity
|
||||||
|
entity_category: diagnostic
|
||||||
|
|
||||||
|
packet_transport:
|
||||||
|
- platform: packet_interface
|
||||||
|
packet_interface: ant_link_packets
|
||||||
providers:
|
providers:
|
||||||
- name: mcu-nrf-ant
|
- name: mcu-nrf-ant
|
||||||
|
|
||||||
@@ -204,6 +216,24 @@ sensor:
|
|||||||
device_class: voltage
|
device_class: voltage
|
||||||
accuracy_decimals: 2
|
accuracy_decimals: 2
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
|
- platform: packet_transport
|
||||||
|
provider: mcu-nrf-ant
|
||||||
|
remote_id: neo_power
|
||||||
|
name: Tacx Neo 2 Power
|
||||||
|
internal: false
|
||||||
|
unit_of_measurement: W
|
||||||
|
device_class: power
|
||||||
|
filters:
|
||||||
|
- throttle: 1s
|
||||||
|
- platform: packet_transport
|
||||||
|
provider: mcu-nrf-ant
|
||||||
|
remote_id: neo_cadence
|
||||||
|
name: Tacx Neo 2 Cadence
|
||||||
|
internal: false
|
||||||
|
unit_of_measurement: rpm
|
||||||
|
icon: mdi:rotate-right
|
||||||
|
filters:
|
||||||
|
- throttle: 1s
|
||||||
|
|
||||||
output:
|
output:
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
@@ -280,6 +310,12 @@ binary_sensor:
|
|||||||
internal: false
|
internal: false
|
||||||
device_class: battery
|
device_class: battery
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
|
- platform: packet_transport
|
||||||
|
provider: mcu-nrf-ant
|
||||||
|
remote_id: neo_in_use
|
||||||
|
name: Tacx Neo 2 In Use
|
||||||
|
internal: false
|
||||||
|
device_class: running
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
name: Button 1
|
name: Button 1
|
||||||
pin: {number: P0.11, inverted: true, mode: {input: true, pullup: true}}
|
pin: {number: P0.11, inverted: true, mode: {input: true, pullup: true}}
|
||||||
|
|||||||
Reference in new issue
Block a user