diff --git a/.gitignore b/.gitignore index e516624..b8e7845 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,13 @@ # Gitignore settings for ESPHome # This is an example and may include too much for your use-case. # You can modify this file to suit your needs. -/.esphome/ +**/.esphome/ **/.pioenvs/ **/.piolibdeps/ **/lib/ **/src/ **/platformio.ini -/secrets.yaml -/livingroom_ac/ -/kitchen_ac/ \ No newline at end of file +**/secrets.yaml +**/livingroom_ac/ +**/kitchen_ac/ +/examples/*/*.h \ No newline at end of file diff --git a/examples/advanced/.gitignore b/examples/advanced/.gitignore new file mode 100644 index 0000000..0bbf89c --- /dev/null +++ b/examples/advanced/.gitignore @@ -0,0 +1,10 @@ +# Gitignore settings for ESPHome +# This is an example and may include too much for your use-case. +# You can modify this file to suit your needs. +/.esphome/ +**/.pioenvs/ +**/.piolibdeps/ +**/lib/ +**/src/ +**/platformio.ini +/secrets.yaml diff --git a/ac_common.yaml b/examples/advanced/ac_common.yaml similarity index 95% rename from ac_common.yaml rename to examples/advanced/ac_common.yaml index aa7e2f0..4685ae1 100644 --- a/ac_common.yaml +++ b/examples/advanced/ac_common.yaml @@ -25,8 +25,7 @@ debug: logger: level: DEBUG - # important: for avoiding collisions logger works with UART1 (for esp8266 tx = GPIO2, rx = None) - hardware_uart: UART1 + baud_rate: 0 api: password: !secret api_pass diff --git a/ac_kitchen.yaml b/examples/advanced/ac_kitchen.yaml similarity index 100% rename from ac_kitchen.yaml rename to examples/advanced/ac_kitchen.yaml diff --git a/ac_livingroom.yaml b/examples/advanced/ac_livingroom.yaml similarity index 100% rename from ac_livingroom.yaml rename to examples/advanced/ac_livingroom.yaml diff --git a/examples/simple/.gitignore b/examples/simple/.gitignore new file mode 100644 index 0000000..0bbf89c --- /dev/null +++ b/examples/simple/.gitignore @@ -0,0 +1,10 @@ +# Gitignore settings for ESPHome +# This is an example and may include too much for your use-case. +# You can modify this file to suit your needs. +/.esphome/ +**/.pioenvs/ +**/.piolibdeps/ +**/lib/ +**/src/ +**/platformio.ini +/secrets.yaml diff --git a/examples/simple/aux_ac_simple.yaml b/examples/simple/aux_ac_simple.yaml new file mode 100644 index 0000000..f352126 --- /dev/null +++ b/examples/simple/aux_ac_simple.yaml @@ -0,0 +1,72 @@ +esphome: + name: aux_air_conditioner + platform: ESP8266 + board: esp12e + includes: + - aux_ac_custom_component.h + +# don't forget to set your's wifi settings! +wifi: + ssid: "WIFI SSID" + password: "seCRETpassWORD" + manual_ip: + static_ip: 192.168.0.2 + gateway: 192.168.0.1 + subnet: 255.255.255.0 + ap: + ssid: AUX Hotspot + password: "seCREThotSPOTpassWORD" + +captive_portal: +debug: + +logger: + level: DEBUG + baud_rate: 0 + +api: + +ota: + +# UART0 configuration for AUX air conditioner communication +uart: + id: ac_uart_bus + tx_pin: GPIO1 + rx_pin: GPIO3 + baud_rate: 4800 + data_bits: 8 + parity: EVEN + stop_bits: 1 + +climate: +# register custom AC climate +- platform: custom + lambda: |- + extern AirCon acAirCon; + if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus)); + App.register_component(&acAirCon); + return {&acAirCon}; + climates: + - name: AUX hvac + +sensor: + - platform: custom + lambda: |- + extern AirCon acAirCon; + if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus)); + App.register_component(&acAirCon); + return {acAirCon.sensor_ambient_temperature}; + sensors: + - name: AUX ambient temperature + unit_of_measurement: "°C" + accuracy_decimals: 1 + +text_sensor: +- platform: custom + lambda: |- + auto aircon_firmware_version = new AirConFirmwareVersion(); + App.register_component(aircon_firmware_version); + return {aircon_firmware_version}; + text_sensors: + name: AUX firmware version + icon: "mdi:chip" \ No newline at end of file