Add new CANOpen test devices

This commit is contained in:
2025-01-21 13:01:57 +01:00
parent a0c5bc4a0c
commit 1e38d96c2d
2 changed files with 182 additions and 0 deletions

91
mcu-can-node-1.yaml Normal file
View File

@@ -0,0 +1,91 @@
substitutions:
device: can-node-1
name: CAN Node 1
comment: "DEV"
esphome:
name: mcu-${device}
comment: ${comment}
esp32:
board: esp32dev
framework:
# type: arduino
type: esp-idf
# version: 5.1.2
# platform_version: 6.5.0
external_components:
- source: github://mrk-its/esphome-canopen@dev
refresh: 1h
packages:
common: !include common/common.yaml
canbus:
- platform: esp32_can
id: can_bus
rx_pin: 22
tx_pin: 23
can_id: 0
bit_rate: 125kbps
canopen:
id: can_gate
canbus_id: can_bus
node_id: 1
entities:
- id: boot
index: 1
tpdo: 0
- id: blue_led
index: 2
tpdo: 0
- id: uptime_sensor
index: 3
tpdo: 0
- id: cover1
index: 4
tpdo: 1
# - id: cover2
# index: 5
# tpdo: 1
sensor:
- platform: uptime
id: uptime_sensor
name: "${name} Uptime"
update_interval: 5sec
internal: true
binary_sensor:
- platform: gpio
name: "${name} Boot"
id: boot
internal: true
pin:
number: 0
inverted: true
switch:
- platform: gpio
name: "${name} Led"
id: blue_led
internal: true
pin: 2
cover:
- platform: time_based
name: "${name} Cover"
id: cover1
internal: true
device_class: shutter
has_built_in_endstop: true
open_action:
- logger.log: open_action
open_duration: 10s
close_action:
- logger.log: close_action
close_duration: 10s
stop_action:
- logger.log: stop_action