07-01-2025, 01:19 PM
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:
Could you point me out to what could be the problem. Am I missing something?
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:
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/core/string_ref.h:11,
from src/esphome/core/entity_base.h:5,
from src/esphome/components/sensor/sensor.h:4,
from src/esphome/components/adc/adc_sensor.h:3,
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/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);
^~~~~~~~~~
*** [.pioenvs/hankerila-a6/src/esphome/components/tuya_iot/tuya_iot_component.cpp.o] Error 1Could you point me out to what could be the problem. Am I missing something?

