diff --git a/esphome/README.md b/esphome/README.md index 330320d..7151fdf 100644 --- a/esphome/README.md +++ b/esphome/README.md @@ -1,6 +1,8 @@ # Installation OTA Update Shelly Device to tasmota: https://github.com/arendst/mgos-to-tasmota +On gen 3 devices just download zip file from below and upload it over the web interface to shelly: +https://github.com/tasmota/mgos32-to-tasmota32/releases In Tasmota make OTA Update to minimal: http://ota.tasmota.com/tasmota/release/tasmota-minimal.bin.gz Make ESPHome Configuration in Dashboard: diff --git a/esphome/hallway-switch.yaml b/esphome/hallway-switch.yaml new file mode 100644 index 0000000..82d6eef --- /dev/null +++ b/esphome/hallway-switch.yaml @@ -0,0 +1,100 @@ +substitutions: + devicename: hallway-switch + max_power: "2000.0" # watt + max_temp: "80.0" # °C + +esphome: + name: ${devicename} + +#esp32: +# board: esp32-c3-devkitm-1 +# flash_size: 8MB +# framework: +# type: esp-idf +# variant: esp32c3 + +esp32: + board: esp32-c3-devkitm-1 + flash_size: 8MB + framework: + type: esp-idf + version: recommended + sdkconfig_options: + COMPILER_OPTIMIZATION_SIZE: y + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +logger: + +api: + +ota: + platform: esphome + +sensor: + - platform: ntc + sensor: temp_resistance_reading + name: "Temperature" + unit_of_measurement: "°C" + accuracy_decimals: 1 + icon: "mdi:thermometer" + calibration: + b_constant: 3350 + reference_resistance: 10kOhm + reference_temperature: 298.15K + on_value_range: + - above: ${max_temp} + then: + - output.turn_off: relay_output + - homeassistant.service: + service: persistent_notification.create + data: + title: Message from ${devicename} + data_template: + message: Switch turned off because temperature exceeded ${max_temp}°C + - platform: resistance + id: temp_resistance_reading + sensor: temp_analog_reading + configuration: DOWNSTREAM + resistor: 10kOhm + - platform: adc + id: temp_analog_reading + pin: GPIO3 + attenuation: 12db + +output: + - platform: gpio + id: "relay_output" + pin: 7 + +switch: + - platform: output + id: "relay" + name: "Relay" + output: "relay_output" + +binary_sensor: + - platform: gpio + name: "Switch" + pin: 10 + on_press: + then: + - switch.toggle: "relay" + filters: + - delayed_on_off: 50ms + + - platform: gpio + name: "Button" + pin: + number: 1 + inverted: yes + mode: + input: true + pullup: true + +status_led: + pin: + number: 0 + inverted: true \ No newline at end of file diff --git a/esphome/presense-bedroom.yaml b/esphome/presense-bedroom.yaml new file mode 100644 index 0000000..6e165cd --- /dev/null +++ b/esphome/presense-bedroom.yaml @@ -0,0 +1,33 @@ +esphome: + name: presense-bedroom + friendly_name: presense-bedroom + +esp32: + board: esp32dev + framework: + type: arduino + +# Enable logging +logger: + +# Enable Home Assistant API +api: + +ota: + - platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Presense-Bedroom Fallback" + password: "jMTo5YkCC01q" + +captive_portal: + +bluetooth_proxy: + \ No newline at end of file diff --git a/esphome/presense-hallway.yaml b/esphome/presense-hallway.yaml new file mode 100644 index 0000000..493fba4 --- /dev/null +++ b/esphome/presense-hallway.yaml @@ -0,0 +1,33 @@ +esphome: + name: presense-hallway + friendly_name: presense-hallway + +esp32: + board: esp32dev + framework: + type: arduino + +# Enable logging +logger: + +# Enable Home Assistant API +api: + +ota: + - platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Presense-Hallway Fallback" + password: "jMTo5YkCC01q" + +captive_portal: + +bluetooth_proxy: + \ No newline at end of file diff --git a/esphome/presense-kitchen.yaml b/esphome/presense-kitchen.yaml new file mode 100644 index 0000000..66f8fcd --- /dev/null +++ b/esphome/presense-kitchen.yaml @@ -0,0 +1,33 @@ +esphome: + name: presense-kitchen + friendly_name: presense-kitchen + +esp32: + board: esp32dev + framework: + type: arduino + +# Enable logging +logger: + +# Enable Home Assistant API +api: + +ota: + - platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Presense-Kitchen Fallback" + password: "jMTo5YkCC01q" + +captive_portal: + +bluetooth_proxy: + \ No newline at end of file diff --git a/esphome/presense-office.yaml b/esphome/presense-office.yaml new file mode 100644 index 0000000..47fab15 --- /dev/null +++ b/esphome/presense-office.yaml @@ -0,0 +1,55 @@ +esphome: + name: presense-office + friendly_name: presense-office + +esp32: + board: esp32dev + framework: + type: esp-idf + +# Enable logging +logger: + +# Enable Home Assistant API +api: + +ota: + - platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Presense-Office Fallback Hotspot" + password: "jMTo5YkCC01q" + +captive_portal: + +bluetooth_proxy: + +external_components: + - source: github://koying/esphome-ble-remote@master + components: [ ble_client_hid ] + +ble_client: + - id: ble_client_1 + mac_address: "90:f8:2e:f9:d7:32" # Replace with your remote's MAC address + +ble_client_hid: + - id: ble_client_hid_1 + ble_client_id: ble_client_1 + +sensor: + - platform: ble_client_hid + type: last_event_value + name: "Last Event Value" + ble_client_hid_id: ble_client_hid_1 + +text_sensor: + - platform: ble_client_hid + name: "Last Event Usage" + ble_client_hid_id: ble_client_hid_1 \ No newline at end of file