Smart Home Automation Forum
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)

Pages: 1 2


Custom ESPHome firmware and Tuya integration - Stouf - 08-04-2024

Hello,
I am trying to use your librairy but seem to always have the same compilation error, using the exemple or my own code. Maybe you have an idea of what it can be please?
(of course I have a license for the product, hc868-a6, but almost sure it's not related)



Code:
src/esphome/components/tuya_iot/tuya_iot_component.cpp: In lambda function:
src/esphome/components/tuya_iot/tuya_iot_component.cpp:167:96: error: invalid initialization of reference of type 'const json_parse_t&' {aka 'const std::function<bool(ArduinoJson6185_D1::ObjectRef)>&'} from expression of type 'esphome::tuya_iot::TuyaIotComponent::subscribe_json(const string&, const mqtt_json_callback_t&, uint8_t)::<lambda(const string&, const string&)>::<lambda(ArduinoJson::JsonObject)>'
         json::parse_json(payload, [topic, callback](JsonObject root) { callback(topic, root); });
                                                                                                ^
In file included from src/esphome.h:21,
                 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/json/json_util.h:26:6: note: in passing argument 2 of 'bool esphome::json::parse_json(const string&, const json_parse_t&)'
bool parse_json(const std::string &data, const json_parse_t &f);
      ^~~~~~~~~~
Compiling .pioenvs/tuya-test/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
*** [.pioenvs/tuya-test/src/esphome/components/tuya_iot/tuya_iot_component.cpp.o] Error 1
========================= [FAILED] Took 55.72 seconds =========================

Thank you very much


RE: Custom ESPHome firmware and Tuya integration - admin - 08-04-2024

i don't know what you want to do?


RE: Custom ESPHome firmware and Tuya integration - Stouf - 08-04-2024

I want to be able to control my device from the app. I already have everything working physically and using home assistant and/or mqtt, so I would want to finish the firmware by connecting the device to Tuya so it's also controllable using the app. (Smart Life for exemple)

Is it possible or did I missunderstood the whole thing?

Thank you.

EDIT: Basically I want to flash the exemple code you provided with the librairy, to the board, but the compilation fails.


RE: Custom ESPHome firmware and Tuya integration - admin - 08-04-2024

if you want to compile with Tuya arduino code. you need to install tuya wifi module arduino library firstly.
   


RE: Custom ESPHome firmware and Tuya integration - Stouf - 08-05-2024

(08-04-2024, 11:59 PM)admin Wrote: if you want to compile with Tuya arduino code. you need to install tuya wifi module arduino library firstly.

Thank you very much, I checked and have all the librairies installed, I'm using ESPHome and not Arduino IDE by the way so I presume that for the first time my ESPHome cannot locate the librairie....it's weird but it can be.


RE: Custom ESPHome firmware and Tuya integration - admin - 08-05-2024

if you use ESPHome, we have yaml demo for tuya , but that is only use for KinCony's product.


RE: Custom ESPHome firmware and Tuya integration - Stouf - 08-05-2024

(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.

What I use is a KinCony product, it's the KinCony KC868-A6, I'm just using my own firmware and not KCS. (I just tried KCS actually and it's working great)
I would just want to be able to use the board with my own ESPHome firmware. Could you share the yaml demo file please? (And I already have a Tuya license but I imagine that I wil need to buy and new one from Kincony right?)


RE: Custom ESPHome firmware and Tuya integration - admin - 08-05-2024

ok, i see now. if you are using KC868-A6, need use tuya license, config in ESPHome ymal. here is sample:
https://www.kincony.com/forum/showthread.php?tid=3502


RE: Custom ESPHome firmware and Tuya integration - Stouf - 08-05-2024

(08-05-2024, 10:24 PM)admin Wrote: ok, i see now. if you are using KC868-A6, need use tuya license, config in ESPHome ymal. here is sample:
https://www.kincony.com/forum/showthread.php?tid=3502

Ok I just bought the license. I'm emailing you with the details.


RE: Custom ESPHome firmware and Tuya integration - admin - 08-06-2024

we have sent to your email.