Well i finally got off my butt and I got my wesp32 board configured and on my network however I discovered that there are some gaps in support from WiFi to Ethernet like sensors for Ip address and MAC address. I started to build some sensors using Lambda but I cant get them to compile. I have listed the code below, any help would be very much appreciated…
text_sensor:
- platform: template
name: "${name}_MAC_Address"
lambda: 'return {Ethernet.macAddress().c_str()};'
icon: mdi:expansion-card-variant
update_interval: 1d
- platform: template
name: "IP Address"
lambda: 'return {Ethernet.localIP().c_str()};'
icon: mdi:ip-network
update_interval: 1d
Compiling /data/wesp32_01/.pioenvs/wesp32_01/src/main.cpp.o
src/main.cpp: In lambda function:
src/main.cpp:244:15: error: 'Ethernet' was not declared in this scope
return {Ethernet.macAddress().c_str()};
^
src/main.cpp:244:44: error: could not convert '{<expression error>}' from '<brace-enclosed initializer list>' to 'esphome::optional<std::__cxx11::basic_string<char> >'
return {Ethernet.macAddress().c_str()};
^
src/main.cpp: In lambda function:
src/main.cpp:247:15: error: 'Ethernet' was not declared in this scope
return {Ethernet.localIP().c_str()};
^
src/main.cpp:247:41: error: could not convert '{<expression error>}' from '<brace-enclosed initializer list>' to 'esphome::optional<std::__cxx11::basic_string<char> >'
return {Ethernet.localIP().c_str()};
^
*** [/data/wesp32_01/.pioenvs/wesp32_01/src/main.cpp.o] Error 1
========================== [FAILED] Took 7.27 seconds ==========================