binary_sensor:
- platform: gpio
pin:
number: ${button_pin}
inverted: true
name: "${device_name_full} Button"
- platform: template
id: sensor_a
name: "sensor_a_payload"
# lambda: |-
wifi_now:
channel: 2
# password: "<master password>"
peers:
- id: device_b
bssid: ${client_b_bssid}
# password: "<communication A between B password>"
on_receive:
- service: "Boolean Sensor A"
payloads:
- bool: sensor_a_payload
then:
- binary_sensor.template.publish:
id: sensor_a
state: !lambda 'return id(sensor_a_payload)->get_value();'
wifi_now:
channel: 2
# password: "<master password>"
peers:
- id: device_a
bssid: ${device_a_bssid}
# password: "<communication A between B password>"
sensor:
- platform: uptime
name: Uptime Sensor
binary_sensor:
- platform: gpio
pin:
number: ${button_pin}
inverted: true
name: "${device_name_full} Button"
filters:
- delayed_on: 10ms
- delayed_off: 10ms
on_state:
then:
- wifi_now.send:
peerid: device_a
service: "Boolean Sensor A"
payloads:
- bool: !lambda return x
Compiling .pioenvs/espnow_b_client_test/libd67/ESPAsyncTCP-esphome/ESPAsyncTCPbuffer.cpp.o
Compiling .pioenvs/espnow_b_client_test/libd67/ESPAsyncTCP-esphome/SyncClient.cpp.o
src/main.cpp: In function 'void setup()':
src/main.cpp:199:100: error: expected primary-expression before 'bool'
wifi_now_wifinowtemplatepayloadgetter = new wifi_now::WifiNowTemplatePayloadGetter<bool, bool>({{bool, "x"}});
^
src/main.cpp:199:100: error: expected '}' before 'bool'
src/main.cpp:199:100: error: expected '}' before 'bool'
src/main.cpp:199:100: error: expected ')' before 'bool'
src/main.cpp:199:109: error: expected ')' before '}' token
wifi_now_wifinowtemplatepayloadgetter = new wifi_now::WifiNowTemplatePayloadGetter<bool, bool>({{bool, "x"}});
^
src/main.cpp:199:109: error: expected ';' before '}' token
src/main.cpp: At global scope:
src/main.cpp:199:110: error: expected declaration before '}' token
wifi_now_wifinowtemplatepayloadgetter = new wifi_now::WifiNowTemplatePayloadGetter<bool, bool>({{bool, "x"}});
^
Compiling .pioenvs/espnow_b_client_test/libd67/ESPAsyncTCP-esphome/tcp_axtls.c.o
Compiling .pioenvs/espnow_b_client_test/lib4ed/ESP8266mDNS/ESP8266mDNS.cpp.o
Compiling .pioenvs/espnow_b_client_test/lib4ed/ESP8266mDNS/ESP8266mDNS_Legacy.cpp.o
In file included from src/esphome.h:33:0,
from src/main.cpp:3:
src/esphome/components/wifi_now/send_action.h: In instantiation of 'void esphome::wifi_now::WifiNowSendAction<Ts>::play_complex(Ts ...) [with Ts = {bool}]':
src/main.cpp:199:110: required from here
src/esphome/components/wifi_now/send_action.h:43:14: error: no matching function for call to 'esphome::wifi_now::WifiNowSendAction<bool>::send(bool&)'
send(x...);
^
src/esphome/components/wifi_now/send_action.h:43:14: note: candidate is:
src/esphome/components/wifi_now/send_action.h:85:8: note: void esphome::wifi_now::WifiNowSendAction<Ts>::send() [with Ts = {bool}]
void send() {
^
src/esphome/components/wifi_now/send_action.h:85:8: note: candidate expects 0 arguments, 1 provided
src/esphome/components/wifi_now/send_action.h: In instantiation of 'void esphome::wifi_now::WifiNowSendAction<Ts>::send() [with Ts = {bool}]':
src/esphome/components/wifi_now/send_action.h:43:14: required from 'void esphome::wifi_now::WifiNowSendAction<Ts>::play_complex(Ts ...) [with Ts = {bool}]'
src/main.cpp:199:110: required from here
src/esphome/components/wifi_now/send_action.h:89:109: error: no matching function for call to 'esphome::wifi_now::WifiNowSendAction<bool>::get_payload()'
WifiNowPacket packet(this->peer_ ? this->peer_->get_bssid() : bssid_t{}, this->servicekey_, get_payload());
^
src/esphome/components/wifi_now/send_action.h:89:109: note: candidate is:
src/esphome/components/wifi_now/send_action.h:26:27: note: const payload_t esphome::wifi_now::WifiNowSendAction<Ts>::get_payload(Ts ...) [with Ts = {bool}; esphome::wifi_now::payload_t = std::vector<unsigned char>]
virtual const payload_t get_payload(Ts... x) {
^
src/esphome/components/wifi_now/send_action.h:26:27: note: candidate expects 1 argument, 0 provided
In file included from src/esphome/core/component.h:4:0,
from src/esphome/components/api/api_connection.h:3,
from src/esphome.h:2,
from src/main.cpp:3:
/home/my_home/.platformio/packages/[email protected]/xtensa-lx106-elf/include/c++/4.8.2/functional: In substitution of 'template<class _Res, class ... _ArgTypes> template<class _Functor> using _Invoke = decltype (std::__callable_functor(declval<_Functor&>())((declval<_ArgTypes>)()...)) [with _Functor = esphome::wifi_now::WifiNowSendAction<Ts>::send() [with Ts = {bool}]::__lambda17; _Res = void; _ArgTypes = {bool}]':
/home/my_home/.platformio/packages/[email protected]/xtensa-lx106-elf/include/c++/4.8.2/functional:2250:9: required from 'void esphome::wifi_now::WifiNowSendAction<Ts>::send() [with Ts = {bool}]'
src/esphome/components/wifi_now/send_action.h:43:14: required from 'void esphome::wifi_now::WifiNowSendAction<Ts>::play_complex(Ts ...) [with Ts = {bool}]'
src/main.cpp:199:110: required from here
/home/my_home/.platformio/packages/[email protected]/xtensa-lx106-elf/include/c++/4.8.2/functional:2181:71: error: use of 'esphome::wifi_now::WifiNowSendAction<Ts>::send() [with Ts = {bool}]::__lambda17' before deduction of 'auto'
using _Invoke = decltype(__callable_functor(std::declval<_Functor&>())
^
/home/my_home/.platformio/packages/[email protected]/xtensa-lx106-elf/include/c++/4.8.2/functional:2250: confused by earlier errors, bailing out
*** [.pioenvs/espnow_b_client_test/src/main.cpp.o] Error 1
=========================================================== [FAILED] Took 5.15 seconds ===========================================================