Here is my current code for this component
switch:
- platform: template # "Cabane light"
name: "1 Cabane Light"
optimistic: true # ESPHome to assume that the switch state is what you last set it to
on_turn_on:
lambda: |-
ESP_LOGI("LoRa", "turn_on_action");
std::get<7>(id(station_data_list)[0]) = true; // Update light state
// For Cabane there is no need to send a packet, it is not possible to receive it
id(my_display).update(); // Update the display
on_turn_off:
lambda: |-
ESP_LOGI("LoRa", "turn_off_action");
std::get<7>(id(station_data_list)[0]) = false; // Update light state
// For Cabane there is no need to send a packet, it is not possible to receive it
// id(my_display).update(); // Update the display
In the on_turn_off action, id(my_display… is commented out. My code can compile and a can see my component on the web_server.
As soon, as I uncomment this last line. My code compile and the code can be uploaded to my esp32 device but web_server can not be use.
I try many configuration but as soon as I try to update or trying to execute a SCRIPT, i cannot get to the web_browser.