1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-17 17:23:45 +01:00

Native ESP32 CAN support (#1629)

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Sympatron GmbH
2022-01-11 19:54:35 +00:00
committed by GitHub
parent 27364ee72c
commit 5026bc7a78
6 changed files with 217 additions and 0 deletions

View File

@@ -2472,6 +2472,11 @@ text_sensor:
id: glob_int
value: '0'
- canbus.send:
canbus_id: mcp2515_can
can_id: 23
data: [0x10, 0x20, 0x30]
- canbus.send:
canbus_id: esp32_internal_can
can_id: 23
data: [0x10, 0x20, 0x30]
- platform: template
@@ -2509,6 +2514,7 @@ rtttl:
canbus:
- platform: mcp2515
id: mcp2515_can
cs_pin: GPIO17
can_id: 4
bit_rate: 50kbps
@@ -2525,6 +2531,25 @@ canbus:
lambda: 'return x[0] == 0x11;'
then:
light.toggle: ${roomname}_lights
- platform: esp32_can
id: esp32_internal_can
rx_pin: GPIO04
tx_pin: GPIO05
can_id: 4
bit_rate: 50kbps
on_frame:
- can_id: 500
then:
- lambda: |-
std::string b(x.begin(), x.end());
ESP_LOGD("canid 500", "%s", &b[0] );
- can_id: 23
then:
- if:
condition:
lambda: 'return x[0] == 0x11;'
then:
light.toggle: ${roomname}_lights
teleinfo:
id: myteleinfo