so I want to use ESPhomelib but need to have custom virtual relays and buttons. I want them connected to variables instead of pins, so that I can connect my code with esphome lib.
How to change below example to do that?
#include <esphomelib.h>
using namespace esphomelib;
static const char *TAG = "main";
bool output_state_custom;//I want to connect this variable to my binary sensor on esphome
boo input_state_custom;//I wan tto connect this variable to my switch sensor on esphome
void setup() {
App.set_name("ir");
App.init_log();
App.init_wifi("YOUR_SSID", "YOUR_PASSWORD");
App.init_mqtt("MQTT_HOST", "USERNAME", "PASSWORD");
App.init_ota()->start_safe_mode();
App.make_gpio_switch("Dehumidifier", 33);
App.make_gpio_binary_sensor("Cabinet Motion", 36, "motion");
App.setup();
}
void loop() {
App.loop();
}