Hi
I’m trying to create an integration to my heatpump with the help of the carrier.h library and Hass.io.
But, I just cant figure out where to put all the files in esphome and get it to work.
Is there a tutorial or blogpost that I might have missed? How is it done? All help is welcome.
I assume you have seen this https://esphome.io/components/climate/custom.html, and the links off that page.
Other than that trawl through the esphome subforum (ie the one you posted in), I think there are some examples in there.
Also there is good responsiveness on the esphome issues section on github.
When I flashed my iFan02 with ESPHome it required an “ifan02.h” file. I just put it in the same directory as my ifan02.yaml file. And then when I compiled it the compiler found the “.h” file and incorporated it with no issues.
Now I’ve tried to run esphome from cli instead from Hass.io.
This is my repo: https://github.com/freddan-teamleader/heatpump
I have placed my .h file together with my .yaml file
The error I get is:
src/main.cpp: In lambda function:
src/main.cpp:120:28: error: expected type-specifier before 'CarrierClimate'
auto my_sensor = new CarrierClimate();
^
src/main.cpp:122:24: error: could not convert '{my_sensor}' from '<brace-enclosed initializer list>' to 'std::vector<esphome::sensor::Sensor*>'
return {my_sensor};
^
src/main.cpp: In lambda function:
src/main.cpp:128:36: error: expected type-specifier before 'CarrierClimate'
auto my_custom_climate = new CarrierClimate();
^
src/main.cpp:130:32: error: could not convert '{my_custom_climate}' from '<brace-enclosed initializer list>' to 'std::vector<esphome::climate::Climate*>'
return {my_custom_climate};
I guess I have to include the .cpp file as well somewhere.
I have a feeling I read somewhere that you can include other components under a folder custom_components, under the directory you keep your yaml files in.