I’m trying to programmatically change the can_id, it’s not templatable, and you can’t use globals or variables it wants nothing but a int, which doesn’t work for me.
Options?
Is there any way to send CAN messages directly from lambda, eg without using canbus.send?
There is this, but not sure how to access it from lambda https://esphome.io/api/canbus_8cpp_source.html
Any ideas?
# Normal way to send on CAN
interval:
- interval: 1000ms
then:
- canbus.send:
can_id: 0x359 #(want to be able to change by program, so var or similar)
data: [ 0x10, 0x20, 0x30 ]
# instead something like
- lambda:
send.canbus(id, data);
So my next question is how do I receive canbus messages in lambda?
I want to receive many can ids and then decide how to process them programmatically, there could be 100’s so I don’t want to have a seperate can id code for each, and it nots templatable!
I guess my question is how do I receive all can ids?