hi all
can someone tell me what is wrong with my code ?
esp dont put values in templates , rawstring is ok
my code:
uart:
baud_rate: 9600
tx_pin: GPIO17
rx_pin: GPIO16
debug:
direction: RX
dummy_receiver: true
after:
delimiter: "\n\r"
sequence:
- lambda: |-
UARTDebug::log_string(direction, bytes);
std::string str(bytes.begin(), bytes.end());
id(rawString).publish_state(str.c_str());
float sensors_values0 =0;
float sensors_values1 =0;
float sensors_values2 =0;
if (sscanf(str.c_str(), "%f;%f;%f", &sensors_values0, &sensors_values1, &sensors_values2) == 3 ) {
id(tempA1).publish_state(sensors_values0);
id(tempA2).publish_state(sensors_values1);
id(tempA3).publish_state(sensors_values2);
}
sensor:
- platform: template
name: "A1"
id: "tempA1"
- platform: template
name: "A2"
id: "tempA2"
- platform: template
name: "A3"
id: "tempA3"
thanks