![]() |
|
Custom ESPHome firmware and Tuya integration - Printable Version +- Smart Home Automation Forum (https://www.kincony.com/forum) +-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20) +--- Forum: KC868-A6 (https://www.kincony.com/forum/forumdisplay.php?fid=22) +--- Thread: Custom ESPHome firmware and Tuya integration (/showthread.php?tid=6289) |
RE: Custom ESPHome firmware and Tuya integration - kincony.com@pagel.info - 04-26-2025 (08-05-2024, 08:27 AM)admin Wrote: if you use ESPHome, we have yaml demo for tuya , but that is only use for KinCony's product. I have a Kincony A6 for controlling my hybrid heating system. My Warm water boiler is connected via a Tuya smart plug that I want to switch on and off depending on specific usage needs (volumes, temperature, measured by the kincony). I fould on github the esphome-tuya-iot library but it does not really do what I need. How ca I use the Tuya API to control from my esphome implementation on the A6 the tuya smart plug? Is there any way to use or tweak the custom_component esphome for this purpose? RE: Custom ESPHome firmware and Tuya integration - admin - 04-27-2025 what function you want to do? can you take an example? such as you want to use A6 board sensor to control your tuya smart plug? or ...? RE: Custom ESPHome firmware and Tuya integration - kincony.com@pagel.info - 04-27-2025 I measure temperatures and other modbus data with the A6 and depending of the temperature levals, I want to activate (switch on/off) a tuya smart plug that measures the energy for the hot water production. Optionally reading also the plug's data for energy consumption RE: Custom ESPHome firmware and Tuya integration - admin - 04-27-2025 download KCS firmware for KC868-A6, set the tuya license, so that KC868-A6 can work with tuya app. Then set AUTOMATION in tuya app, let KC868-A6 work with other tuya product. RE: Custom ESPHome firmware and Tuya integration - Chris_gbg - 07-01-2025 Hi, I have the same problem as the initial question, but didn't find any solution given for it - A6 controller - setting up Tuya IO integration lib in custom ESPHome YAML code. With all setup done - like in the demo video (https://www.youtube.com/watch?v=M_B8ln2-llY) - added external_components, tuya_iot setup (product_id: xxx, device_id: xxx, device_secret: xxx and region: eu are set with the provided by email IDs/secret etc. as well as switch_map and its number); on all switches on_turn_on and on_turn_off code is added to all relays with changed "outputX" number... When trying to install the code to the board, I get same error: invalid initialization of reference of type 'const json_parse_t&' - here is the complete dump: Code: src/esphome/components/tuya_iot/tuya_iot_component.cpp: In lambda function:Could you point me out to what could be the problem. Am I missing something? RE: Custom ESPHome firmware and Tuya integration - Chris_gbg - 07-01-2025 Hi, I found the solution for the parse_json error - there is a fix version of the Tuya IOT lib - v1.2.1 which needs to be specified in the setup of the external_components: url: https://github.com/hzkincony/esphome-tuya-iot ref: v1.2.1 # not v1.2.0 as in the readme RE: Custom ESPHome firmware and Tuya integration - admin - 07-01-2025 we suggest to download KCS v2 firmware, then set tuya license in webpage, it will be very easy. RE: Custom ESPHome firmware and Tuya integration - alexps70 - 10-12-2025 Try custome code # Basic Config esphome: name: kc868-a6-test friendly_name: KC868_A6_Test external_components: - source: type: git url: https://github.com/hzkincony/esphome-tuya-iot ref: v1.2.1 esp32: board: esp32dev framework: type: arduino src/esphome/components/tuya_iot/tuya_iot_component.cpp: In member function 'virtual void esphome::tuya_iot::TuyaIotComponent::update()': src/esphome/components/tuya_iot/tuya_iot_component.cpp:292:19: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'username' 292 | mqtt_cfg_.username = username; | ^~~~~~~~ In file included from src/esphome/core/component.h:8, from src/esphome/core/application.h:7, from src/esphome/components/api/api_frame_helper.h:12, from src/esphome/components/api/api_connection.h:5, from src/esphome.h:3, from src/esphome/components/tuya_iot/tuya_iot_component.h:3, from src/esphome/components/tuya_iot/tuya_iot_component.cpp:1: src/esphome/components/tuya_iot/tuya_iot_component.cpp:293:49: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'username' 293 | ESP_LOGD(TAG, "username: %s", mqtt_cfg_.username); | ^~~~~~~~ src/esphome/core/log.h:99:100: note: in definition of macro 'esph_log_d' 99 | ::esphome::esp_log_printf_(ESPHOME_LOG_LEVEL_DEBUG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__) | ^~~~~~~~~~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:293:9: note: in expansion of macro 'ESP_LOGD' 293 | ESP_LOGD(TAG, "username: %s", mqtt_cfg_.username); | ^~~~~~~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:297:19: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'password' 297 | mqtt_cfg_.password = password_str; | ^~~~~~~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:298:49: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'password' 298 | ESP_LOGD(TAG, "password: %s", mqtt_cfg_.password); | ^~~~~~~~ src/esphome/core/log.h:99:100: note: in definition of macro 'esph_log_d' 99 | ::esphome::esp_log_printf_(ESPHOME_LOG_LEVEL_DEBUG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__) | ^~~~~~~~~~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:298:9: note: in expansion of macro 'ESP_LOGD' 298 | ESP_LOGD(TAG, "password: %s", mqtt_cfg_.password); | ^~~~~~~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:302:19: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'uri' 302 | mqtt_cfg_.uri = uri; | ^~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:303:19: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'cert_pem' 303 | mqtt_cfg_.cert_pem = tuya_cacert_pem; | ^~~~~~~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:304:19: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'cert_len' 304 | mqtt_cfg_.cert_len = sizeof(tuya_cacert_pem); | ^~~~~~~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:305:19: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'skip_cert_common_name_check' 305 | mqtt_cfg_.skip_cert_common_name_check = true; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:306:19: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'use_global_ca_store' 306 | mqtt_cfg_.use_global_ca_store = false; | ^~~~~~~~~~~~~~~~~~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:308:19: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'protocol_ver' 308 | mqtt_cfg_.protocol_ver = MQTT_PROTOCOL_V_3_1_1; | ^~~~~~~~~~~~ src/esphome/components/tuya_iot/tuya_iot_component.cpp:311:19: error: 'esp_mqtt_client_config_t' {aka 'struct esp_mqtt_client_config_t'} has no member named 'client_id' 311 | mqtt_cfg_.client_id = client_id; | ^~~~~~~~~ Compiling .pioenvs/kc868-a6-test/src/esphome/components/web_server_base/web_server_base.cpp.o *** [.pioenvs/kc868-a6-test/src/esphome/components/tuya_iot/tuya_iot_component.cpp.o] Error 1 ========================= [FAILED] Took 403.43 seconds ========================= RE: Custom ESPHome firmware and Tuya integration - admin - 10-12-2025 do you want KC868-A6 work with tuya app by ESPHome? RE: Custom ESPHome firmware and Tuya integration - alexps70 - 10-13-2025 (10-12-2025, 11:17 PM)admin Wrote: do you want KC868-A6 work with tuya app by ESPHome? Yes |