-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from echavet/echavet-atoms3-example
Echavet atoms3 example configuration
- Loading branch information
Showing
12 changed files
with
422 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# atoms3 configuration example | ||
this directory contains an example of a tested configuration firmware for controling a Mitsubishi cooling unit via CN105. | ||
Please note that, as an example too, this config includes the bt-proxy. This allows me to control my Gardena Irrigation Vane thanks to its proximity to the unit. | ||
|
||
Here is the discussion link: | ||
https://github.com/echavet/MitsubishiCN105ESPHome/discussions/83 | ||
|
||
![Picture of an atom S3 ship mounted on a unit.](https://github.com/echavet/atoms3/blob/main/IMG_5664.jpg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
substitutions: | ||
name: "atom-s3" | ||
friendly_name: "M5Stack Atom S3 bt proxy + cn105" | ||
clim_name: Clim Sejour | ||
|
||
esphome: | ||
name: ${name} | ||
friendly_name: ${friendly_name} | ||
min_version: 2024.6.0 | ||
name_add_mac_suffix: true | ||
project: | ||
name: esphome.clim_and_nt_proxy | ||
version: "24.7.4.1" | ||
|
||
debug: | ||
update_interval: 5s | ||
|
||
# Enable logging | ||
logger: | ||
#hardware_uart: USB_CDC | ||
level: INFO | ||
|
||
esp32: | ||
board: esp32-s3-devkitc-1 | ||
|
||
#board: m5stack-cores3 | ||
#variant: ESP32S3 | ||
framework: | ||
type: arduino | ||
#type: esp-idf | ||
version: recommended | ||
flash_size: 8MB | ||
|
||
# mqtt, api, ota, wifi, captive, web, time | ||
<<: !include includes/ha-integration-config.yaml | ||
|
||
# display button and api status binary_sensor configuration | ||
<<: !include includes/binary-sensor-config.yaml | ||
|
||
# displays infos on atom screen | ||
<<: !include includes/display_config.yaml | ||
# configure esp bluetooth proxy | ||
<<: !include includes/bt-proxy-config.yaml | ||
|
||
# cn105 mitsubishi climate config | ||
<<: !include includes/climate-config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
services: | ||
- service: reboot | ||
then: | ||
- logger.log: "Redémarrage en cours..." | ||
- lambda: |- | ||
esp_restart(); | ||
- service: set_remote_temperature | ||
variables: | ||
temperature: float | ||
then: | ||
- lambda: 'id(atoms3_clim).set_remote_temperature(temperature);' | ||
|
||
- service: use_internal_temperature | ||
then: | ||
- lambda: 'id(atoms3_clim).set_remote_temperature(0);' | ||
|
||
encryption: | ||
key: !secret encryption_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
binary_sensor: | ||
- platform: status | ||
name: "Home Assistant API Connection" | ||
id: ha_api_status | ||
|
||
- platform: gpio | ||
name: Button | ||
pin: | ||
number: GPIO41 | ||
inverted: true | ||
mode: | ||
input: true | ||
pullup: true | ||
filters: | ||
- delayed_off: 10ms | ||
|
||
on_click: | ||
- min_length: 10ms | ||
max_length: 350ms | ||
then: | ||
- logger.log: Button short click | ||
# - display_menu.show: test_graphical_display_menu | ||
- lambda: |- | ||
id(current_page)++; | ||
if (id(current_page) >= 3) { // Nombre de pages (index 0 et 1 dans cet exemple) | ||
id(current_page) = 0; | ||
} | ||
if (id(current_page) == 0) { | ||
id(display_tft).show_page(id(page1)); | ||
} else if (id(current_page) == 1) { | ||
id(display_tft).show_page(id(page2)); | ||
} else if (id(current_page) == 2) { | ||
id(display_tft).show_page(id(page3)); | ||
} | ||
- min_length: 350ms | ||
max_length: 4000ms | ||
then: | ||
- logger.log: Button long click |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
remote_transmitter: | ||
pin: GPIO4 | ||
carrier_duty_percent: 50% | ||
|
||
|
||
esp32_ble_tracker: | ||
scan_parameters: | ||
# We currently use the defaults to ensure Bluetooth | ||
# can co-exist with WiFi In the future we may be able to | ||
# enable the built-in coexistence logic in ESP-IDF | ||
active: true | ||
|
||
bluetooth_proxy: | ||
active: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# includes diagnostic sensors | ||
<<: !include diag-sensor-config.yaml | ||
|
||
external_components: | ||
- source: github://echavet/MitsubishiCN105ESPHome | ||
refresh: 0s | ||
uart: | ||
id: HP_UART | ||
baud_rate: 2400 | ||
tx_pin: GPIO01 #G1 | ||
rx_pin: GPIO02 #G2 | ||
climate: | ||
- platform: cn105 | ||
name: ${clim_name} | ||
id: "atoms3_clim" | ||
compressor_frequency_sensor: | ||
name: Compressor frequency (clim Sejour) | ||
input_power_sensor: | ||
name: Input power | ||
kwh_sensor: | ||
name: Energy usage | ||
runtime_hours_sensor: | ||
name: Runtime hours | ||
|
||
outside_air_temperature_sensor: | ||
name: ${name} Outside air temperature | ||
vertical_vane_select: | ||
name: Orientation de la Vane Verticale | ||
horizontal_vane_select: | ||
name: Orientation de la Vane Horizontale | ||
isee_sensor: | ||
name: ISEE Sensor | ||
auto_sub_mode_sensor: | ||
name: auto-submode sensor | ||
sub_mode_sensor: | ||
name: submode sensor | ||
stage_sensor: | ||
name: stage sensor | ||
remote_temperature_timeout: 15min | ||
update_interval: 2300ms # shouldn't be less than 1 second | ||
debounce_delay: 100ms # delay to prevent bouncing | ||
hp_uptime_connection_sensor: | ||
name: ${name} HP Uptime Connection | ||
update_interval: 10s | ||
supports: | ||
mode: [COOL, HEAT, FAN_ONLY, DRY] | ||
fan_mode: [AUTO, QUIET, LOW, MEDIUM, HIGH] | ||
swing_mode: ["OFF", VERTICAL] | ||
visual: | ||
min_temperature: 17 | ||
max_temperature: 28 | ||
temperature_step: | ||
target_temperature: 0.5 | ||
current_temperature: 0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
|
||
sensor: | ||
# # Sensors with general information. | ||
- platform: template | ||
name: "dg_uart_connected" | ||
entity_category: DIAGNOSTIC | ||
lambda: |- | ||
return (bool) id(atoms3_clim).isUARTConnected_; | ||
update_interval: 30s | ||
|
||
- platform: template | ||
name: "dg_complete_cycles" | ||
entity_category: DIAGNOSTIC | ||
accuracy_decimals: 0 | ||
lambda: |- | ||
return (unsigned long) id(atoms3_clim).nbCompleteCycles_; | ||
update_interval: 60s | ||
|
||
- platform: template | ||
name: "dg_total_cycles" | ||
accuracy_decimals: 0 | ||
entity_category: DIAGNOSTIC | ||
lambda: |- | ||
return (unsigned long) id(atoms3_clim).nbCycles_; | ||
update_interval: 60s | ||
- platform: template | ||
name: "dg_nb_hp_connections" | ||
accuracy_decimals: 0 | ||
entity_category: DIAGNOSTIC | ||
lambda: |- | ||
return (unsigned int) id(atoms3_clim).nbHeatpumpConnections_; | ||
update_interval: 60s | ||
|
||
- platform: template | ||
name: "dg_complete_cycles_percent" | ||
id: complete_cycles_percent | ||
unit_of_measurement: "%" | ||
accuracy_decimals: 1 | ||
entity_category: DIAGNOSTIC | ||
lambda: |- | ||
unsigned long nbCompleteCycles = id(atoms3_clim).nbCompleteCycles_; | ||
unsigned long nbCycles = id(atoms3_clim).nbCycles_; | ||
if (nbCycles == 0) { | ||
return 0.0; | ||
} | ||
return (float) nbCompleteCycles / nbCycles * 100.0; | ||
update_interval: 60s | ||
|
||
- platform: debug | ||
free: | ||
name: "Heap Free" | ||
# fragmentation: | ||
# name: "Heap Fragmentation" | ||
# block: | ||
# name: "Heap Max Block" | ||
# loop_time: | ||
# name: "Loop Time" | ||
# psram: | ||
# name: "Free PSRAM" | ||
|
||
|
||
# Uptime sensor. | ||
- platform: uptime | ||
name: ${name} Uptime | ||
|
||
# WiFi Signal sensor. | ||
- platform: wifi_signal | ||
id: wifi_signal_dbm | ||
name: ${name} WiFi Signal | ||
update_interval: 60s | ||
|
||
- platform: homeassistant | ||
id: ha_cdeg_sejour_et_cuisine | ||
entity_id: sensor.temperature_sejour | ||
internal: true | ||
on_value: | ||
then: | ||
- lambda: |- | ||
id(atoms3_clim).set_remote_temperature(x); | ||
text_sensor: | ||
# Expose ESPHome version as sensor. | ||
- platform: version | ||
name: ${name} ESPHome Version | ||
# Expose WiFi information as sensors. | ||
- platform: wifi_info | ||
ip_address: | ||
name: ${name} IP | ||
id: wifi_ip # ID pour référence dans l'écran | ||
ssid: | ||
name: ${name} SSID | ||
id: wifi_ssid # ID pour référence dans l'écran | ||
bssid: | ||
name: ${name} BSSID | ||
id: wifi_bssid # ID pour référence dans l'écran | ||
|
||
- platform: debug | ||
device: | ||
name: "Device Info" | ||
reset_reason: | ||
name: "Reset Reason" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
globals: | ||
- id: current_page | ||
type: "int" | ||
initial_value: "0" | ||
|
||
font: !include fonts.yaml | ||
|
||
spi: | ||
clk_pin: 17 | ||
mosi_pin: 21 | ||
|
||
display: | ||
- platform: st7789v | ||
id: display_tft | ||
model: Custom | ||
height: 128 | ||
width: 128 | ||
rotation: 0 | ||
offset_height: 2 | ||
offset_width: 1 | ||
backlight_pin: 16 | ||
cs_pin: 15 | ||
dc_pin: 33 #RS/DC | ||
reset_pin: 34 | ||
eightbitcolor: true | ||
update_interval: 05s | ||
pages: | ||
- id: page1 | ||
lambda: |- | ||
Color color_orange(255, 165, 0); | ||
Color color_blue(0, 0, 255); | ||
Color color_yellow(255, 255, 0); | ||
Color color_black(0, 0, 0); | ||
// Changer la couleur de fond en fonction du mode du climatiseur | ||
if (id(atoms3_clim).mode == esphome::climate::CLIMATE_MODE_HEAT) { | ||
it.fill(color_orange); | ||
} else if (id(atoms3_clim).mode == esphome::climate::CLIMATE_MODE_COOL) { | ||
it.fill(color_blue); | ||
} else if (id(atoms3_clim).mode == esphome::climate::CLIMATE_MODE_FAN_ONLY) { | ||
it.fill(color_yellow); | ||
} else { | ||
it.fill(color_black); | ||
} | ||
// Afficher la température de consigne en grand texte | ||
it.printf(it.get_width() / 2, it.get_height() / 2 - 10, id(font_display), TextAlign::CENTER, "%.1f °C", id(atoms3_clim).target_temperature); | ||
// Afficher la température de la pièce en texte plus petit en dessous | ||
it.printf(it.get_width() / 2, it.get_height() / 2 + 32, id(font_data), TextAlign::CENTER, "%.1f °C", id(atoms3_clim).current_temperature); | ||
- id: page2 | ||
lambda: |- | ||
it.rectangle(0, 0, it.get_width(), it.get_height()); | ||
it.print(2, 2, id(font_title), "WiFi:"); | ||
// En-tête pour l'IP | ||
it.print(2, 22, id(font_header), "IP:"); | ||
// Donnée pour l'IP | ||
it.print(2, 34, id(font_data), id(wifi_ip).state.c_str()); | ||
// En-tête pour le SSID | ||
it.print(2, 54, id(font_header), "SSID:"); | ||
// Donnée pour le SSID | ||
it.print(2, 66, id(font_data), id(wifi_ssid).state.c_str()); | ||
// En-tête pour le BSSID | ||
it.print(2, 86, id(font_header), "BSSID:"); | ||
// Donnée pour le BSSID | ||
it.print(2, 98, id(font_data), id(wifi_bssid).state.c_str()); | ||
it.printf(2, 112, id(font_header), "signal: %.1f dBm", id(wifi_signal_dbm).state); | ||
- id: page3 | ||
lambda: |- | ||
it.rectangle(0, 0, it.get_width(), it.get_height()); | ||
// Section HA Integration | ||
it.print(2, 2, id(font_title), "HA Integration:"); | ||
it.strftime(12, 22, id(font_data), "%H:%M:%S", id(ha_time).now()); | ||
it.print(12, 36, id(font_data), "API & MQTT"); | ||
it.printf(16, 48, id(font_data), "Status: %s", id(ha_api_status).state?"OK":"FAILED"); | ||
// Section Climate UART | ||
it.print(2, 66, id(font_title), "Climate UART:"); | ||
it.print(2, 87, id(font_data), "Successful cycles:"); | ||
it.printf(12, 100, id(font_data), "%.1f%%", id(complete_cycles_percent).state); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
- file: "gfonts://Roboto" | ||
id: font_header | ||
size: 14 | ||
- file: "gfonts://Roboto" | ||
id: font_data | ||
size: 12 | ||
- file: "gfonts://Roboto" | ||
id: font_title | ||
size: 18 | ||
- file: "gfonts://Roboto" | ||
id: font_display | ||
size: 30 |
Oops, something went wrong.