Hi,
I’d like to read out data from my ventilation unit. For that I use the canbus component: First I send a reqeust msg usinge the “time” component:
time:
- platform: homeassistant
id: homeassistant_time
on_time:
- seconds: /30
then:
#ExtractAirTemperatureSensor(329), -> 0x0149
lambda: |-
std::vector< uint8_t > data0{ 0x03, 0x22, 0x01, 0x49, 0x00, 0x00, 0x00, 0x00 };
id(cb)->send_data(0x680, 0, data0);
then I process the received answer:
canbus:
- platform: mcp2515
id: cb
spi_id: McpSpi
cs_pin: GPIO14
can_id: 680
bit_rate: 250kbps
on_frame:
- can_id: 0x690
then:
- lambda: |-
if(x[0]==0x10 and x[1]==0x0C and x[2]==0x62 and x[3]==0x01 and x[4]==0x49) {
float t_amb = float(int16_t((x[5])+((x[6])<<8)))*0.1;
ESP_LOGD("vitoair", "ExtractAirTemperatureSensor %4.1f", t_amb);
}
But instead of hardcoding every piece of data, I’d like to loop through a list of datapoints. But for that I have to wait for the answer of my request first and then send the netx request. That won’t work in the abouve described way. I f.e. can’t start a loop every 30 seconds running through 10 dataponits and then decode the frames within the canbus component.
Is there a good way solving that?
Thanks,
Markus