Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vaninanton committed Dec 28, 2024
1 parent 85f1add commit 609ee09
Show file tree
Hide file tree
Showing 11 changed files with 365 additions and 155 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ jobs:
matrix:
#### Modify below here to match your project ####
file:
- project-template-esp32
- project-template-esp32-c3
- project-template-esp32-s3
- esphome-gauhartas204-esp8266
#### Modify above here to match your project ####

esphome-version:
- stable
- beta
- dev
# - beta
# - dev
steps:
- name: Checkout source code
uses: actions/[email protected]
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/publish-firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ jobs:
with:
#### Modify below here to match your project ####
files: |
project-template-esp32.factory.yaml
project-template-esp32-c3.factory.yaml
project-template-esp32-s3.factory.yaml
esphome-gauhartas204-esp8266.factory.yaml
esphome-version: 2024.10.3
combined-name: project-template
combined-name: esphome-gauhartas204
#### Modify above here to match your project ####

release-summary: ${{ github.event.release.body }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
packages:
# Include all of the core configuration
core: !include project-template-esp32-c3.yaml
core: !include esphome-gauhartas204-esp8266.yaml

esphome:
# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
name: vaninanton.esphome-gauhartas204
version: dev # This will be replaced by the github workflows with the `release` version
includes:
- uart_read_line_sensor.h

# This should point to the public location of the yaml file that will be adopted.
# In this case it is the core yaml file that does not contain the extra things
# that are provided by this factory yaml file as the user does not need these once adopted.
dashboard_import:
package_import_url: github://esphome/esphome-project-template/project-template-esp32-c3.yaml@main

# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
authorizer: none
package_import_url: github://vaninanton/esphome-gauhartas204/esphome-gauhartas204-esp8266.yaml@main

# Sets up the improv via serial client for Wi-Fi provisioning.
# Handy if your device has a usb port for the user to add credentials when they first get it.
Expand Down
234 changes: 234 additions & 0 deletions esphome-gauhartas204-esp8266.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
esphome:
name: esphome-gauhartas204
friendly_name: ESPHome Gauhartas 204
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
# name_add_mac_suffix: true

esp8266:
board: d1_mini
framework:
version: recommended

# To be able to get logs from the device via serial and api.
logger:

# API is a requirement of the dashboard import.
api:

# OTA is required for Over-the-Air updating
ota:
- platform: esphome

wifi:
# Set up a wifi access point using the device name above
ap:

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device.
captive_portal:

web_server:
port: 80
version: 3

uart:
- id: uart_bus
baud_rate: 19200
tx_pin: GPIO1
rx_pin: GPIO3

switch:
# - platform: uart
# name: "prt10"
# id: "prt10"
# data:
# turn_on: "*1 PRT 0 1 $\r\n"
# turn_off: "*1 PRT 0 0 $\r\n"

- platform: uart
name: "BathroomLight"
id: "BathroomLight"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*1 PRT 1 1 $\r\n"
turn_off: "*1 PRT 1 0 $\r\n"

- platform: uart
name: "BathroomHall"
id: "BathroomHall"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*1 PRT 2 1 $\r\n"
turn_off: "*1 PRT 2 0 $\r\n"

- platform: uart
name: "KitchenLight"
id: "KitchenLight"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*1 PRT 3 1 $\r\n"
turn_off: "*1 PRT 3 0 $\r\n"

- platform: uart
name: "KitchenTable"
id: "KitchenTable"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*1 PRT 4 1 $\r\n"
turn_off: "*1 PRT 4 0 $\r\n"

- platform: uart
name: "HallLight"
id: "HallLight"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*1 PRT 5 1 $\r\n"
turn_off: "*1 PRT 5 0 $\r\n"

- platform: uart
name: "LivingroomSubLight"
id: "LivingroomSubLight"
icon: "mdi:wall-sconce"
data:
turn_on: "*1 PRT 6 1 $\r\n"
turn_off: "*1 PRT 6 0 $\r\n"

- platform: uart
name: "BathroomSubLight"
id: "BathroomSubLight"
icon: "mdi:wall-sconce"
data:
turn_on: "*1 PRT 7 1 $\r\n"
turn_off: "*1 PRT 7 0 $\r\n"

# - platform: uart
# name: "prt20"
# id: "prt20"
# data:
# turn_on: "*2 PRT 0 1 $\r\n"
# turn_off: "*2 PRT 0 0 $\r\n"

- platform: uart
name: "SleepingroomRight"
id: "SleepingroomRight"
icon: "mdi:wall-sconce"
data:
turn_on: "*2 PRT 1 1 $\r\n"
turn_off: "*2 PRT 1 0 $\r\n"

- platform: uart
name: "BalconyLight"
id: "BalconyLight"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*2 PRT 2 1 $\r\n"
turn_off: "*2 PRT 2 0 $\r\n"

- platform: uart
name: "SleepingroomLight"
id: "SleepingroomLight"
icon: "mdi:bed-king-outline"
data:
turn_on: "*2 PRT 3 1 $\r\n"
turn_off: "*2 PRT 3 0 $\r\n"

# - platform: uart
# name: "prt24"
# id: "prt24"
# data:
# turn_on: "*2 PRT 4 1 $\r\n"
# turn_off: "*2 PRT 4 0 $\r\n"

- platform: uart
name: "SleepingroomLeft"
id: "SleepingroomLeft"
icon: "mdi:wall-sconce"
data:
turn_on: "*2 PRT 5 1 $\r\n"
turn_off: "*2 PRT 5 0 $\r\n"

- platform: uart
name: "LivingroomLight"
id: "LivingroomLight"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*2 PRT 6 1 $\r\n"
turn_off: "*2 PRT 6 0 $\r\n"

- platform: uart
id: SleepingroomWardrobe
icon: "mdi:wardrobe-outline"
data:
turn_on: "*2 PRT 7 1 $\r\n"
turn_off: "*2 PRT 7 0 $\r\n"

button:
- platform: uart
name: "Выключить всё"
data: "*999998$\r\n"
id: "alloff"
icon: "mdi:power"

- platform: uart
entity_category: "diagnostic"
name: "status_wm_on"
data: "*WM ON$\r\n"
internal: true

- platform: uart
entity_category: "diagnostic"
name: "status_wm_off"
data: "*WM OFF$\r\n"
internal: true

- platform: uart
entity_category: "diagnostic"
name: "status_wm_inf"
data: "*WM INF$\r\n"
internal: true

- platform: restart
entity_category: "diagnostic"
name: "Restart ESPHOME"
internal: true

valve:
- platform: template
name: "water"
id: "rkwm"
device_class: water
icon: "mdi:water"
optimistic: true
open_action:
- uart.write:
data: "*WM ON$\r\n"
close_action:
- uart.write:
data: "*WM OFF$\r\n"

# Сенсор, считывающий ответы из UART
text_sensor:
- platform: custom
lambda: |-
auto uart_readline_sensor = new UartReadLineSensor(id(uart_bus));
App.register_component(uart_readline_sensor);
return {uart_readline_sensor};
text_sensors:
- name: "latestSerial"
internal: true
entity_category: "diagnostic"

interval:
- interval: 120s
then:
- uart.write:
data: "*1 STS$\r\n"
- delay: 3s
- uart.write:
data: "*2 STS$\r\n"

- interval: 120s
then:
- uart.write:
data: "*WM INF$\r\n"
29 changes: 0 additions & 29 deletions project-template-esp32-c3.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions project-template-esp32-s3.factory.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions project-template-esp32-s3.yaml

This file was deleted.

Loading

0 comments on commit 609ee09

Please sign in to comment.