diff --git a/README.md b/README.md index 4f3a5e9..9e598fe 100644 --- a/README.md +++ b/README.md @@ -1,3 +1 @@ -# Esphome_configs - -In his repository I collect my esphome configurations. \ No newline at end of file +https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Switch diff --git a/pdfs/BST-BME280_DS001-10.pdf b/pdfs/BST-BME280_DS001-10.pdf new file mode 100644 index 0000000..b738d3f Binary files /dev/null and b/pdfs/BST-BME280_DS001-10.pdf differ diff --git a/pdfs/nodemcu-v3-ch340-schematics.pdf b/pdfs/nodemcu-v3-ch340-schematics.pdf new file mode 100644 index 0000000..67f8b87 Binary files /dev/null and b/pdfs/nodemcu-v3-ch340-schematics.pdf differ diff --git a/pdfs/schematic_esp-12e.pdf b/pdfs/schematic_esp-12e.pdf new file mode 100644 index 0000000..045d425 Binary files /dev/null and b/pdfs/schematic_esp-12e.pdf differ diff --git a/shower.yaml b/shower.yaml new file mode 100644 index 0000000..9164b48 --- /dev/null +++ b/shower.yaml @@ -0,0 +1,91 @@ +esphome: + name: shower + +esp8266: + board: nodemcuv2 + +# Enable logging +logger: + +http_request: + verify_ssl: false + +# Enable Home Assistant API +api: + password: "4FExAkAyCl" + +ota: + - platform: esphome + password: "4FExAkAyCl" + +wifi: + ssid: "5G_Router_37F6E8" + password: "7rCD6C2F27F7" + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Shower Fallback Hotspot" + password: "ZzY1E2eNv819" + +captive_portal: + +switch: + - platform: gpio + name: "LEDDI" + pin: GPIO2 + inverted: true + +web_server: + port: 80 + +# HW SPI +spi: + - id: spi_bus + clk_pin: D5 + mosi_pin: D7 + miso_pin: D6 + interface: hardware + +# Global variable for state machine +globals: + - id: turned_on_fan + type: boolean + initial_value: "false" + +# BME280 sensor +sensor: + - platform: bme280_spi + + temperature: + name: "BME280 Temperature" + id: bme280_temperature + + humidity: + name: "BME280 Humidity" + id: bme280_humidity + on_value: + then: + - if: + condition: + lambda: "return ( id(bme280_humidity).state >= 60.0 && !id(turned_on_fan) ); // Humidity reached threshold of 60 % and fan has not been turned on yet" + then: + - lambda: |- + id(turned_on_fan) = true; // This node needs to turn off fan if it was the one that turned it on. Therefore we memorize it. + - http_request.get: + url: "http://shelly1pmminig3-54320455c604.local/rpc/Switch.Set?on=true&id=0" + else: + - if: + condition: + lambda: "return id(bme280_humidity).state <= 50.0 && id(turned_on_fan); // Hysteresis." + then: + - lambda: |- + id(turned_on_fan) = false; // Reset fan. + - http_request.get: + url: "http://shelly1pmminig3-54320455c604.local/rpc/Switch.Set?on=false&id=0" + + pressure: + name: "BME280 Pressure" + id: bme280_pressure + + cs_pin: GPIO4 + update_interval: 10s \ No newline at end of file