Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESPHome compile failed on stock yaml file with new components #3

Closed
wifijt opened this issue Jan 20, 2022 · 5 comments
Closed

ESPHome compile failed on stock yaml file with new components #3

wifijt opened this issue Jan 20, 2022 · 5 comments

Comments

@wifijt
Copy link

wifijt commented Jan 20, 2022

Just tried to flash a bulb using the stock YAML file and got this error:

In file included from src/esphome/components/restart/button/restart_button.h:3, from src/esphome/components/restart/button/restart_button.cpp:1: src/esphome/components/restart/button/restart_button.cpp: In member function 'virtual void esphome::restart::RestartButton::dump_config()': src/esphome/components/button/button.h:11:3: warning: 'nonnull' argument 'this' compared to NULL [-Wnonnull-compare] 11 | if ((obj) != nullptr) { \ | ^~ src/esphome/components/restart/button/restart_button.cpp:17:37: note: in expansion of macro 'LOG_BUTTON' 17 | void RestartButton::dump_config() { LOG_BUTTON("", "Restart Button", this); } | ^~~~~~~~~~ In file included from src/esphome/components/template/select/template_select.h:3, from src/esphome/components/template/select/template_select.cpp:1: src/esphome/components/template/select/template_select.cpp: In member function 'virtual void esphome::template_::TemplateSelect::dump_config()': src/esphome/components/select/select.h:13:3: warning: 'nonnull' argument 'this' compared to NULL [-Wnonnull-compare] 13 | if ((obj) != nullptr) { \ | ^~ src/esphome/components/template/select/template_select.cpp:64:3: note: in expansion of macro 'LOG_SELECT' 64 | LOG_SELECT("", "Template Select", this); | ^~~~~~~~~~ Compiling .pioenvs/erikas-desk-bulb/src/esphome/components/web_server/web_server.cpp.o Compiling .pioenvs/erikas-desk-bulb/src/esphome/components/web_server_base/web_server_base.cpp.o In file included from src/esphome/components/uptime/uptime_sensor.h:4, from src/esphome/components/uptime/uptime_sensor.cpp:1: src/esphome/components/uptime/uptime_sensor.cpp: In member function 'virtual void esphome::uptime::UptimeSensor::dump_config()': src/esphome/components/sensor/sensor.h:13:3: warning: 'nonnull' argument 'this' compared to NULL [-Wnonnull-compare] 13 | if ((obj) != nullptr) { \ | ^~ src/esphome/components/uptime/uptime_sensor.cpp:31:36: note: in expansion of macro 'LOG_SENSOR' 31 | void UptimeSensor::dump_config() { LOG_SENSOR("", "Uptime Sensor", this); } | ^~~~~~~~~~ Compiling .pioenvs/erikas-desk-bulb/src/esphome/components/wifi/wifi_component.cpp.o src/esphome/components/light/light_json_schema.cpp: In static member function 'static void esphome::light::LightJSONSchema::dump_json(esphome::light::LightState&, ArduinoJson::JsonObject)': src/esphome/components/light/light_json_schema.cpp:55:53: error: use of deleted function 'ArduinoJson::JsonObject::JsonObject(const ArduinoJson::JsonObject&)' 55 | JsonObject color = root.createNestedObject("color"); | ^ In file included from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson.hpp:9, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson.h:9, from src/esphome/components/json/json_util.h:8, from src/esphome/components/light/light_json_schema.h:7, from src/esphome/components/light/light_json_schema.cpp:1: .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/JsonObject.hpp:40:7: note: 'ArduinoJson::JsonObject::JsonObject(const ArduinoJson::JsonObject&)' is implicitly deleted because the default definition would be ill-formed: 40 | class JsonObject : public Internals::JsonPrintable<JsonObject>, | ^~~~~~~~~~ .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/JsonObject.hpp:40:7: error: 'ArduinoJson::Internals::NonCopyable::NonCopyable(const ArduinoJson::Internals::NonCopyable&)' is private within this context In file included from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/../JsonBuffer.hpp:11, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/JsonParser.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/JsonBufferBase.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/DynamicJsonBuffer.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson.h:9, from src/esphome/components/json/json_util.h:8, from src/esphome/components/light/light_json_schema.h:7, from src/esphome/components/light/light_json_schema.cpp:1: .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/../Data/NonCopyable.hpp:17:3: note: declared private here 17 | NonCopyable(const NonCopyable&); | ^~~~~~~~~~~ src/esphome/components/light/light_json_schema.cpp: In static member function 'static void esphome::light::LightJSONSchema::parse_color_json(esphome::light::LightState&, esphome::light::LightCall&, ArduinoJson::JsonObject)': src/esphome/components/light/light_json_schema.cpp:98:36: error: use of deleted function 'ArduinoJson::JsonObject::JsonObject(const ArduinoJson::JsonObject&)' 98 | JsonObject color = root["color"]; | ^ In file included from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/../JsonVariantBase.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/../JsonVariant.hpp:13, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/../JsonBuffer.hpp:12, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/JsonParser.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/JsonBufferBase.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/DynamicJsonBuffer.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson.h:9, from src/esphome/components/json/json_util.h:8, from src/esphome/components/light/light_json_schema.h:7, from src/esphome/components/light/light_json_schema.cpp:1: .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/../JsonVariantCasts.hpp:44:16: note: after user-defined conversion: 'ArduinoJson::Internals::JsonVariantCasts<TImpl>::operator ArduinoJson::JsonObject&() const [with TImpl = ArduinoJson::Internals::JsonObjectSubscript<const char*>]' 44 | FORCE_INLINE operator JsonObject &() const { Compiling .pioenvs/erikas-desk-bulb/src/esphome/components/wifi/wifi_component_esp32_arduino.cpp.o | ^~~~~~~~ src/esphome/components/light/light_json_schema.cpp: In static member function 'static void esphome::light::LightJSONSchema::parse_json(esphome::light::LightState&, esphome::light::LightCall&, ArduinoJson::JsonObject)': src/esphome/components/light/light_json_schema.cpp:144:54: error: use of deleted function 'ArduinoJson::JsonObject::JsonObject(const ArduinoJson::JsonObject&)' 144 | LightJSONSchema::parse_color_json(state, call, root); | ^ src/esphome/components/light/light_json_schema.cpp:75:87: note: initializing argument 3 of 'static void esphome::light::LightJSONSchema::parse_color_json(esphome::light::LightState&, esphome::light::LightCall&, ArduinoJson::JsonObject)' 75 | void LightJSONSchema::parse_color_json(LightState &state, LightCall &call, JsonObject root) { | ~~~~~~~~~~~^~~~ Compiling .pioenvs/erikas-desk-bulb/src/esphome/components/wifi/wifi_component_esp8266.cpp.o Compiling .pioenvs/erikas-desk-bulb/src/esphome/components/wifi/wifi_component_esp_idf.cpp.o Compiling .pioenvs/erikas-desk-bulb/src/esphome/components/wifi_info/wifi_info_text_sensor.cpp.o Compiling .pioenvs/erikas-desk-bulb/src/esphome/core/application.cpp.o Compiling .pioenvs/erikas-desk-bulb/src/esphome/core/color.cpp.o Compiling .pioenvs/erikas-desk-bulb/src/esphome/core/component.cpp.o Compiling .pioenvs/erikas-desk-bulb/src/esphome/core/controller.cpp.o Compiling .pioenvs/erikas-desk-bulb/src/esphome/core/entity_base.cpp.o Compiling .pioenvs/erikas-desk-bulb/src/esphome/core/helpers.cpp.o Compiling .pioenvs/erikas-desk-bulb/src/esphome/core/log.cpp.o *** [.pioenvs/erikas-desk-bulb/src/esphome/components/light/light_json_schema.cpp.o] Error 1 Compiling .pioenvs/erikas-desk-bulb/src/esphome/core/scheduler.cpp.o In file included from src/esphome/components/wifi_info/wifi_info_text_sensor.h:4, from src/esphome/components/wifi_info/wifi_info_text_sensor.cpp:1: src/esphome/components/wifi_info/wifi_info_text_sensor.cpp: In member function 'virtual void esphome::wifi_info::IPAddressWiFiInfo::dump_config()': src/esphome/components/text_sensor/text_sensor.h:12:3: warning: 'nonnull' argument 'this' compared to NULL [-Wnonnull-compare] 12 | if ((obj) != nullptr) { \ | ^~ src/esphome/components/wifi_info/wifi_info_text_sensor.cpp:9:41: note: in expansion of macro 'LOG_TEXT_SENSOR' 9 | void IPAddressWiFiInfo::dump_config() { LOG_TEXT_SENSOR("", "WifiInfo IPAddress", this); } | ^~~~~~~~~~~~~~~ src/esphome/components/wifi_info/wifi_info_text_sensor.cpp: In member function 'virtual void esphome::wifi_info::ScanResultsWiFiInfo::dump_config()': src/esphome/components/text_sensor/text_sensor.h:12:3: warning: 'nonnull' argument 'this' compared to NULL [-Wnonnull-compare] 12 | if ((obj) != nullptr) { \ | ^~ src/esphome/components/wifi_info/wifi_info_text_sensor.cpp:10:43: note: in expansion of macro 'LOG_TEXT_SENSOR' 10 | void ScanResultsWiFiInfo::dump_config() { LOG_TEXT_SENSOR("", "WifiInfo Scan Results", this); } | ^~~~~~~~~~~~~~~ src/esphome/components/wifi_info/wifi_info_text_sensor.cpp: In member function 'virtual void esphome::wifi_info::SSIDWiFiInfo::dump_config()': src/esphome/components/text_sensor/text_sensor.h:12:3: warning: 'nonnull' argument 'this' compared to NULL [-Wnonnull-compare] 12 | if ((obj) != nullptr) { \ | ^~ src/esphome/components/wifi_info/wifi_info_text_sensor.cpp:11:36: note: in expansion of macro 'LOG_TEXT_SENSOR' 11 | void SSIDWiFiInfo::dump_config() { LOG_TEXT_SENSOR("", "WifiInfo SSID", this); } | ^~~~~~~~~~~~~~~ src/esphome/components/wifi_info/wifi_info_text_sensor.cpp: In member function 'virtual void esphome::wifi_info::BSSIDWiFiInfo::dump_config()': src/esphome/components/text_sensor/text_sensor.h:12:3: warning: 'nonnull' argument 'this' compared to NULL [-Wnonnull-compare] 12 | if ((obj) != nullptr) { \ | ^~ src/esphome/components/wifi_info/wifi_info_text_sensor.cpp:12:37: note: in expansion of macro 'LOG_TEXT_SENSOR' 12 | void BSSIDWiFiInfo::dump_config() { LOG_TEXT_SENSOR("", "WifiInfo BSSID", this); } | ^~~~~~~~~~~~~~~ src/esphome/components/wifi_info/wifi_info_text_sensor.cpp: In member function 'virtual void esphome::wifi_info::MacAddressWifiInfo::dump_config()': src/esphome/components/text_sensor/text_sensor.h:12:3: warning: 'nonnull' argument 'this' compared to NULL [-Wnonnull-compare] 12 | if ((obj) != nullptr) { \ | ^~ src/esphome/components/wifi_info/wifi_info_text_sensor.cpp:13:42: note: in expansion of macro 'LOG_TEXT_SENSOR' 13 | void MacAddressWifiInfo::dump_config() { LOG_TEXT_SENSOR("", "WifiInfo Mac Address", this); } | ^~~~~~~~~~~~~~~ src/esphome/components/web_server/web_server.cpp: In member function 'std::string esphome::web_server::WebServer::sensor_json(esphome::sensor::Sensor*, float)': src/esphome/components/web_server/web_server.cpp:351:4: error: no matching function for call to 'build_json(esphome::web_server::WebServer::sensor_json(esphome::sensor::Sensor*, float)::<lambda(ArduinoJson::JsonObject)>)' 351 | }); | ^ In file included from src/esphome/components/web_server/web_server.cpp:8: src/esphome/components/json/json_util.h:20:13: note: candidate: 'const char* esphome::json::build_json(const json_build_t&, size_t*)' 20 | const char *build_json(const json_build_t &f, size_t *length); | ^~~~~~~~~~ src/esphome/components/json/json_util.h:20:13: note: candidate expects 2 arguments, 1 provided src/esphome/components/json/json_util.h:22:13: note: candidate: 'std::string esphome::json::build_json(const json_build_t&)' 22 | std::string build_json(const json_build_t &f); | ^~~~~~~~~~ src/esphome/components/json/json_util.h:22:44: note: no known conversion for argument 1 from 'esphome::web_server::WebServer::sensor_json(esphome::sensor::Sensor*, float)::<lambda(ArduinoJson::JsonObject)>' to 'const json_build_t&' {aka 'const std::function<void(ArduinoJson::JsonObject&)>&'} 22 | std::string build_json(const json_build_t &f); | ~~~~~~~~~~~~~~~~~~~~^ src/esphome/components/web_server/web_server.cpp: In member function 'std::string esphome::web_server::WebServer::text_sensor_json(esphome::text_sensor::TextSensor*, const string&)': src/esphome/components/web_server/web_server.cpp:374:4: error: no matching function for call to 'build_json(esphome::web_server::WebServer::text_sensor_json(esphome::text_sensor::TextSensor*, const string&)::<lambda(ArduinoJson::JsonObject)>)' 374 | }); | ^ In file included from src/esphome/components/web_server/web_server.cpp:8: src/esphome/components/json/json_util.h:20:13: note: candidate: 'const char* esphome::json::build_json(const json_build_t&, size_t*)' 20 | const char *build_json(const json_build_t &f, size_t *length); | ^~~~~~~~~~ src/esphome/components/json/json_util.h:20:13: note: candidate expects 2 arguments, 1 provided src/esphome/components/json/json_util.h:22:13: note: candidate: 'std::string esphome::json::build_json(const json_build_t&)' 22 | std::string build_json(const json_build_t &f); | ^~~~~~~~~~ src/esphome/components/json/json_util.h:22:44: note: no known conversion for argument 1 from 'esphome::web_server::WebServer::text_sensor_json(esphome::text_sensor::TextSensor*, const string&)::<lambda(ArduinoJson::JsonObject)>' to 'const json_build_t&' {aka 'const std::function<void(ArduinoJson::JsonObject&)>&'} 22 | std::string build_json(const json_build_t &f); | ~~~~~~~~~~~~~~~~~~~~^ src/esphome/components/web_server/web_server.cpp: In lambda function: src/esphome/components/web_server/web_server.cpp:611:49: error: use of deleted function 'ArduinoJson::JsonObject::JsonObject(const ArduinoJson::JsonObject&)' 611 | light::LightJSONSchema::dump_json(*obj, root); | ^ In file included from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson.hpp:9, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson.h:9, from src/esphome/components/json/json_util.h:8, from src/esphome/components/web_server/web_server.cpp:8: .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/JsonObject.hpp:40:7: note: 'ArduinoJson::JsonObject::JsonObject(const ArduinoJson::JsonObject&)' is implicitly deleted because the default definition would be ill-formed: 40 | class JsonObject : public Internals::JsonPrintable<JsonObject>, | ^~~~~~~~~~ .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/JsonObject.hpp:40:7: error: 'ArduinoJson::Internals::NonCopyable::NonCopyable(const ArduinoJson::Internals::NonCopyable&)' is private within this context In file included from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/../JsonBuffer.hpp:11, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/JsonParser.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/JsonBufferBase.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/DynamicJsonBuffer.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson.hpp:7, from .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson.h:9, from src/esphome/components/json/json_util.h:8, from src/esphome/components/web_server/web_server.cpp:8: .piolibdeps/erikas-desk-bulb/ArduinoJson-esphomelib/src/ArduinoJson/Deserialization/../Data/NonCopyable.hpp:17:3: note: declared private here 17 | NonCopyable(const NonCopyable&); | ^~~~~~~~~~~ In file included from src/esphome/components/web_server/web_server.cpp:16: src/esphome/components/light/light_json_schema.h:17:55: note: initializing argument 2 of 'static void esphome::light::LightJSONSchema::dump_json(esphome::light::LightState&, ArduinoJson::JsonObject)' 17 | static void dump_json(LightState &state, JsonObject root); | ~~~~~~~~~~~^~~~ src/esphome/components/web_server/web_server.cpp: In member function 'std::string esphome::web_server::WebServer::light_json(esphome::light::LightState*)': src/esphome/components/web_server/web_server.cpp:612:4: error: no matching function for call to 'build_json(esphome::web_server::WebServer::light_json(esphome::light::LightState*)::<lambda(ArduinoJson::JsonObject)>)' 612 | }); | ^ In file included from src/esphome/components/web_server/web_server.cpp:8: src/esphome/components/json/json_util.h:20:13: note: candidate: 'const char* esphome::json::build_json(const json_build_t&, size_t*)' 20 | const char *build_json(const json_build_t &f, size_t *length); | ^~~~~~~~~~ src/esphome/components/json/json_util.h:20:13: note: candidate expects 2 arguments, 1 provided src/esphome/components/json/json_util.h:22:13: note: candidate: 'std::string esphome::json::build_json(const json_build_t&)' 22 | std::string build_json(const json_build_t &f); | ^~~~~~~~~~ src/esphome/components/json/json_util.h:22:44: note: no known conversion for argument 1 from 'esphome::web_server::WebServer::light_json(esphome::light::LightState*)::<lambda(ArduinoJson::JsonObject)>' to 'const json_build_t&' {aka 'const std::function<void(ArduinoJson::JsonObject&)>&'} 22 | std::string build_json(const json_build_t &f); | ~~~~~~~~~~~~~~~~~~~~^ src/esphome/components/web_server/web_server.cpp: In member function 'std::string esphome::web_server::WebServer::select_json(esphome::select::Select*, const string&)': src/esphome/components/web_server/web_server.cpp:755:4: error: no matching function for call to 'build_json(esphome::web_server::WebServer::select_json(esphome::select::Select*, const string&)::<lambda(ArduinoJson::JsonObject)>)' 755 | }); | ^ In file included from src/esphome/components/web_server/web_server.cpp:8: src/esphome/components/json/json_util.h:20:13: note: candidate: 'const char* esphome::json::build_json(const json_build_t&, size_t*)' 20 | const char *build_json(const json_build_t &f, size_t *length); | ^~~~~~~~~~ src/esphome/components/json/json_util.h:20:13: note: candidate expects 2 arguments, 1 provided src/esphome/components/json/json_util.h:22:13: note: candidate: 'std::string esphome::json::build_json(const json_build_t&)' 22 | std::string build_json(const json_build_t &f); | ^~~~~~~~~~ src/esphome/components/json/json_util.h:22:44: note: no known conversion for argument 1 from 'esphome::web_server::WebServer::select_json(esphome::select::Select*, const string&)::<lambda(ArduinoJson::JsonObject)>' to 'const json_build_t&' {aka 'const std::function<void(ArduinoJson::JsonObject&)>&'} 22 | std::string build_json(const json_build_t &f); | ~~~~~~~~~~~~~~~~~~~~^ *** [.pioenvs/erikas-desk-bulb/src/esphome/components/web_server/web_server.cpp.o] Error 1 ========================= [FAILED] Took 52.18 seconds =========================

@wifijt
Copy link
Author

wifijt commented Jan 20, 2022

Here is the YAML file:

`substitutions:

name: erikas-desk-bulb # **** CHANGE DEVICE NAME TO SOMETHING UNIQUE PER DEVICE. RENAME YAML FILE TO SAME NAME. ****
# **** USE DASHES (-) INSTEAD OF SPACES OR UNDERSCORE (_). USE ONLY LOWER CASE LETTERS. ****

friendly_name: Erikas Desk Bulb # **** CHANGE FRIENDLY NAME TO SOMETHING UNIQUE PER DEVICE ****

esp8266: # https://esphome.io/components/esp8266.html
board: esp01_1m
restore_from_flash: true

framework: # provides updated PWM logic per esp8266/Arduino#7231
version: 3.0.2 # https://github.com/esp8266/Arduino/releases
platform_version: 3.2.0 # https://github.com/platformio/platform-espressif8266/releases/

external_components:

  • source:
    type: git
    url: https://github.com/KaufHA/kauf-rgbww-bulbs
    refresh: 0s

    kauf_rgbww and light are required external components. If you don't want to use them, you should use kauf-bulb-minimal.yaml instead of kauf-bulb.yaml

    web_server is not required, it just adds the version number to the web interface and also a warning about not flashing WLED or tasmota-minimal.

    web_server_base is not required, it just makes the OTA system error out if wled or minimal are found in an uploaded firmware filename.

    components: [kauf_rgbww,light,web_server,web_server_base]

esphome:

name: $name

project:
name: "kauf.rgbww"
version: "1.72"

on_boot:
then:

  - lambda: |-

      // restore light state per setting.  Default is to restore previous state so we don't need an action for that.
      if (id(select_boot_state).state == "Always On - Last Value") {
        auto call = id(kauf_light).turn_on();
        call.perform();
      }
      else if (id(select_boot_state).state == "Always On - Bright White") {
        auto call = id(kauf_light).turn_on();
        call.set_color_mode(ColorMode::COLOR_TEMPERATURE);
        call.set_color_temperature(150);
        call.set_brightness(1.0);
        call.perform();
      }
      else if (id(select_boot_state).state == "Always Off") {
        auto call = id(kauf_light).turn_off();
        call.perform();
      }

      // turn on WLED if effect is selected
      if ( id(effect).state == "WLED / DDP" ) { id(kauf_light)->set_use_wled(); }

button:

  • platform: restart
    id: restart_button
    name: $friendly_name Restart Firmware
    entity_category: diagnostic
    disabled_by_default: true

wifi:

**** ENTER WI-FI CREDENTIALS HERE, USING SECRETS.YAML RECOMMENDED ****

ssid: !secret wifi_ssid
password: !secret wifi_pass

# Uncomment below to set a static IP

manual_ip:

static_ip: !secret kauf_bulb_rgb_ip_address

gateway: !secret wifi_gateway

subnet: !secret wifi_subnet

dns1: !secret wifi_dns1

use_address allows wireless programming through dashboard.

Set to the bulb's IP Address. Remove after programming.

use_address: 192.168.86.244

default is 20, 17 is recommended.

output_power: 17

using fast_connect as default since it is required for hidden networks.

feel free to change or override.

fast_connect: true

logger: # Enable logging

baud_rate: 0 # Disable UART logging since TX pad not easily available

api: # Enable Home Assistant API

password: !secret api_password # optional password field for Home Assistant API.

ota:

password: !secret ota_password # optional password for OTA updates.

debug: # outputs additional debug info when logs start

web_server: # web server allows access to device with a web browser

auth: # optional login details for web interface

username: admin

password: !secret web_server_password

PWM outputs for each LED channel

output:

  • platform: esp8266_pwm
    pin: GPIO4
    frequency: 1000 Hz
    id: pwm_red
  • platform: esp8266_pwm
    pin: GPIO12
    frequency: 1000 Hz
    id: pwm_green
  • platform: esp8266_pwm
    pin: GPIO14
    frequency: 1000 Hz
    id: pwm_blue
  • platform: esp8266_pwm
    pin: GPIO5
    frequency: 1000 Hz
    id: pwm_cw
  • platform: esp8266_pwm
    pin: GPIO13
    frequency: 1000 Hz
    id: pwm_ww

light:

Additive RGB light for Warm White

  • platform: kauf_rgbww
    id: warm_rgb
    entity_category: config
    default_transition_length: 0ms
    aux: true
    name: $friendly_name Warm RGB

Additive RGB light for Cold White

  • platform: kauf_rgbww
    id: cold_rgb
    entity_category: config
    default_transition_length: 0ms
    aux: true
    name: $friendly_name Cold RGB

Main RGBWW light

  • platform: kauf_rgbww
    id: kauf_light
    default_transition_length: 250ms
    name: $friendly_name
    red: pwm_red
    green: pwm_green
    blue: pwm_blue
    warm_white: pwm_ww
    cold_white: pwm_cw
    warm_rgb: warm_rgb
    cold_rgb: cold_rgb

select:

default light state on boot

  • platform: template
    name: $friendly_name Power On State
    id: select_boot_state
    optimistic: true
    options:

    • "Restore Power Off State"
    • "Always On - Last Value"
    • "Always On - Bright White"
    • "Always Off"

    defaulting to always on is nice so you know new bulbs are working

    initial_option: "Always On - Bright White"
    restore_value: true
    icon: mdi:restart-alert
    set_action:

    • script.execute: save_changes
      entity_category: config
  • platform: template
    name: $friendly_name Effect
    id: effect
    optimistic: true
    options:

    • "None"

    • "WLED / DDP"
      initial_option: "None"
      restore_value: true
      icon: mdi:string-lights
      set_action:

    • lambda: |-
      if ( x == "None" ) { id(kauf_light)->clr_use_wled(); }
      if ( x == "WLED / DDP" ) { id(kauf_light)->set_use_wled(); }

    • script.execute: save_changes

    entity_category: config

sensor:

  • platform: uptime
    name: $friendly_name Uptime
    update_interval: 60s
    entity_category: diagnostic
    disabled_by_default: true

Send IP Address to HA. Disabled by default, not as important now that Home Assistant provides link.

text_sensor:

  • platform: wifi_info
    ip_address:
    name: $friendly_name IP Address
    entity_category: diagnostic
    disabled_by_default: true

script:

  • id: save_changes
    mode: restart
    then:
    • delay: 3s
    • lambda: 'global_preferences->sync();'`

@KaufHA
Copy link
Owner

KaufHA commented Jan 20, 2022

What version of ESPHome are you running? This looks like you need to upgrade to the latest version 2022.1.1.

BTW, I'm in the process of updating documentation and recommendations to use automatic importing of devices into the dashboard. Here is what the yaml file would look like for that. You can copy and paste this over your existing yaml and change names etc. This will cause any updates on our end to be automatically incorporated.

substitutions:
  name: bedroom-lamp-1
  friendly_name: Bedroom Lamp 1

packages:
  kauf.rgbww: github://KaufHA/kauf-rgbww-bulbs/kauf-bulb.yaml

esphome:
  name_add_mac_suffix: false


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  
  manual_ip:
    static_ip: !secret bedroom_lamp_1_ip_address
    gateway: !secret wifi_gateway
    subnet: !secret wifi_subnet
    dns1: !secret wifi_dns1

@wifijt
Copy link
Author

wifijt commented Jan 20, 2022

Excellent - I will upgrade and retry - love the new YAML file and the automatic inclusions with the packages line.

Is there a way to have it error out if ESPHome is not a certain version?

@KaufHA
Copy link
Owner

KaufHA commented Jan 20, 2022

I was just thinking about how to error out if version number is wrong. It should be possible. I will try to figure it out.

@KaufHA
Copy link
Owner

KaufHA commented Mar 17, 2022

I added an error if you aren't on the right version of ESPHome. Looks like this:


#if ESPHOME_VERSION_CODE < VERSION_CODE(2022, 3, 0)
  #error "Please Update ESPHome to the latest version.  Expecting 2022.3.X"
#endif

#if ESPHOME_VERSION_CODE >= VERSION_CODE(2022, 4, 0)
  #error "KAUF external components have not been updated for this version of ESPHome yet, or you are not using the latest KAUF external components version.  Expecting 2022.3.X.  You can try deleting the .esphome/packages and .esphome/external_components subdirectories within the ESPHome config directory to resolve this."
#endif

@KaufHA KaufHA closed this as completed Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants