I’m trying to make a remote transmitter lambda call using a raw code. There is a good example in the docs using the Pioneer protocol as show below:
// Example - transmit using the Pioneer protocol
auto call = id(my_transmitter).transmit();
esphome::remote_base::PioneerData data = { rc_code_1, rc_code_2 };
esphome::remote_base::PioneerProtocol().encode(call.get_data(), data);
call.set_send_times(2);
call.perform();
Looking for a similar example for raw code. This is what I have tried to put together so far but I’m at my limit of my coding knowledge and ability to make connection between RemoteTransmitData and the TransmitCall.
script:
- id: thermostat_script
then:
- lambda: |-
std::vector<int32_t> hvac_code;
hvac_code = {+4500,-2700...+4450,-50100};
// Call remote transmitter using selected code
auto call = id(my_remote_transmitter).transmit();
esphome::remote_base::RemoteTransmitData * RTD;
RTD.set_data(hvac_code);
RTD.set_carrier_frequency(38);
esphome::remote_base::RawAction<esphome::remote_base::RemoteTransmitData>().encode(RTD);
call.get_data(RTD);
call.perform();