Hi, I’ve spent many hours trying to figure out how exactly the new external component works, but I am in a dead spot.
I have forked an external component that creates a Climate Thermostat to manage Toshiba Air Conditioners that use the AB protocol. I’ve changed a couple of things to suit my ducted system and slightly improve some bits, and so far it works. I have also redesigned the original project board with and ESP12 and eliminated the need for usb power. Which I plan to publish when this is finished.
The project is here:
https://github.com/makusets/esphome-tcc-link/tree/main
However, my unit does not report the room temperature from the wall remote, instead it reports the return duct intake air temperature. And that is what I see in the thermostat element.
To correct that, I have included a BME280 I2C sensor on the board, which is working fine and reporting the temperature as a separate entity.
Now, my problem, I want to be able to access the BME sensor reported temperature from my external component, so that I can use it to fill the thermostat room temp variable. I don’t know how to do that. I am not sure how am I suppose to put that in the py file and how to access it later from the cpp file.
This is my YAML file:
esphome:
name: toshibaab-wifi-link
friendly_name: ToshibaAB_wifi_link
esp8266:
board: esp12e
# Enable logging
logger:
baud_rate: 0 #disable hardware UART log
level: DEBUG
# Enable Home Assistant API
api:
encryption:
key: "****"
ota:
password: "****"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ap_timeout: 180s
ssid: "Toshibaab-Wifi-Link"
password: "****"
captive_portal:
i2c:
sda: GPIO2
scl: GPIO14
scan: True
external_components:
- source:
type: git
url: https://github.com/makusets/esphome-tcc-link
refresh: 0s
uart:
tx_pin: GPIO15
rx_pin: GPIO13
baud_rate: 2400
parity: EVEN
climate:
- platform: tcc_link
name: "Toshiba AC"
id: toshiba_ac
connected:
name: "Toshiba AC Connected"
failed_crcs:
name: "Toshiba AC Failed CRCs"
vent:
name: "Toshiba AC Vent Switch"
on_data_received:
- lambda: |-
ESP_LOGD("TU2C", "Data received: %d bytes", x.size());
sensor:
- platform: bme280_i2c
temperature:
name: "Toshiba Temperature"
id: esp_sensor_temp
oversampling: 1x
pressure:
name: "Toshiba Pressure"
id: toshiba_pressure
accuracy_decimals: 0
oversampling: 1x
humidity:
name: "Toshiba Humidity"
id: toshiba_humidity
accuracy_decimals: 0
oversampling: 2x
address: 0x76
update_interval: 30s
The sensor I want to be able to access is esp_sensor_temp
I have been playing around with the python file, but I couldn’t figure it out.
Any suggestions would be greatly appreciated.
Miquel