Comments (7)
Hi!
Could you please elaborate on the compilation failure, what error do you get?
from mhi-ac-ctrl-esphome.
Sure - so in the yaml config if i change the id like :
climate:
- platform: custom
lambda: |-
auto mhi_ac_ctrl = new MhiAcCtrl();
App.register_component(mhi_ac_ctrl);
return {mhi_ac_ctrl};
climates:
- name: "bedroomac"
id: bedroomac
when compiling is trowing those errors :
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Dependency Graph
|-- 1.2.3
|-- 2.1.0
| |-- 1.2.3
| |-- 1.0
| |-- 1.0
|-- 1.1.1
|-- 1.0
|-- 5.13.3
|-- 1.2
Compiling /data/mhi-ac-ctrl-bedroom/.pioenvs/mhi-ac-ctrl-bedroom/src/main.cpp.o
/config/esphome/mhi-ac-ctrl-bedroom.yaml: In lambda function:
/config/esphome/mhi-ac-ctrl-bedroom.yaml:83:27: error: 'mhi_ac_ctrl' was not declared in this scope
return ((MhiAcCtrl*)mhi_ac_ctrl)->get_sensors();
^
/config/esphome/mhi-ac-ctrl-bedroom.yaml: In lambda function:
/config/esphome/mhi-ac-ctrl-bedroom.yaml:101:27: error: 'mhi_ac_ctrl' was not declared in this scope
return ((MhiAcCtrl*)mhi_ac_ctrl)->get_binary_sensors();
^
/config/esphome/mhi-ac-ctrl-bedroom.yaml: In lambda function:
/config/esphome/mhi-ac-ctrl-bedroom.yaml:84:3: warning: control reaches end of non-void function [-Wreturn-type]
sensors:
^
/config/esphome/mhi-ac-ctrl-bedroom.yaml: In lambda function:
/config/esphome/mhi-ac-ctrl-bedroom.yaml:102:3: warning: control reaches end of non-void function [-Wreturn-type]
binary_sensors:
^
*** [/data/mhi-ac-ctrl-bedroom/.pioenvs/mhi-ac-ctrl-bedroom/src/main.cpp.o] Error 1
========================== [FAILED] Took 3.60 seconds ==========================
from mhi-ac-ctrl-esphome.
Ah, got it. Note the following lines in your error output:
return ((MhiAcCtrl*)mhi_ac_ctrl)->get_sensors();
return ((MhiAcCtrl*)mhi_ac_ctrl)->get_binary_sensors();
These point to the lambdas in sensor
and binary_sensor
sections of the yaml file, and are trying to reference your climate
component — these are the lines where you also need to replace mhi_ac_ctrl
with your id: in this case, bedroomac
. Note that you can use a more human-readable name
.
To avoid other conflicts, you'll probably want to change the name
parameter of the top esphome
section (second line of the .yaml file), as that's going to be the hostname of your ESP's.
from mhi-ac-ctrl-esphome.
Please let me know if the suggestion above helped...
from mhi-ac-ctrl-esphome.
Hi,
Yeah - whatever i have tried always fails to compile
here is my full config https://pastebin.com/BDUifscD
if i make any changes it on the above config it fails.
from mhi-ac-ctrl-esphome.
Something like this seems to work fine:
return {mhi_ac_ctrl};
climates:
- name: "Bedroom MHI AC Ctrl"
- id: mhi_ac_ctrl
+ id: bedroomac
# Sensors with general information.
sensor:
- platform: custom
lambda: |-
- return ((MhiAcCtrl*)mhi_ac_ctrl)->get_sensors();
+ return ((MhiAcCtrl*)bedroomac)->get_sensors();
sensors:
- name: "Error code bedroom"
- name: "Outdoor temperature bedroom"
@@ -129,7 +129,7 @@ sensor:
binary_sensor:
- platform: custom
lambda: |-
- return ((MhiAcCtrl*)mhi_ac_ctrl)->get_binary_sensors();
+ return ((MhiAcCtrl*)bedroomac)->get_binary_sensors();
binary_sensors:
- name: "Defrost bedroom"
from mhi-ac-ctrl-esphome.
That worked
from mhi-ac-ctrl-esphome.
Related Issues (20)
- Power Status always on on reboot HOT 4
- Change status icon when air conditioner mode is changed HOT 1
- Strange temperature readings when at least one of my ACs is turned ON HOT 4
- Restore previous settings from hassio HOT 3
- Forked, but up-to-date? HOT 4
- Climate degrees steps HOT 3
- Low, Medium, High, Auto HOT 18
- Power to kWh HOT 7
- When turning on heating - temp up by 2 degrees HOT 2
- Room Temperature HOT 13
- Total run time is, was and stays 100h HOT 11
- ESP32 - D1 Mini Pro HOT 25
- Current power - indoor and/or outdoor? HOT 3
- (Default) update_interval? HOT 1
- Vane up/down control resets vane left/right HOT 5
- Control fanspeed and swingposition through webserver HOT 5
- DS18B20 as external temperature sensor HOT 2
- MHI-AC-Ctrl v2.6 update? HOT 13
- Since ESPheom update I get an error: warning: 'esphome::climate::Climate::away' is deprecated: away is deprecated, use preset instead [-Wdeprecated-declarations] HOT 3
- Understanding energy consumption
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mhi-ac-ctrl-esphome.