├── .github
└── workflows
│ ├── ci.yml
│ ├── publish-firmware.yml
│ └── publish-pages.yml
├── .gitignore
├── ESP8266_MINI.bin
├── LICENSE
├── README.md
├── athom-cb02.yaml
├── athom-garage-door.yaml
├── athom-ls-4p-3wire.yaml
├── athom-ls-4p-4wire.yaml
├── athom-mini-switch.yaml
├── athom-presence-sensor.yaml
├── athom-relay-board-x1.yaml
├── athom-relay-board-x2.yaml
├── athom-relay-board-x4.yaml
├── athom-relay-board-x8.yaml
├── athom-rgb-light.yaml
├── athom-rgbct-light.yaml
├── athom-rgbw-light.yaml
├── athom-rgbww-light.yaml
├── athom-smart-plug-v2.yaml
├── athom-smart-plug.yaml
├── athom-sw01-v2.yaml
├── athom-sw01.yaml
├── athom-sw02-v2.yaml
├── athom-sw02.yaml
├── athom-sw03.yaml
├── athom-sw04.yaml
├── athom-wall-outlet.yaml
├── athom-without-relay-plug.yaml
├── athom-ws2812b.yaml
├── images
├── Athom_15w_Bulb.png
├── Athom_1Gang_Key_Switch.png
├── Athom_1Gang_Touch_Switch.png
├── Athom_1Gang_US_Switch.png
├── Athom_2Gang_Key_Switch.png
├── Athom_2Gang_Touch_Switch.png
├── Athom_3Gang_Key_Switch.png
├── Athom_3Gang_Touch_Switch.png
├── Athom_3Pin_Controller.png
├── Athom_4Gang_Touch_Swtich.png
├── Athom_4Pin_Controller.png
├── Athom_7w_Bulb.png
├── Athom_AU_Plug_V2.png
├── Athom_BR30_Bulb.png
├── Athom_BR_Plug_V2.png
├── Athom_CB01.png
├── Athom_CB02.png
├── Athom_EU_Plug.png
├── Athom_EU_Plug_V2.png
├── Athom_GU10_Bulb.png
├── Athom_Garage_Door_Opener.png
├── Athom_IL_Plug_V2.png
├── Athom_IT_Plug_V2.png
├── Athom_Mini_Relay.png
├── Athom_Presence_Sensor.png
├── Athom_RGBW_Controller.png
├── Athom_RGB_Controller.png
├── Athom_UK_Plug.png
├── Athom_UK_Plug_V2.png
├── Athom_US_Plug.png
├── Athom_US_Plug_V2.png
└── Athom_Wall_Outlet.png
├── static
├── _config.yml
└── index.md
└── tasmota-minimal.bin.gz
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | pull_request:
5 | paths:
6 | - '*.yaml'
7 | - '.github/workflows/ci.yml'
8 |
9 | concurrency:
10 | group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
11 | cancel-in-progress: true
12 |
13 | jobs:
14 | ci:
15 | name: Building ${{ matrix.file }} / ${{ matrix.esphome-version }}
16 | runs-on: ubuntu-latest
17 | strategy:
18 | fail-fast: false
19 | max-parallel: 3
20 | matrix:
21 | #### Modify below here to match your project ####
22 | file:
23 | - athom-cb02
24 | - athom-garage-door
25 | - athom-mini-switch
26 | - athom-presence-sensor
27 | - athom-relay-board-x1
28 | - athom-relay-board-x2
29 | - athom-relay-board-x4
30 | - athom-relay-board-x8
31 | - athom-rgb-light
32 | - athom-rgbct-light
33 | - athom-rgbw-light
34 | - athom-rgbww-light
35 | - athom-smart-plug-v2
36 | - athom-smart-plug
37 | - athom-sw01-v2
38 | - athom-sw01
39 | - athom-sw02-v2
40 | - athom-sw02
41 | - athom-sw03
42 | - athom-sw04
43 | - athom-wall-outlet
44 | - athom-without-relay-plug
45 | #### Modify above here to match your project ####
46 |
47 | esphome-version:
48 | - stable
49 | - beta
50 | - dev
51 | steps:
52 | - name: Checkout source code
53 | uses: actions/checkout@v4.1.7
54 | - name: ESPHome ${{ matrix.esphome-version }}
55 | uses: esphome/build-action@v4.0.3
56 | with:
57 | yaml-file: ${{ matrix.file }}.yaml
58 | version: ${{ matrix.esphome-version }}
--------------------------------------------------------------------------------
/.github/workflows/publish-firmware.yml:
--------------------------------------------------------------------------------
1 | name: Publish Firmware
2 |
3 | on:
4 | release:
5 | types: [published]
6 |
7 | permissions:
8 | contents: write
9 |
10 | jobs:
11 | build-firmware:
12 | name: Build Firmware
13 | uses: esphome/workflows/.github/workflows/build.yml@2024.12.0
14 | with:
15 | #### Modify below here to match your project ####
16 | files: |
17 | athom-cb02.yaml
18 | athom-garage-door.yaml
19 | athom-mini-switch.yaml
20 | athom-presence-sensor.yaml
21 | athom-relay-board-x1.yaml
22 | athom-relay-board-x2.yaml
23 | athom-relay-board-x4.yaml
24 | athom-relay-board-x8.yaml
25 | athom-rgb-light.yaml
26 | athom-rgbct-light.yaml
27 | athom-rgbw-light.yaml
28 | athom-rgbww-light.yaml
29 | athom-smart-plug-v2.yaml
30 | athom-smart-plug.yaml
31 | athom-sw01-v2.yaml
32 | athom-sw01.yaml
33 | athom-sw02-v2.yaml
34 | athom-sw02.yaml
35 | athom-sw03.yaml
36 | athom-sw04.yaml
37 | athom-wall-outlet.yaml
38 | athom-without-relay-plug.yaml
39 | esphome-version: 2024.10.3
40 | combined-name: athom
41 | #### Modify above here to match your project ####
42 |
43 | release-summary: ${{ github.event.release.body }}
44 | release-url: ${{ github.event.release.html_url }}
45 | release-version: ${{ github.event.release.tag_name }}
46 |
47 | upload-to-release:
48 | name: Upload to Release
49 | uses: esphome/workflows/.github/workflows/upload-to-gh-release.yml@2024.12.0
50 | needs:
51 | - build-firmware
52 | with:
53 | version: ${{ github.event.release.tag_name }}
--------------------------------------------------------------------------------
/.github/workflows/publish-pages.yml:
--------------------------------------------------------------------------------
1 | name: Publish Pages
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | paths:
8 | - 'static/**'
9 | - '.github/workflows/publish-pages.yml'
10 | workflow_run:
11 | workflows:
12 | - Publish Firmware
13 | types:
14 | - completed
15 | pull_request:
16 | paths:
17 | - 'static/**'
18 | - '.github/workflows/publish-pages.yml'
19 |
20 |
21 | concurrency:
22 | group: ${{ github.workflow }}-${{ github.ref }}
23 | cancel-in-progress: true
24 |
25 | jobs:
26 | build:
27 | name: Build
28 | runs-on: ubuntu-latest
29 | steps:
30 | - name: Checkout source code
31 | uses: actions/checkout@v4.2.2
32 |
33 | - run: mkdir -p output/firmware
34 |
35 | - name: Build
36 | uses: actions/jekyll-build-pages@v1.0.13
37 | with:
38 | source: ./static
39 | destination: ./output
40 |
41 | - name: Fetch firmware files
42 | uses: robinraju/release-downloader@v1.11
43 | with:
44 | latest: true
45 | fileName: '*'
46 | out-file-path: output/firmware
47 |
48 | - name: Upload artifact
49 | uses: actions/upload-pages-artifact@v3.0.1
50 | with:
51 | path: output
52 | retention-days: 1
53 |
54 | publish:
55 | if: github.event_name != 'pull_request'
56 | name: Publish
57 | runs-on: ubuntu-latest
58 | needs:
59 | - build
60 | permissions:
61 | pages: write
62 | id-token: write
63 | environment:
64 | name: github-pages
65 | url: ${{ steps.deployment.outputs.page_url }}
66 | steps:
67 | - name: Setup Pages
68 | uses: actions/configure-pages@v5.0.0
69 |
70 | - name: Deploy to GitHub Pages
71 | id: deployment
72 | uses: actions/deploy-pages@v4.0.5
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Gitignore settings for ESPHome
2 | # This is an example and may include too much for your use-case.
3 | # You can modify this file to suit your needs.
4 | /.esphome/
5 | **/.pioenvs/
6 | **/.piolibdeps/
7 | **/lib/
8 | **/src/
9 | **/platformio.ini
10 | /secrets.yaml
11 |
--------------------------------------------------------------------------------
/ESP8266_MINI.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/ESP8266_MINI.bin
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Jesse Hills
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Only applicable to ESP8285,[Please click for ESP32 devices](https://github.com/athom-tech/esp32-configs)
2 |
3 | ### Athom ESPHome configurations
4 |
5 | This repository contains a bunch of ESPHome configurations for https://athom.tech devices.
6 |
7 | If you are prompted that there is not enough space, you should upgrade `ESP8266_MINI.bin` first
8 |
9 | - mini is a transit firmware, after running, it will generate a hotspot of "ESP_UPDATE_XXXXXX"
10 | - Connect to the hotspot and visit `http://192.168.4.1/update` in the browser
11 | - Upload updated ESPHome firmware
12 |
13 | ### Migrating to Tasmota
14 |
15 | - Select firmware upgrade, upload `tasmota.bin.gz` and click Update, ***Please don't choose `tasmota.bin`***
16 | - Download Tasmota firmware here http://ota.tasmota.com/tasmota/release/tasmota.bin.gz
17 |
18 | ### Migrating from Tasmota
19 |
20 | - First execute `SetOption78 1` in the console of Tasmota
21 | - Select firmware upgrade, upload `tasmota-minimal.bin.gz` and click start upgrade
22 | - Select the firmware upgrade again, upload the firmware of ESPHome and click to start upgrade
23 |
24 | ### Device List
25 | device|picture|file name|notice
26 | :---:|:---:|:---:|:---:
27 | Athom_Plug_V2|





|athom-smart-plug-v2.yaml
28 | Athom_Wall_Outlet|
|athom-wall-outlet.yaml
29 | Athom_1Gang_Switch|

|athom-sw01.yaml
30 | Athom_2Gang_Switch|
|athom-sw02.yaml
31 | Athom_3Gang_Switch|
|athom-sw03.yaml
32 | Athom_4Gang_Switch|
|athom-sw04.yaml
33 | Athom_7W_Bulb
Athom_GU10_Bulb|
|athom-rgbww-light.yaml
34 | Athom_15W_Bulb|
|athom-rgbct-light.yaml
35 | Athom_12W_Bulb|
|athom-rgbct-light.yaml|
Temporarily discontinued
36 | Athom_RGB_Controller|
|athom-rgb-light.yaml
37 | Athom_Addressable_Light_Strip_Controller|
|athom-ws2812b.yaml
38 | Athom_High_Power_RGBW_Light_Strip_Controller|
|athom-rgbw-light.yaml
39 | Athom_High_Power_Addressable_Light_Strip_Controller|
|athom-ls-4p-3wire.yaml
40 | Athom_Mini_Switch|
|athom-mini-switch.yaml
41 | Athom_CB02_Switch|
|athom-cb02.yaml
42 | Athom_Presence_Sensor|
|athom-presence-sensor.yaml
43 | Athom_Garage_Door_Opener|
|athom-garage-door.yaml
44 | Athom_Plug|
|athom-smart-plug.yaml|Discontinued
45 |
--------------------------------------------------------------------------------
/athom-cb02.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-cb02-switch"
4 | # Default friendly name
5 | friendly_name: "Athom Relay Switch"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom cb02 relay switch"
10 | # Project Name
11 | project_name: "Athom Technology.CB02 Relay Switch"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | relay_restore_mode: RESTORE_DEFAULT_OFF
16 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
17 | dns_domain: ".local"
18 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
19 | timezone: ""
20 | # Set the duration between the sntp service polling ntp.org servers for an update
21 | sntp_update_interval: 6h
22 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
23 | sntp_server_1: "0.pool.ntp.org"
24 | sntp_server_2: "1.pool.ntp.org"
25 | sntp_server_3: "2.pool.ntp.org"
26 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
27 | wifi_fast_connect: "false"
28 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
29 | log_level: "DEBUG"
30 | # Enable or disable the use of IPv6 networking on the device
31 | ipv6_enable: "false"
32 |
33 | esphome:
34 | name: "${name}"
35 | friendly_name: "${friendly_name}"
36 | comment: "${device_description}"
37 | area: "${room}"
38 | name_add_mac_suffix: true
39 | min_version: 2024.6.0
40 | project:
41 | name: "${project_name}"
42 | version: "${project_version}"
43 | on_boot:
44 | - priority: 600
45 | then:
46 | - select.set_index:
47 | id: power_mode
48 | index: !lambda |-
49 | return id(restore_mode)-1;
50 | - lambda: |-
51 | switch(id(restore_mode))
52 | {
53 | case 1:{
54 | id(relay).turn_off();
55 | break;
56 | }
57 | case 2:{
58 | id(relay).turn_on();
59 | break;
60 | }
61 | default:{
62 | break;
63 | }
64 | }
65 |
66 | esp8266:
67 | board: esp8285
68 | restore_from_flash: true
69 |
70 | preferences:
71 | flash_write_interval: 1min
72 |
73 | api:
74 |
75 | ota:
76 | - platform: esphome
77 |
78 | logger:
79 | level: ${log_level}
80 | baud_rate: 115200
81 |
82 | mdns:
83 | disabled: false
84 |
85 | web_server:
86 | port: 80
87 |
88 | network:
89 | enable_ipv6: ${ipv6_enable}
90 |
91 | wifi:
92 | # This spawns an AP with the device name and mac address with no password.
93 | ap: {}
94 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
95 | fast_connect: "${wifi_fast_connect}"
96 | # Define dns domain / suffix to add to hostname
97 | domain: "${dns_domain}"
98 |
99 | captive_portal:
100 |
101 | dashboard_import:
102 | package_import_url: github://athom-tech/athom-configs/athom-cb02.yaml
103 |
104 | globals:
105 | - id: restore_mode
106 | type: int
107 | restore_value: yes
108 | initial_value: "3"
109 |
110 | select:
111 | - platform: template
112 | name: "Power On State"
113 | id: "power_mode"
114 | optimistic: true
115 | options:
116 | - Always Off
117 | - Always On
118 | - Restore Power Off State
119 | on_value:
120 | then:
121 | - lambda: |-
122 | id(restore_mode)=i+1;
123 |
124 | binary_sensor:
125 | - platform: status
126 | name: "Status"
127 | entity_category: diagnostic
128 |
129 | - platform: gpio
130 | pin:
131 | number: GPIO3
132 | mode: INPUT_PULLUP
133 | inverted: true
134 | name: "Power Button"
135 | disabled_by_default: true
136 | on_multi_click:
137 | - timing:
138 | - ON for at most 1s
139 | - OFF for at least 0.2s
140 | then:
141 | - switch.toggle: relay
142 | - timing:
143 | - ON for at least 4s
144 | then:
145 | - button.press: Reset
146 |
147 | sensor:
148 | - platform: uptime
149 | name: "Uptime Sensor"
150 | id: uptime_sensor
151 | entity_category: diagnostic
152 | internal: true
153 |
154 | - platform: wifi_signal
155 | name: "WiFi Signal dB"
156 | id: wifi_signal_db
157 | update_interval: 60s
158 | entity_category: "diagnostic"
159 |
160 | - platform: copy
161 | source_id: wifi_signal_db
162 | name: "WiFi Signal Percent"
163 | filters:
164 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
165 | unit_of_measurement: "Signal %"
166 | entity_category: "diagnostic"
167 | device_class: ""
168 |
169 | button:
170 | - platform: restart
171 | name: "Restart"
172 | entity_category: config
173 |
174 | - platform: factory_reset
175 | name: "Factory Reset"
176 | id: Reset
177 | entity_category: config
178 |
179 | - platform: safe_mode
180 | name: "Safe Mode"
181 | internal: false
182 | entity_category: config
183 |
184 | switch:
185 | - platform: gpio
186 | name: "Relay"
187 | pin: GPIO13
188 | id: relay
189 | restore_mode: ${relay_restore_mode}
190 | on_turn_on:
191 | - light.turn_on: blue_led
192 | on_turn_off:
193 | - light.turn_off: blue_led
194 |
195 | light:
196 | - platform: status_led
197 | name: "Status LED"
198 | id: blue_led
199 | disabled_by_default: true
200 | pin:
201 | inverted: true
202 | number: GPIO4
203 |
204 | text_sensor:
205 | - platform: wifi_info
206 | ip_address:
207 | name: "IP Address"
208 | entity_category: diagnostic
209 | ssid:
210 | name: "Connected SSID"
211 | entity_category: diagnostic
212 | mac_address:
213 | name: "Mac Address"
214 | entity_category: diagnostic
215 |
216 | # Creates a sensor showing when the device was last restarted
217 | - platform: template
218 | name: 'Last Restart'
219 | id: device_last_restart
220 | icon: mdi:clock
221 | entity_category: diagnostic
222 | # device_class: timestamp
223 |
224 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
225 | - platform: template
226 | name: "Uptime"
227 | entity_category: diagnostic
228 | lambda: |-
229 | int seconds = (id(uptime_sensor).state);
230 | int days = seconds / (24 * 3600);
231 | seconds = seconds % (24 * 3600);
232 | int hours = seconds / 3600;
233 | seconds = seconds % 3600;
234 | int minutes = seconds / 60;
235 | seconds = seconds % 60;
236 | if ( days > 3650 ) {
237 | return { "Starting up" };
238 | } else if ( days ) {
239 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
240 | } else if ( hours ) {
241 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
242 | } else if ( minutes ) {
243 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
244 | } else {
245 | return { (String(seconds) +"s").c_str() };
246 | }
247 | icon: mdi:clock-start
248 |
249 | time:
250 | - platform: sntp
251 | id: sntp_time
252 | # Define the timezone of the device
253 | timezone: "${timezone}"
254 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
255 | update_interval: ${sntp_update_interval}
256 | # Set specific sntp servers to use
257 | servers:
258 | - "${sntp_server_1}"
259 | - "${sntp_server_2}"
260 | - "${sntp_server_3}"
261 | # Publish the time the device was last restarted
262 | on_time_sync:
263 | then:
264 | # Update last restart time, but only once.
265 | - if:
266 | condition:
267 | lambda: 'return id(device_last_restart).state == "";'
268 | then:
269 | - text_sensor.template.publish:
270 | id: device_last_restart
271 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
272 |
--------------------------------------------------------------------------------
/athom-garage-door.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-garage-door"
4 | # Default friendly name
5 | friendly_name: "Athom Garage Door"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom garage door opener"
10 | # Project Name
11 | project_name: "Athom Technology.Athom Garage Door Opener"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.2.3"
14 | # Status inverted
15 | status_inverted: "true"
16 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
17 | dns_domain: ".local"
18 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
19 | timezone: ""
20 | # Set the duration between the sntp service polling ntp.org servers for an update
21 | sntp_update_interval: 6h
22 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
23 | sntp_server_1: "0.pool.ntp.org"
24 | sntp_server_2: "1.pool.ntp.org"
25 | sntp_server_3: "2.pool.ntp.org"
26 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
27 | wifi_fast_connect: "false"
28 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
29 | log_level: "DEBUG"
30 | # Enable or disable the use of IPv6 networking on the device
31 | ipv6_enable: "false"
32 |
33 | esphome:
34 | name: "${name}"
35 | friendly_name: "${friendly_name}"
36 | comment: "${device_description}"
37 | area: "${room}"
38 | name_add_mac_suffix: true
39 | min_version: 2024.6.0
40 | project:
41 | name: "${project_name}"
42 | version: "${project_version}"
43 |
44 | esp8266:
45 | board: esp8285
46 |
47 | api:
48 |
49 | ota:
50 | - platform: esphome
51 |
52 | logger:
53 | level: ${log_level}
54 | baud_rate: 115200
55 |
56 | mdns:
57 | disabled: false
58 |
59 | web_server:
60 | port: 80
61 |
62 | network:
63 | enable_ipv6: ${ipv6_enable}
64 |
65 | wifi:
66 | # This spawns an AP with the device name and mac address with no password.
67 | ap: {}
68 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
69 | fast_connect: "${wifi_fast_connect}"
70 | # Define dns domain / suffix to add to hostname
71 | domain: "${dns_domain}"
72 |
73 | captive_portal:
74 |
75 | dashboard_import:
76 | package_import_url: github://athom-tech/athom-configs/athom-garage-door.yaml
77 |
78 | sensor:
79 | - platform: uptime
80 | name: "Uptime Sensor"
81 | id: uptime_sensor
82 | entity_category: diagnostic
83 | internal: true
84 |
85 | - platform: wifi_signal
86 | name: "WiFi Signal dB"
87 | id: wifi_signal_db
88 | update_interval: 60s
89 | entity_category: "diagnostic"
90 |
91 | - platform: copy
92 | source_id: wifi_signal_db
93 | name: "WiFi Signal Percent"
94 | filters:
95 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
96 | unit_of_measurement: "Signal %"
97 | entity_category: "diagnostic"
98 | device_class: ""
99 |
100 | binary_sensor:
101 | - platform: status
102 | name: "Status"
103 |
104 | - platform: gpio
105 | name: "Contact"
106 | disabled_by_default: true
107 | device_class: garage_door
108 | id: contact
109 | pin:
110 | number: GPIO4
111 | inverted: "${status_inverted}"
112 | filters:
113 | - delayed_on: 20ms
114 |
115 | - platform: gpio
116 | pin:
117 | number: GPIO14
118 | mode: INPUT_PULLUP
119 | inverted: true
120 | name: "Button"
121 | disabled_by_default: true
122 | on_multi_click:
123 | - timing:
124 | - ON for at most 1s
125 | - OFF for at least 0.2s
126 | then:
127 | - switch.turn_on: relay
128 | - timing:
129 | - ON for at least 4s
130 | then:
131 | - button.press: Reset
132 |
133 | button:
134 | - platform: restart
135 | name: "Restart"
136 | entity_category: config
137 |
138 | - platform: factory_reset
139 | name: "Factory Reset"
140 | id: Reset
141 | entity_category: config
142 |
143 | - platform: safe_mode
144 | name: "Safe Mode"
145 | internal: false
146 | entity_category: config
147 |
148 | switch:
149 | - platform: gpio
150 | pin: GPIO5
151 | name: "Relay"
152 | id: relay
153 | disabled_by_default: true
154 | on_turn_on:
155 | - light.turn_on: wifi_led
156 | - delay: 1s
157 | - switch.turn_off: relay
158 | - light.turn_off: wifi_led
159 |
160 | light:
161 | - platform: status_led
162 | name: "Status LED"
163 | id: wifi_led
164 | disabled_by_default: true
165 | pin:
166 | inverted: true
167 | number: GPIO12
168 |
169 | cover:
170 | - platform: template
171 | device_class: garage
172 | name: "Garage Door"
173 | lambda: "return id(contact).state ? COVER_OPEN : COVER_CLOSED;"
174 | open_action:
175 | then:
176 | - if:
177 | condition:
178 | lambda: 'return !id(contact).state;'
179 | then:
180 | - switch.turn_on: relay
181 | stop_action:
182 | - switch.turn_on: relay
183 | close_action:
184 | then:
185 | - if:
186 | condition:
187 | lambda: 'return id(contact).state;'
188 | then:
189 | - switch.turn_on: relay
190 |
191 | text_sensor:
192 | - platform: wifi_info
193 | ip_address:
194 | name: "IP Address"
195 | entity_category: diagnostic
196 | ssid:
197 | name: "Connected SSID"
198 | entity_category: diagnostic
199 | mac_address:
200 | name: "Mac Address"
201 | entity_category: diagnostic
202 |
203 | # Creates a sensor showing when the device was last restarted
204 | - platform: template
205 | name: 'Last Restart'
206 | id: device_last_restart
207 | icon: mdi:clock
208 | entity_category: diagnostic
209 | # device_class: timestamp
210 |
211 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
212 | - platform: template
213 | name: "Uptime"
214 | entity_category: diagnostic
215 | lambda: |-
216 | int seconds = (id(uptime_sensor).state);
217 | int days = seconds / (24 * 3600);
218 | seconds = seconds % (24 * 3600);
219 | int hours = seconds / 3600;
220 | seconds = seconds % 3600;
221 | int minutes = seconds / 60;
222 | seconds = seconds % 60;
223 | if ( days > 3650 ) {
224 | return { "Starting up" };
225 | } else if ( days ) {
226 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
227 | } else if ( hours ) {
228 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
229 | } else if ( minutes ) {
230 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
231 | } else {
232 | return { (String(seconds) +"s").c_str() };
233 | }
234 | icon: mdi:clock-start
235 |
236 | time:
237 | - platform: sntp
238 | id: sntp_time
239 | # Define the timezone of the device
240 | timezone: "${timezone}"
241 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
242 | update_interval: ${sntp_update_interval}
243 | # Set specific sntp servers to use
244 | servers:
245 | - "${sntp_server_1}"
246 | - "${sntp_server_2}"
247 | - "${sntp_server_3}"
248 | # Publish the time the device was last restarted
249 | on_time_sync:
250 | then:
251 | # Update last restart time, but only once.
252 | - if:
253 | condition:
254 | lambda: 'return id(device_last_restart).state == "";'
255 | then:
256 | - text_sensor.template.publish:
257 | id: device_last_restart
258 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
259 |
--------------------------------------------------------------------------------
/athom-ls-4p-3wire.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | device_name: "athom-ls-4p-3wire"
3 | project_name: "Athom Technology.LS 4P 3Wire"
4 | project_version: "1.1.1"
5 | button_toggle: "true"
6 | led_restore_mode: RESTORE_DEFAULT_OFF
7 | number_of_leds: '150'
8 | led_rgb_order: GRB
9 | led_chipset: WS2811
10 |
11 | esphome:
12 | name: "${device_name}"
13 | friendly_name: ""
14 | name_add_mac_suffix: true
15 | min_version: 2024.6.0
16 | project:
17 | name: "${project_name}"
18 | version: "${project_version}"
19 |
20 | esp8266:
21 | board: esp8285
22 | restore_from_flash: true
23 | framework:
24 | version: 2.7.4
25 |
26 | api:
27 |
28 | ota:
29 | - platform: esphome
30 |
31 | logger:
32 | baud_rate: 0
33 |
34 | mdns:
35 | disabled: false
36 |
37 | web_server:
38 | port: 80
39 |
40 | wifi:
41 | ap: {} # This spawns an AP with the device name and mac address with no password.
42 |
43 | captive_portal:
44 |
45 | dashboard_import:
46 | package_import_url: github://athom-tech/athom-configs/athom-ls-4p-3wire.yaml
47 |
48 | binary_sensor:
49 | - platform: status
50 | name: "Status"
51 |
52 | - platform: gpio
53 | pin:
54 | number: 0
55 | mode: INPUT_PULLUP
56 | inverted: true
57 | name: "Power Button"
58 | disabled_by_default: true
59 | on_multi_click:
60 | - timing:
61 | - ON for at most 1s
62 | - OFF for at least 0.2s
63 | then:
64 | - light.toggle: leds
65 | - timing:
66 | - ON for at least 4s
67 | then:
68 | - button.press: Reset
69 |
70 | sensor:
71 | - platform: uptime
72 | name: "Uptime Sensor"
73 |
74 | - platform: wifi_signal
75 | name: "WiFi Signal"
76 | update_interval: 60s
77 |
78 | button:
79 | - platform: factory_reset
80 | name: "Reset"
81 | id: Reset
82 |
83 | - platform: safe_mode
84 | name: "Safe Mode"
85 | internal: false
86 |
87 | power_supply:
88 | - id: relay
89 | pin: GPIO12
90 |
91 | light:
92 | - platform: fastled_clockless
93 | pin: GPIO1
94 | id: leds
95 | name: "Light strip controller"
96 | power_supply: relay
97 | chipset: ${led_chipset}
98 | num_leds: ${number_of_leds}
99 | rgb_order: ${led_rgb_order}
100 | restore_mode: ${led_restore_mode}
101 | effects:
102 | - addressable_rainbow:
103 | - addressable_scan:
104 |
105 | text_sensor:
106 | - platform: wifi_info
107 | ip_address:
108 | name: "IP Address"
109 | ssid:
110 | name: "Connected SSID"
111 | mac_address:
112 | name: "Mac Address"
113 |
114 | time:
115 | - platform: sntp
116 | id: sntp_time
117 |
--------------------------------------------------------------------------------
/athom-ls-4p-4wire.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | device_name: "athom-ls-4p-4wire"
3 | project_name: "Athom Technology.LS 4P 4Wire"
4 | project_version: "1.1.1"
5 | button_toggle: "true"
6 | light_restore_mode: RESTORE_DEFAULT_OFF
7 | number_of_leds: '150'
8 | led_chipset: WS2801
9 | led_rgb_order: GRB
10 |
11 | esphome:
12 | name: "${device_name}"
13 | friendly_name: ""
14 | name_add_mac_suffix: true
15 | min_version: 2024.6.0
16 | project:
17 | name: "${project_name}"
18 | version: "${project_version}"
19 |
20 | esp8266:
21 | board: esp8285
22 | restore_from_flash: true
23 | framework:
24 | version: 2.7.4
25 |
26 | api:
27 |
28 | ota:
29 | - platform: esphome
30 |
31 | logger:
32 | baud_rate: 0
33 |
34 | mdns:
35 | disabled: false
36 |
37 | web_server:
38 | port: 80
39 |
40 | wifi:
41 | ap: {} # This spawns an AP with the device name and mac address with no password.
42 |
43 | captive_portal:
44 |
45 | dashboard_import:
46 | package_import_url: github://athom-tech/athom-configs/athom-ls-4p-4wire.yaml
47 |
48 | binary_sensor:
49 | - platform: status
50 | name: "Status"
51 |
52 | - platform: gpio
53 | pin:
54 | number: 0
55 | mode: INPUT_PULLUP
56 | inverted: true
57 | name: "Power Button"
58 | disabled_by_default: true
59 | on_multi_click:
60 | - timing:
61 | - ON for at most 1s
62 | - OFF for at least 0.2s
63 | then:
64 | - light.toggle: leds
65 | - timing:
66 | - ON for at least 4s
67 | then:
68 | - button.press: Reset
69 |
70 | sensor:
71 | - platform: uptime
72 | name: "Uptime Sensor"
73 |
74 | - platform: wifi_signal
75 | name: "WiFi Signal"
76 | update_interval: 60s
77 |
78 | button:
79 | - platform: factory_reset
80 | name: "Reset"
81 | id: Reset
82 |
83 | - platform: safe_mode
84 | name: "Safe Mode"
85 | internal: false
86 |
87 | power_supply:
88 | - id: relay
89 | pin: GPIO12
90 |
91 | light:
92 | - platform: fastled_spi
93 | data_pin: GPIO1
94 | clock_pin: GPIO3
95 | id: leds
96 | name: "Light strip controller"
97 | power_supply: relay
98 | chipset: ${led_chipset}
99 | num_leds: ${number_of_leds}
100 | rgb_order: ${led_rgb_order}
101 | restore_mode: ${light_restore_mode}
102 | effects:
103 | - addressable_rainbow:
104 | - addressable_scan:
105 |
106 | text_sensor:
107 | - platform: wifi_info
108 | ip_address:
109 | name: "IP Address"
110 | ssid:
111 | name: "Connected SSID"
112 | mac_address:
113 | name: "Mac Address"
114 |
115 | time:
116 | - platform: sntp
117 | id: sntp_time
118 |
--------------------------------------------------------------------------------
/athom-mini-switch.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-mini-switch"
4 | # Default friendly name
5 | friendly_name: "Athom Relay Switch"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom mini relay switch module"
10 | # Project Name
11 | project_name: "Athom Technology.Mini Relay Switch"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | light_restore_mode: RESTORE_DEFAULT_OFF
16 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
17 | dns_domain: ".local"
18 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
19 | timezone: ""
20 | # Set the duration between the sntp service polling ntp.org servers for an update
21 | sntp_update_interval: 6h
22 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
23 | sntp_server_1: "0.pool.ntp.org"
24 | sntp_server_2: "1.pool.ntp.org"
25 | sntp_server_3: "2.pool.ntp.org"
26 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
27 | wifi_fast_connect: "false"
28 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
29 | log_level: "DEBUG"
30 | # Enable or disable the use of IPv6 networking on the device
31 | ipv6_enable: "false"
32 |
33 | esphome:
34 | name: "${name}"
35 | friendly_name: "${friendly_name}"
36 | comment: "${device_description}"
37 | area: "${room}"
38 | name_add_mac_suffix: true
39 | min_version: 2024.6.0
40 | project:
41 | name: "${project_name}"
42 | version: "${project_version}"
43 | on_boot:
44 | - priority: 600
45 | then:
46 | - select.set_index:
47 | id: power_mode
48 | index: !lambda |-
49 | return id(restore_mode)-1;
50 | - lambda: |-
51 | switch(id(restore_mode))
52 | {
53 | case 1:{
54 | id(mini_relay).turn_off();
55 | break;
56 | }
57 | case 2:{
58 | id(mini_relay).turn_on();
59 | break;
60 | }
61 | default:{
62 | break;
63 | }
64 | }
65 |
66 | esp8266:
67 | board: esp8285
68 | restore_from_flash: true
69 |
70 | preferences:
71 | flash_write_interval: 1min
72 |
73 | api:
74 |
75 | ota:
76 | - platform: esphome
77 |
78 | logger:
79 | level: ${log_level}
80 | baud_rate: 115200
81 |
82 | mdns:
83 | disabled: false
84 |
85 | web_server:
86 | port: 80
87 |
88 | network:
89 | enable_ipv6: ${ipv6_enable}
90 |
91 | wifi:
92 | # This spawns an AP with the device name and mac address with no password.
93 | ap: {}
94 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
95 | fast_connect: "${wifi_fast_connect}"
96 | # Define dns domain / suffix to add to hostname
97 | domain: "${dns_domain}"
98 |
99 | captive_portal:
100 |
101 | dashboard_import:
102 | package_import_url: github://athom-tech/athom-configs/athom-mini-switch.yaml
103 |
104 | globals:
105 | - id: restore_mode
106 | type: int
107 | restore_value: yes
108 | initial_value: "3"
109 |
110 | select:
111 | - platform: template
112 | name: "Power On State"
113 | id: "power_mode"
114 | optimistic: true
115 | options:
116 | - Always Off
117 | - Always On
118 | - Restore Power Off State
119 | on_value:
120 | then:
121 | - lambda: |-
122 | id(restore_mode)=i+1;
123 |
124 | button:
125 | - platform: restart
126 | name: "Restart"
127 | entity_category: config
128 |
129 | - platform: factory_reset
130 | name: "Factory Reset"
131 | id: Reset
132 | entity_category: config
133 |
134 | - platform: safe_mode
135 | name: "Safe Mode"
136 | internal: false
137 | entity_category: config
138 |
139 | output:
140 | - platform: gpio
141 | id: relay_output
142 | pin: GPIO13
143 |
144 | light:
145 | - platform: status_led
146 | id: led
147 | name: "Blue LED"
148 | disabled_by_default: true
149 | pin:
150 | number: GPIO4
151 | inverted: true
152 |
153 | - platform: binary
154 | id: mini_relay
155 | output: relay_output
156 | name: "Mini Switch"
157 | restore_mode: ${light_restore_mode}
158 | on_turn_on:
159 | - light.turn_on: led
160 | on_turn_off:
161 | - light.turn_off: led
162 |
163 | sensor:
164 | - platform: uptime
165 | name: "Uptime Sensor"
166 | id: uptime_sensor
167 | entity_category: diagnostic
168 | internal: true
169 |
170 | - platform: wifi_signal
171 | name: "WiFi Signal dB"
172 | id: wifi_signal_db
173 | update_interval: 60s
174 | entity_category: "diagnostic"
175 |
176 | - platform: copy
177 | source_id: wifi_signal_db
178 | name: "WiFi Signal Percent"
179 | filters:
180 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
181 | unit_of_measurement: "Signal %"
182 | entity_category: "diagnostic"
183 | device_class: ""
184 |
185 | binary_sensor:
186 | # Wired switch
187 | - platform: gpio
188 | id: the_switch
189 | name: "Power Switch"
190 | disabled_by_default: true
191 | pin:
192 | number: GPIO14
193 | mode: INPUT_PULLUP
194 | on_state:
195 | - light.toggle: mini_relay
196 | on_multi_click:
197 | - timing:
198 | - ON for at most 0.5s
199 | - OFF for at most 0.5s
200 | - ON for at most 0.5s
201 | - OFF for at most 0.5s
202 | - ON for at most 0.5s
203 | - OFF for at most 0.5s
204 | - ON for at most 0.5s
205 | - OFF for at most 0.5s
206 | then:
207 | - button.press: Reset
208 |
209 | # Button on mini switch
210 | - platform: gpio
211 | pin:
212 | number: GPIO3
213 | mode: INPUT_PULLUP
214 | inverted: true
215 | name: "Power Button"
216 | disabled_by_default: true
217 | on_multi_click:
218 | - timing:
219 | - ON for at most 1s
220 | - OFF for at least 0.2s
221 | then:
222 | - light.toggle: mini_relay
223 | - timing:
224 | - ON for at least 4s
225 | then:
226 | - button.press: Reset
227 |
228 | - platform: status
229 | name: "Status"
230 | entity_category: diagnostic
231 |
232 | text_sensor:
233 | - platform: wifi_info
234 | ip_address:
235 | name: "IP Address"
236 | entity_category: diagnostic
237 | ssid:
238 | name: "Connected SSID"
239 | entity_category: diagnostic
240 | mac_address:
241 | name: "Mac Address"
242 | entity_category: diagnostic
243 |
244 | # Creates a sensor showing when the device was last restarted
245 | - platform: template
246 | name: 'Last Restart'
247 | id: device_last_restart
248 | icon: mdi:clock
249 | entity_category: diagnostic
250 | # device_class: timestamp
251 |
252 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
253 | - platform: template
254 | name: "Uptime"
255 | entity_category: diagnostic
256 | lambda: |-
257 | int seconds = (id(uptime_sensor).state);
258 | int days = seconds / (24 * 3600);
259 | seconds = seconds % (24 * 3600);
260 | int hours = seconds / 3600;
261 | seconds = seconds % 3600;
262 | int minutes = seconds / 60;
263 | seconds = seconds % 60;
264 | if ( days > 3650 ) {
265 | return { "Starting up" };
266 | } else if ( days ) {
267 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
268 | } else if ( hours ) {
269 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
270 | } else if ( minutes ) {
271 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
272 | } else {
273 | return { (String(seconds) +"s").c_str() };
274 | }
275 | icon: mdi:clock-start
276 |
277 | time:
278 | - platform: sntp
279 | id: sntp_time
280 | # Define the timezone of the device
281 | timezone: "${timezone}"
282 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
283 | update_interval: ${sntp_update_interval}
284 | # Set specific sntp servers to use
285 | servers:
286 | - "${sntp_server_1}"
287 | - "${sntp_server_2}"
288 | - "${sntp_server_3}"
289 | # Publish the time the device was last restarted
290 | on_time_sync:
291 | then:
292 | # Update last restart time, but only once.
293 | - if:
294 | condition:
295 | lambda: 'return id(device_last_restart).state == "";'
296 | then:
297 | - text_sensor.template.publish:
298 | id: device_last_restart
299 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
300 |
--------------------------------------------------------------------------------
/athom-relay-board-x1.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-1ch-relay"
4 | # Default friendly name
5 | friendly_name: "Athom 1CH Relay"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom esp8266 1ch relay board"
10 | # Project Name
11 | project_name: "Athom Technology.Athom 1CH Relay Board"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.0.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | relay_restore_mode: RESTORE_DEFAULT_OFF
16 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
17 | dns_domain: ".local"
18 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
19 | timezone: ""
20 | # Set the duration between the sntp service polling ntp.org servers for an update
21 | sntp_update_interval: 6h
22 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
23 | sntp_server_1: "0.pool.ntp.org"
24 | sntp_server_2: "1.pool.ntp.org"
25 | sntp_server_3: "2.pool.ntp.org"
26 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
27 | wifi_fast_connect: "false"
28 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
29 | log_level: "DEBUG"
30 | # Enable or disable the use of IPv6 networking on the device
31 | ipv6_enable: "false"
32 |
33 | esphome:
34 | name: "${name}"
35 | friendly_name: "${friendly_name}"
36 | comment: "${device_description}"
37 | area: "${room}"
38 | name_add_mac_suffix: true
39 | min_version: 2024.6.0
40 | project:
41 | name: "${project_name}"
42 | version: "${project_version}"
43 |
44 | esp8266:
45 | board: esp8285
46 | restore_from_flash: true
47 |
48 | preferences:
49 | flash_write_interval: 1min
50 |
51 | api:
52 |
53 | ota:
54 | - platform: esphome
55 |
56 | logger:
57 | level: ${log_level}
58 | baud_rate: 115200
59 |
60 | web_server:
61 | port: 80
62 |
63 | network:
64 | enable_ipv6: ${ipv6_enable}
65 |
66 | wifi:
67 | # This spawns an AP with the device name and mac address with no password.
68 | ap: {}
69 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
70 | fast_connect: "${wifi_fast_connect}"
71 | # Define dns domain / suffix to add to hostname
72 | domain: "${dns_domain}"
73 |
74 | captive_portal:
75 |
76 | dashboard_import:
77 | package_import_url: github://athom-tech/athom-configs/athom-relay-board-x1.yaml
78 |
79 | binary_sensor:
80 | - platform: status
81 | name: "Status"
82 | entity_category: diagnostic
83 |
84 | sensor:
85 | - platform: uptime
86 | name: "Uptime Sensor"
87 | id: uptime_sensor
88 | entity_category: diagnostic
89 | internal: true
90 |
91 | - platform: wifi_signal
92 | name: "WiFi Signal dB"
93 | id: wifi_signal_db
94 | update_interval: 60s
95 | entity_category: "diagnostic"
96 |
97 | - platform: copy
98 | source_id: wifi_signal_db
99 | name: "WiFi Signal Percent"
100 | filters:
101 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
102 | unit_of_measurement: "Signal %"
103 | entity_category: "diagnostic"
104 | device_class: ""
105 |
106 | button:
107 | - platform: restart
108 | name: "Restart"
109 | entity_category: config
110 |
111 | - platform: factory_reset
112 | name: "Factory Reset"
113 | id: Reset
114 | entity_category: config
115 |
116 | - platform: safe_mode
117 | name: "Safe Mode"
118 | internal: false
119 | entity_category: config
120 |
121 | switch:
122 | # Relay
123 | - platform: gpio
124 | name: "Relay"
125 | pin: GPIO5
126 | id: relay1
127 | restore_mode: ${relay_restore_mode}
128 |
129 | light:
130 | - platform: status_led
131 | name: "Status LED"
132 | disabled_by_default: true
133 | pin:
134 | inverted: true
135 | number: GPIO16
136 |
137 | text_sensor:
138 | - platform: wifi_info
139 | ip_address:
140 | name: "IP Address"
141 | entity_category: diagnostic
142 | ssid:
143 | name: "Connected SSID"
144 | entity_category: diagnostic
145 | mac_address:
146 | name: "Mac Address"
147 | entity_category: diagnostic
148 |
149 | # Creates a sensor showing when the device was last restarted
150 | - platform: template
151 | name: 'Last Restart'
152 | id: device_last_restart
153 | icon: mdi:clock
154 | entity_category: diagnostic
155 | # device_class: timestamp
156 |
157 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
158 | - platform: template
159 | name: "Uptime"
160 | entity_category: diagnostic
161 | lambda: |-
162 | int seconds = (id(uptime_sensor).state);
163 | int days = seconds / (24 * 3600);
164 | seconds = seconds % (24 * 3600);
165 | int hours = seconds / 3600;
166 | seconds = seconds % 3600;
167 | int minutes = seconds / 60;
168 | seconds = seconds % 60;
169 | if ( days > 3650 ) {
170 | return { "Starting up" };
171 | } else if ( days ) {
172 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
173 | } else if ( hours ) {
174 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
175 | } else if ( minutes ) {
176 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
177 | } else {
178 | return { (String(seconds) +"s").c_str() };
179 | }
180 | icon: mdi:clock-start
181 |
182 | time:
183 | - platform: sntp
184 | id: sntp_time
185 | # Define the timezone of the device
186 | timezone: "${timezone}"
187 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
188 | update_interval: ${sntp_update_interval}
189 | # Set specific sntp servers to use
190 | servers:
191 | - "${sntp_server_1}"
192 | - "${sntp_server_2}"
193 | - "${sntp_server_3}"
194 | # Publish the time the device was last restarted
195 | on_time_sync:
196 | then:
197 | # Update last restart time, but only once.
198 | - if:
199 | condition:
200 | lambda: 'return id(device_last_restart).state == "";'
201 | then:
202 | - text_sensor.template.publish:
203 | id: device_last_restart
204 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
205 |
--------------------------------------------------------------------------------
/athom-relay-board-x2.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-2ch-relay"
4 | # Default friendly name
5 | friendly_name: "Athom 2CH Relay"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom esp8266 2ch relay board"
10 | # Project Name
11 | project_name: "Athom Technology.Athom 2CH Relay Board"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.0.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | relay1_restore_mode: RESTORE_DEFAULT_OFF
16 | relay2_restore_mode: RESTORE_DEFAULT_OFF
17 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
18 | dns_domain: ".local"
19 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
20 | timezone: ""
21 | # Set the duration between the sntp service polling ntp.org servers for an update
22 | sntp_update_interval: 6h
23 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
24 | sntp_server_1: "0.pool.ntp.org"
25 | sntp_server_2: "1.pool.ntp.org"
26 | sntp_server_3: "2.pool.ntp.org"
27 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
28 | wifi_fast_connect: "false"
29 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
30 | log_level: "DEBUG"
31 | # Enable or disable the use of IPv6 networking on the device
32 | ipv6_enable: "false"
33 |
34 | esphome:
35 | name: "${name}"
36 | friendly_name: "${friendly_name}"
37 | comment: "${device_description}"
38 | area: "${room}"
39 | name_add_mac_suffix: true
40 | min_version: 2024.6.0
41 | project:
42 | name: "${project_name}"
43 | version: "${project_version}"
44 |
45 | esp8266:
46 | board: esp8285
47 | restore_from_flash: true
48 |
49 | preferences:
50 | flash_write_interval: 1min
51 |
52 | api:
53 |
54 | ota:
55 | - platform: esphome
56 |
57 | logger:
58 | level: ${log_level}
59 | baud_rate: 115200
60 |
61 | web_server:
62 | port: 80
63 |
64 | network:
65 | enable_ipv6: ${ipv6_enable}
66 |
67 | wifi:
68 | # This spawns an AP with the device name and mac address with no password.
69 | ap: {}
70 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
71 | fast_connect: "${wifi_fast_connect}"
72 | # Define dns domain / suffix to add to hostname
73 | domain: "${dns_domain}"
74 |
75 | captive_portal:
76 |
77 | dashboard_import:
78 | package_import_url: github://athom-tech/athom-configs/athom-relay-board-x2.yaml
79 |
80 | binary_sensor:
81 | - platform: status
82 | name: "Status"
83 | entity_category: diagnostic
84 |
85 | sensor:
86 | - platform: uptime
87 | name: "Uptime Sensor"
88 | id: uptime_sensor
89 | entity_category: diagnostic
90 | internal: true
91 |
92 | - platform: wifi_signal
93 | name: "WiFi Signal dB"
94 | id: wifi_signal_db
95 | update_interval: 60s
96 | entity_category: "diagnostic"
97 |
98 | - platform: copy
99 | source_id: wifi_signal_db
100 | name: "WiFi Signal Percent"
101 | filters:
102 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
103 | unit_of_measurement: "Signal %"
104 | entity_category: "diagnostic"
105 | device_class: ""
106 |
107 | button:
108 | - platform: restart
109 | name: "Restart"
110 | entity_category: config
111 |
112 | - platform: factory_reset
113 | name: "Factory Reset"
114 | id: Reset
115 | entity_category: config
116 |
117 | - platform: safe_mode
118 | name: "Safe Mode"
119 | internal: false
120 | entity_category: config
121 |
122 | switch:
123 | # Relay
124 | - platform: gpio
125 | name: "Relay1"
126 | pin: GPIO5
127 | id: relay1
128 | restore_mode: ${relay1_restore_mode}
129 |
130 | - platform: gpio
131 | name: "Relay2"
132 | pin: GPIO4
133 | id: relay2
134 | restore_mode: ${relay2_restore_mode}
135 |
136 | light:
137 | - platform: status_led
138 | name: "Status LED"
139 | disabled_by_default: true
140 | pin:
141 | inverted: true
142 | number: GPIO16
143 |
144 | text_sensor:
145 | - platform: wifi_info
146 | ip_address:
147 | name: "IP Address"
148 | entity_category: diagnostic
149 | ssid:
150 | name: "Connected SSID"
151 | entity_category: diagnostic
152 | mac_address:
153 | name: "Mac Address"
154 | entity_category: diagnostic
155 |
156 | # Creates a sensor showing when the device was last restarted
157 | - platform: template
158 | name: 'Last Restart'
159 | id: device_last_restart
160 | icon: mdi:clock
161 | entity_category: diagnostic
162 | # device_class: timestamp
163 |
164 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
165 | - platform: template
166 | name: "Uptime"
167 | entity_category: diagnostic
168 | lambda: |-
169 | int seconds = (id(uptime_sensor).state);
170 | int days = seconds / (24 * 3600);
171 | seconds = seconds % (24 * 3600);
172 | int hours = seconds / 3600;
173 | seconds = seconds % 3600;
174 | int minutes = seconds / 60;
175 | seconds = seconds % 60;
176 | if ( days > 3650 ) {
177 | return { "Starting up" };
178 | } else if ( days ) {
179 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
180 | } else if ( hours ) {
181 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
182 | } else if ( minutes ) {
183 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
184 | } else {
185 | return { (String(seconds) +"s").c_str() };
186 | }
187 | icon: mdi:clock-start
188 |
189 | time:
190 | - platform: sntp
191 | id: sntp_time
192 | # Define the timezone of the device
193 | timezone: "${timezone}"
194 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
195 | update_interval: ${sntp_update_interval}
196 | # Set specific sntp servers to use
197 | servers:
198 | - "${sntp_server_1}"
199 | - "${sntp_server_2}"
200 | - "${sntp_server_3}"
201 | # Publish the time the device was last restarted
202 | on_time_sync:
203 | then:
204 | # Update last restart time, but only once.
205 | - if:
206 | condition:
207 | lambda: 'return id(device_last_restart).state == "";'
208 | then:
209 | - text_sensor.template.publish:
210 | id: device_last_restart
211 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
212 |
--------------------------------------------------------------------------------
/athom-relay-board-x4.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-4ch-relay"
4 | # Default friendly name
5 | friendly_name: "Athom 4CH Relay"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom esp8266 4ch relay board"
10 | # Project Name
11 | project_name: "Athom Technology.Athom 4CH Relay Board"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.0.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | relay1_restore_mode: RESTORE_DEFAULT_OFF
16 | relay2_restore_mode: RESTORE_DEFAULT_OFF
17 | relay3_restore_mode: RESTORE_DEFAULT_OFF
18 | relay4_restore_mode: RESTORE_DEFAULT_OFF
19 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
20 | dns_domain: ".local"
21 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
22 | timezone: ""
23 | # Set the duration between the sntp service polling ntp.org servers for an update
24 | sntp_update_interval: 6h
25 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
26 | sntp_server_1: "0.pool.ntp.org"
27 | sntp_server_2: "1.pool.ntp.org"
28 | sntp_server_3: "2.pool.ntp.org"
29 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
30 | wifi_fast_connect: "false"
31 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
32 | log_level: "DEBUG"
33 | # Enable or disable the use of IPv6 networking on the device
34 | ipv6_enable: "false"
35 |
36 | esphome:
37 | name: "${name}"
38 | friendly_name: "${friendly_name}"
39 | comment: "${device_description}"
40 | area: "${room}"
41 | name_add_mac_suffix: true
42 | min_version: 2024.6.0
43 | project:
44 | name: "${project_name}"
45 | version: "${project_version}"
46 |
47 | esp8266:
48 | board: esp8285
49 | restore_from_flash: true
50 |
51 | preferences:
52 | flash_write_interval: 1min
53 |
54 | api:
55 |
56 | ota:
57 | - platform: esphome
58 |
59 | logger:
60 | level: ${log_level}
61 | baud_rate: 115200
62 |
63 | web_server:
64 | port: 80
65 |
66 | network:
67 | enable_ipv6: ${ipv6_enable}
68 |
69 | wifi:
70 | # This spawns an AP with the device name and mac address with no password.
71 | ap: {}
72 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
73 | fast_connect: "${wifi_fast_connect}"
74 | # Define dns domain / suffix to add to hostname
75 | domain: "${dns_domain}"
76 |
77 | captive_portal:
78 |
79 | dashboard_import:
80 | package_import_url: github://athom-tech/athom-configs/athom-relay-board-x4.yaml
81 |
82 | binary_sensor:
83 | - platform: status
84 | name: "Status"
85 | entity_category: diagnostic
86 |
87 | sensor:
88 | - platform: uptime
89 | name: "Uptime Sensor"
90 | id: uptime_sensor
91 | entity_category: diagnostic
92 | internal: true
93 |
94 | - platform: wifi_signal
95 | name: "WiFi Signal dB"
96 | id: wifi_signal_db
97 | update_interval: 60s
98 | entity_category: "diagnostic"
99 |
100 | - platform: copy
101 | source_id: wifi_signal_db
102 | name: "WiFi Signal Percent"
103 | filters:
104 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
105 | unit_of_measurement: "Signal %"
106 | entity_category: "diagnostic"
107 | device_class: ""
108 |
109 | button:
110 | - platform: restart
111 | name: "Restart"
112 | entity_category: config
113 |
114 | - platform: factory_reset
115 | name: "Factory Reset"
116 | id: Reset
117 | entity_category: config
118 |
119 | - platform: safe_mode
120 | name: "Safe Mode"
121 | internal: false
122 | entity_category: config
123 |
124 | switch:
125 | - platform: gpio
126 | name: "Relay1"
127 | pin: GPIO16
128 | id: relay1
129 | restore_mode: ${relay1_restore_mode}
130 |
131 | - platform: gpio
132 | name: "Relay2"
133 | pin: GPIO14
134 | id: relay2
135 | restore_mode: ${relay2_restore_mode}
136 |
137 | - platform: gpio
138 | name: "Relay3"
139 | pin: GPIO12
140 | id: relay3
141 | restore_mode: ${relay3_restore_mode}
142 |
143 | - platform: gpio
144 | name: "Relay4"
145 | pin: GPIO13
146 | id: relay4
147 | restore_mode: ${relay4_restore_mode}
148 |
149 | light:
150 | - platform: status_led
151 | name: "Status LED"
152 | disabled_by_default: true
153 | pin:
154 | inverted: true
155 | number: GPIO5
156 |
157 | text_sensor:
158 | - platform: wifi_info
159 | ip_address:
160 | name: "IP Address"
161 | entity_category: diagnostic
162 | ssid:
163 | name: "Connected SSID"
164 | entity_category: diagnostic
165 | mac_address:
166 | name: "Mac Address"
167 | entity_category: diagnostic
168 |
169 | # Creates a sensor showing when the device was last restarted
170 | - platform: template
171 | name: 'Last Restart'
172 | id: device_last_restart
173 | icon: mdi:clock
174 | entity_category: diagnostic
175 | # device_class: timestamp
176 |
177 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
178 | - platform: template
179 | name: "Uptime"
180 | entity_category: diagnostic
181 | lambda: |-
182 | int seconds = (id(uptime_sensor).state);
183 | int days = seconds / (24 * 3600);
184 | seconds = seconds % (24 * 3600);
185 | int hours = seconds / 3600;
186 | seconds = seconds % 3600;
187 | int minutes = seconds / 60;
188 | seconds = seconds % 60;
189 | if ( days > 3650 ) {
190 | return { "Starting up" };
191 | } else if ( days ) {
192 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
193 | } else if ( hours ) {
194 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
195 | } else if ( minutes ) {
196 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
197 | } else {
198 | return { (String(seconds) +"s").c_str() };
199 | }
200 | icon: mdi:clock-start
201 |
202 | time:
203 | - platform: sntp
204 | id: sntp_time
205 | # Define the timezone of the device
206 | timezone: "${timezone}"
207 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
208 | update_interval: ${sntp_update_interval}
209 | # Set specific sntp servers to use
210 | servers:
211 | - "${sntp_server_1}"
212 | - "${sntp_server_2}"
213 | - "${sntp_server_3}"
214 | # Publish the time the device was last restarted
215 | on_time_sync:
216 | then:
217 | # Update last restart time, but only once.
218 | - if:
219 | condition:
220 | lambda: 'return id(device_last_restart).state == "";'
221 | then:
222 | - text_sensor.template.publish:
223 | id: device_last_restart
224 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
225 |
--------------------------------------------------------------------------------
/athom-relay-board-x8.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-8ch-relay"
4 | # Default friendly name
5 | friendly_name: "Athom 8CH Relay"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom esp8266 8ch relay board"
10 | # Project Name
11 | project_name: "Athom Technology.Athom 8CH Relay Board"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.0.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | relay1_restore_mode: RESTORE_DEFAULT_OFF
16 | relay2_restore_mode: RESTORE_DEFAULT_OFF
17 | relay3_restore_mode: RESTORE_DEFAULT_OFF
18 | relay4_restore_mode: RESTORE_DEFAULT_OFF
19 | relay5_restore_mode: RESTORE_DEFAULT_OFF
20 | relay6_restore_mode: RESTORE_DEFAULT_OFF
21 | relay7_restore_mode: RESTORE_DEFAULT_OFF
22 | relay8_restore_mode: RESTORE_DEFAULT_OFF
23 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
24 | dns_domain: ".local"
25 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
26 | timezone: ""
27 | # Set the duration between the sntp service polling ntp.org servers for an update
28 | sntp_update_interval: 6h
29 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
30 | sntp_server_1: "0.pool.ntp.org"
31 | sntp_server_2: "1.pool.ntp.org"
32 | sntp_server_3: "2.pool.ntp.org"
33 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
34 | wifi_fast_connect: "false"
35 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
36 | log_level: "DEBUG"
37 | # Enable or disable the use of IPv6 networking on the device
38 | ipv6_enable: "false"
39 |
40 | esphome:
41 | name: "${name}"
42 | friendly_name: "${friendly_name}"
43 | comment: "${device_description}"
44 | area: "${room}"
45 | name_add_mac_suffix: true
46 | min_version: 2024.6.0
47 | project:
48 | name: "${project_name}"
49 | version: "${project_version}"
50 |
51 | esp8266:
52 | board: esp8285
53 | restore_from_flash: true
54 |
55 | preferences:
56 | flash_write_interval: 1min
57 |
58 | api:
59 |
60 | ota:
61 | - platform: esphome
62 |
63 | logger:
64 | level: ${log_level}
65 | baud_rate: 115200
66 |
67 | web_server:
68 | port: 80
69 |
70 | network:
71 | enable_ipv6: ${ipv6_enable}
72 |
73 | wifi:
74 | # This spawns an AP with the device name and mac address with no password.
75 | ap: {}
76 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
77 | fast_connect: "${wifi_fast_connect}"
78 | # Define dns domain / suffix to add to hostname
79 | domain: "${dns_domain}"
80 |
81 | captive_portal:
82 |
83 | dashboard_import:
84 | package_import_url: github://athom-tech/athom-configs/athom-relay-board-x8.yaml
85 |
86 | binary_sensor:
87 | - platform: status
88 | name: "Status"
89 | entity_category: diagnostic
90 |
91 | sensor:
92 | - platform: uptime
93 | name: "Uptime Sensor"
94 | id: uptime_sensor
95 | entity_category: diagnostic
96 | internal: true
97 |
98 | - platform: wifi_signal
99 | name: "WiFi Signal dB"
100 | id: wifi_signal_db
101 | update_interval: 60s
102 | entity_category: "diagnostic"
103 |
104 | - platform: copy
105 | source_id: wifi_signal_db
106 | name: "WiFi Signal Percent"
107 | filters:
108 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
109 | unit_of_measurement: "Signal %"
110 | entity_category: "diagnostic"
111 | device_class: ""
112 |
113 | button:
114 | - platform: restart
115 | name: "Restart"
116 | entity_category: config
117 |
118 | - platform: factory_reset
119 | name: "Factory Reset"
120 | id: Reset
121 | entity_category: config
122 |
123 | - platform: safe_mode
124 | name: "Safe Mode"
125 | internal: false
126 | entity_category: config
127 |
128 | switch:
129 | - platform: gpio
130 | name: "Relay1"
131 | pin: GPIO16
132 | id: relay1
133 | restore_mode: ${relay1_restore_mode}
134 |
135 | - platform: gpio
136 | name: "Relay2"
137 | pin: GPIO14
138 | id: relay2
139 | restore_mode: ${relay2_restore_mode}
140 |
141 | - platform: gpio
142 | name: "Relay3"
143 | pin: GPIO12
144 | id: relay3
145 | restore_mode: ${relay3_restore_mode}
146 |
147 | - platform: gpio
148 | name: "Relay4"
149 | pin: GPIO13
150 | id: relay4
151 | restore_mode: ${relay4_restore_mode}
152 |
153 | - platform: gpio
154 | name: "Relay5"
155 | pin: GPIO15
156 | id: relay5
157 | restore_mode: ${relay5_restore_mode}
158 |
159 | - platform: gpio
160 | name: "Relay6"
161 | pin: GPIO0
162 | id: relay6
163 | restore_mode: ${relay6_restore_mode}
164 |
165 | - platform: gpio
166 | name: "Relay7"
167 | pin: GPIO4
168 | id: relay7
169 | restore_mode: ${relay7_restore_mode}
170 |
171 | - platform: gpio
172 | name: "Relay8"
173 | pin: GPIO5
174 | id: relay8
175 | restore_mode: ${relay8_restore_mode}
176 |
177 | light:
178 | - platform: status_led
179 | name: "Status LED"
180 | disabled_by_default: true
181 | pin:
182 | inverted: true
183 | number: GPIO2
184 |
185 | text_sensor:
186 | - platform: wifi_info
187 | ip_address:
188 | name: "IP Address"
189 | entity_category: diagnostic
190 | ssid:
191 | name: "Connected SSID"
192 | entity_category: diagnostic
193 | mac_address:
194 | name: "Mac Address"
195 | entity_category: diagnostic
196 |
197 | # Creates a sensor showing when the device was last restarted
198 | - platform: template
199 | name: 'Last Restart'
200 | id: device_last_restart
201 | icon: mdi:clock
202 | entity_category: diagnostic
203 | # device_class: timestamp
204 |
205 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
206 | - platform: template
207 | name: "Uptime"
208 | entity_category: diagnostic
209 | lambda: |-
210 | int seconds = (id(uptime_sensor).state);
211 | int days = seconds / (24 * 3600);
212 | seconds = seconds % (24 * 3600);
213 | int hours = seconds / 3600;
214 | seconds = seconds % 3600;
215 | int minutes = seconds / 60;
216 | seconds = seconds % 60;
217 | if ( days > 3650 ) {
218 | return { "Starting up" };
219 | } else if ( days ) {
220 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
221 | } else if ( hours ) {
222 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
223 | } else if ( minutes ) {
224 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
225 | } else {
226 | return { (String(seconds) +"s").c_str() };
227 | }
228 | icon: mdi:clock-start
229 |
230 | time:
231 | - platform: sntp
232 | id: sntp_time
233 | # Define the timezone of the device
234 | timezone: "${timezone}"
235 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
236 | update_interval: ${sntp_update_interval}
237 | # Set specific sntp servers to use
238 | servers:
239 | - "${sntp_server_1}"
240 | - "${sntp_server_2}"
241 | - "${sntp_server_3}"
242 | # Publish the time the device was last restarted
243 | on_time_sync:
244 | then:
245 | # Update last restart time, but only once.
246 | - if:
247 | condition:
248 | lambda: 'return id(device_last_restart).state == "";'
249 | then:
250 | - text_sensor.template.publish:
251 | id: device_last_restart
252 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
253 |
--------------------------------------------------------------------------------
/athom-rgb-light.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-rgb-light"
4 | # Default friendly name
5 | friendly_name: "Athom RGB Controller"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom rgb light strip controller"
10 | # Project Name
11 | project_name: "Athom Technology.Athom RGB Controller"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the light (GPO switch) upon reboot to state:
15 | light_restore_mode: RESTORE_DEFAULT_OFF
16 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
17 | dns_domain: ".local"
18 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
19 | timezone: ""
20 | # Set the duration between the sntp service polling ntp.org servers for an update
21 | sntp_update_interval: 6h
22 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
23 | sntp_server_1: "0.pool.ntp.org"
24 | sntp_server_2: "1.pool.ntp.org"
25 | sntp_server_3: "2.pool.ntp.org"
26 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
27 | wifi_fast_connect: "false"
28 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
29 | log_level: "DEBUG"
30 | # Enable or disable the use of IPv6 networking on the device
31 | ipv6_enable: "false"
32 |
33 | esphome:
34 | name: "${name}"
35 | friendly_name: "${friendly_name}"
36 | comment: "${device_description}"
37 | area: "${room}"
38 | name_add_mac_suffix: true
39 | min_version: 2024.6.0
40 | project:
41 | name: "${project_name}"
42 | version: "${project_version}"
43 |
44 | esp8266:
45 | board: esp8285
46 | restore_from_flash: true
47 |
48 | preferences:
49 | flash_write_interval: 1min
50 |
51 | api:
52 |
53 | ota:
54 | - platform: esphome
55 |
56 | logger:
57 | level: ${log_level}
58 | baud_rate: 115200
59 |
60 | mdns:
61 | disabled: false
62 |
63 | web_server:
64 | port: 80
65 |
66 | network:
67 | enable_ipv6: ${ipv6_enable}
68 |
69 | wifi:
70 | # This spawns an AP with the device name and mac address with no password.
71 | ap: {}
72 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
73 | fast_connect: "${wifi_fast_connect}"
74 | # Define dns domain / suffix to add to hostname
75 | domain: "${dns_domain}"
76 |
77 | captive_portal:
78 |
79 | dashboard_import:
80 | package_import_url: github://athom-tech/athom-configs/athom-rgb-light.yaml
81 |
82 | binary_sensor:
83 | - platform: status
84 | name: "Status"
85 | entity_category: diagnostic
86 |
87 | - platform: gpio
88 | pin:
89 | number: 0
90 | mode: INPUT_PULLUP
91 | inverted: true
92 | name: "Power Button"
93 | disabled_by_default: true
94 | on_multi_click:
95 | - timing:
96 | - ON for at most 1s
97 | - OFF for at least 0.2s
98 | then:
99 | - light.toggle: led
100 | - timing:
101 | - ON for at least 4s
102 | then:
103 | - button.press: Reset
104 |
105 | sensor:
106 | - platform: uptime
107 | name: "Uptime Sensor"
108 | id: uptime_sensor
109 | entity_category: diagnostic
110 | internal: true
111 |
112 | - platform: wifi_signal
113 | name: "WiFi Signal dB"
114 | id: wifi_signal_db
115 | update_interval: 60s
116 | entity_category: "diagnostic"
117 |
118 | - platform: copy
119 | source_id: wifi_signal_db
120 | name: "WiFi Signal Percent"
121 | filters:
122 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
123 | unit_of_measurement: "Signal %"
124 | entity_category: "diagnostic"
125 | device_class: ""
126 |
127 | button:
128 | - platform: restart
129 | name: "Restart"
130 | entity_category: config
131 |
132 | - platform: factory_reset
133 | name: "Factory Reset"
134 | id: Reset
135 | entity_category: config
136 |
137 | - platform: safe_mode
138 | name: "Safe Mode"
139 | internal: false
140 | entity_category: config
141 |
142 | output:
143 | - platform: esp8266_pwm
144 | id: red_output
145 | pin: GPIO12
146 | - platform: esp8266_pwm
147 | id: green_output
148 | pin: GPIO4
149 | - platform: esp8266_pwm
150 | id: blue_output
151 | pin: GPIO14
152 |
153 | light:
154 | - platform: rgb
155 | name: "RGB Light Strip"
156 | restore_mode: ${light_restore_mode}
157 | red: red_output
158 | green: green_output
159 | blue: blue_output
160 | id: led
161 |
162 | text_sensor:
163 | - platform: wifi_info
164 | ip_address:
165 | name: "IP Address"
166 | entity_category: diagnostic
167 | ssid:
168 | name: "Connected SSID"
169 | entity_category: diagnostic
170 | mac_address:
171 | name: "Mac Address"
172 | entity_category: diagnostic
173 |
174 | # Creates a sensor showing when the device was last restarted
175 | - platform: template
176 | name: 'Last Restart'
177 | id: device_last_restart
178 | icon: mdi:clock
179 | entity_category: diagnostic
180 | # device_class: timestamp
181 |
182 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
183 | - platform: template
184 | name: "Uptime"
185 | entity_category: diagnostic
186 | lambda: |-
187 | int seconds = (id(uptime_sensor).state);
188 | int days = seconds / (24 * 3600);
189 | seconds = seconds % (24 * 3600);
190 | int hours = seconds / 3600;
191 | seconds = seconds % 3600;
192 | int minutes = seconds / 60;
193 | seconds = seconds % 60;
194 | if ( days > 3650 ) {
195 | return { "Starting up" };
196 | } else if ( days ) {
197 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
198 | } else if ( hours ) {
199 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
200 | } else if ( minutes ) {
201 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
202 | } else {
203 | return { (String(seconds) +"s").c_str() };
204 | }
205 | icon: mdi:clock-start
206 |
207 | time:
208 | - platform: sntp
209 | id: sntp_time
210 | # Define the timezone of the device
211 | timezone: "${timezone}"
212 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
213 | update_interval: ${sntp_update_interval}
214 | # Set specific sntp servers to use
215 | servers:
216 | - "${sntp_server_1}"
217 | - "${sntp_server_2}"
218 | - "${sntp_server_3}"
219 | # Publish the time the device was last restarted
220 | on_time_sync:
221 | then:
222 | # Update last restart time, but only once.
223 | - if:
224 | condition:
225 | lambda: 'return id(device_last_restart).state == "";'
226 | then:
227 | - text_sensor.template.publish:
228 | id: device_last_restart
229 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
230 |
--------------------------------------------------------------------------------
/athom-rgbct-light.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-rgbcct-bulb"
4 | # Default friendly name
5 | friendly_name: "Athom RGBCCT Bulb"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom 15w rgbcct light bulb"
10 | # Project Name
11 | project_name: "Athom Technology.Athom RGBCCT Bulb"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the light (GPO switch) upon reboot to state:
15 | light_restore_mode: RESTORE_DEFAULT_ON
16 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
17 | dns_domain: ".local"
18 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
19 | timezone: ""
20 | # Set the duration between the sntp service polling ntp.org servers for an update
21 | sntp_update_interval: 6h
22 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
23 | sntp_server_1: "0.pool.ntp.org"
24 | sntp_server_2: "1.pool.ntp.org"
25 | sntp_server_3: "2.pool.ntp.org"
26 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
27 | wifi_fast_connect: "false"
28 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
29 | log_level: "DEBUG"
30 | # Enable or disable the use of IPv6 networking on the device
31 | ipv6_enable: "false"
32 | color_interlock: "true"
33 |
34 | globals:
35 | - id: fast_boot
36 | type: int
37 | restore_value: yes
38 | initial_value: '0'
39 |
40 | - id: restore_mode
41 | type: int
42 | restore_value: yes
43 | initial_value: "1"
44 |
45 | select:
46 | - platform: template
47 | name: "Power On State"
48 | id: "power_mode"
49 | optimistic: true
50 | options:
51 | - Always Off
52 | - Always On
53 | - Restore Power Off State
54 | on_value:
55 | then:
56 | - lambda: |-
57 | id(restore_mode)=i+1;
58 |
59 | esphome:
60 | name: "${name}"
61 | friendly_name: "${friendly_name}"
62 | comment: "${device_description}"
63 | area: "${room}"
64 | name_add_mac_suffix: true
65 | min_version: 2024.6.0
66 | project:
67 | name: "${project_name}"
68 | version: "${project_version}"
69 | on_boot:
70 | then:
71 | - script.execute: fast_boot_script
72 | - select.set_index:
73 | id: power_mode
74 | index: !lambda |-
75 | return id(restore_mode)-1;
76 | - lambda: |-
77 | switch(id(restore_mode))
78 | {
79 | case 1:{
80 | auto call = id(rgbct_light).turn_off();
81 | call.perform();
82 | break;
83 | }
84 | case 2:{
85 | auto call = id(rgbct_light).turn_on();
86 | call.set_color_mode(ColorMode::WHITE);
87 | call.set_brightness(1.0);
88 | call.perform();
89 | break;
90 | }
91 | default:{
92 | break;
93 | }
94 | }
95 |
96 | esp8266:
97 | board: esp8285
98 | restore_from_flash: true
99 |
100 | preferences:
101 | flash_write_interval: 1min
102 |
103 | api:
104 |
105 | ota:
106 | - platform: esphome
107 |
108 | logger:
109 | level: ${log_level}
110 | baud_rate: 115200
111 |
112 | mdns:
113 | disabled: false
114 |
115 | web_server:
116 | port: 80
117 |
118 | network:
119 | enable_ipv6: ${ipv6_enable}
120 |
121 | wifi:
122 | # This spawns an AP with the device name and mac address with no password.
123 | ap: {}
124 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
125 | fast_connect: "${wifi_fast_connect}"
126 | # Define dns domain / suffix to add to hostname
127 | domain: "${dns_domain}"
128 |
129 | captive_portal:
130 |
131 | dashboard_import:
132 | package_import_url: github://athom-tech/athom-configs/athom-rgbct-light.yaml
133 |
134 | binary_sensor:
135 | - platform: status
136 | name: "Status"
137 | entity_category: diagnostic
138 |
139 | sensor:
140 | - platform: uptime
141 | name: "Uptime Sensor"
142 | id: uptime_sensor
143 | entity_category: diagnostic
144 | internal: true
145 |
146 | - platform: wifi_signal
147 | name: "WiFi Signal dB"
148 | id: wifi_signal_db
149 | update_interval: 60s
150 | entity_category: "diagnostic"
151 |
152 | - platform: copy
153 | source_id: wifi_signal_db
154 | name: "WiFi Signal Percent"
155 | filters:
156 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
157 | unit_of_measurement: "Signal %"
158 | entity_category: "diagnostic"
159 | device_class: ""
160 |
161 | button:
162 | - platform: restart
163 | name: "Restart"
164 | entity_category: config
165 |
166 | - platform: factory_reset
167 | name: "Factory Reset"
168 | id: Reset
169 | entity_category: config
170 |
171 | - platform: safe_mode
172 | name: "Safe Mode"
173 | internal: false
174 | entity_category: config
175 |
176 | output:
177 | - platform: esp8266_pwm
178 | id: red_output
179 | pin: GPIO4
180 | min_power: 0.000499
181 | max_power: 1
182 | zero_means_zero: true
183 | - platform: esp8266_pwm
184 | id: green_output
185 | pin: GPIO12
186 | min_power: 0.000499
187 | max_power: 1
188 | zero_means_zero: true
189 | - platform: esp8266_pwm
190 | id: blue_output
191 | pin: GPIO14
192 | min_power: 0.000499
193 | max_power: 1
194 | zero_means_zero: true
195 | - platform: esp8266_pwm
196 | id: white_output
197 | pin: GPIO5
198 | min_power: 0.01
199 | max_power: 0.9
200 | zero_means_zero: true
201 | - platform: esp8266_pwm
202 | id: ct_output
203 | inverted: true
204 | pin: GPIO13
205 | min_power: 0.01
206 | max_power: 0.9
207 | zero_means_zero: true
208 |
209 | light:
210 | - platform: rgbct
211 | id: rgbct_light
212 | name: "RGBCCT_Bulb"
213 | restore_mode: ${light_restore_mode}
214 | red: red_output
215 | green: green_output
216 | blue: blue_output
217 | white_brightness: white_output
218 | color_temperature: ct_output
219 | cold_white_color_temperature: 6000K
220 | warm_white_color_temperature: 3000K
221 | color_interlock: ${color_interlock}
222 |
223 | text_sensor:
224 | - platform: wifi_info
225 | ip_address:
226 | name: "IP Address"
227 | entity_category: diagnostic
228 | ssid:
229 | name: "Connected SSID"
230 | entity_category: diagnostic
231 | mac_address:
232 | name: "Mac Address"
233 | entity_category: diagnostic
234 |
235 | # Creates a sensor showing when the device was last restarted
236 | - platform: template
237 | name: 'Last Restart'
238 | id: device_last_restart
239 | icon: mdi:clock
240 | entity_category: diagnostic
241 | # device_class: timestamp
242 |
243 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
244 | - platform: template
245 | name: "Uptime"
246 | entity_category: diagnostic
247 | lambda: |-
248 | int seconds = (id(uptime_sensor).state);
249 | int days = seconds / (24 * 3600);
250 | seconds = seconds % (24 * 3600);
251 | int hours = seconds / 3600;
252 | seconds = seconds % 3600;
253 | int minutes = seconds / 60;
254 | seconds = seconds % 60;
255 | if ( days > 3650 ) {
256 | return { "Starting up" };
257 | } else if ( days ) {
258 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
259 | } else if ( hours ) {
260 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
261 | } else if ( minutes ) {
262 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
263 | } else {
264 | return { (String(seconds) +"s").c_str() };
265 | }
266 | icon: mdi:clock-start
267 |
268 | time:
269 | - platform: sntp
270 | id: sntp_time
271 | # Define the timezone of the device
272 | timezone: "${timezone}"
273 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
274 | update_interval: ${sntp_update_interval}
275 | # Set specific sntp servers to use
276 | servers:
277 | - "${sntp_server_1}"
278 | - "${sntp_server_2}"
279 | - "${sntp_server_3}"
280 | # Publish the time the device was last restarted
281 | on_time_sync:
282 | then:
283 | # Update last restart time, but only once.
284 | - if:
285 | condition:
286 | lambda: 'return id(device_last_restart).state == "";'
287 | then:
288 | - text_sensor.template.publish:
289 | id: device_last_restart
290 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
291 |
292 | script:
293 | - id: fast_boot_script
294 | then:
295 | - if:
296 | condition:
297 | lambda: return ( id(fast_boot) >= 3 );
298 | then:
299 | - lambda: |-
300 | ESP_LOGD("athom-rgbct-light.yaml", "Now the counter is greater than or equal to 3, perform reset device and reboot");
301 | id(fast_boot) = 0;
302 | fast_boot->loop();
303 | global_preferences->sync();
304 | auto call = id(rgbct_light).turn_on();
305 | call.set_transition_length(500);
306 | call.set_brightness(1.0);
307 | call.set_color_mode(ColorMode::RGB);
308 | call.set_rgb(0.0, 0.0, 1.0);
309 | call.perform();
310 | - delay: 5s
311 | - button.press: Reset
312 | - lambda: |-
313 | id(fast_boot) += 1;
314 | fast_boot->loop();
315 | global_preferences->sync();
316 | ESP_LOGD("athom-rgbct-light.yaml", "Now the counter is %d. Reset the device when the counter is greater than or equal to 3", id(fast_boot));
317 | - delay: 10s
318 | - lambda: |-
319 | ESP_LOGD("athom-rgbct-light.yaml", "Reset counter");
320 | id(fast_boot) = 0;
321 | fast_boot->loop();
322 | global_preferences->sync();
323 |
--------------------------------------------------------------------------------
/athom-rgbw-light.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-rgbw-light"
4 | # Default friendly name
5 | friendly_name: "Athom RGBW Light"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom rgbw light strip controller"
10 | # Project Name
11 | project_name: "Athom Technology.RGBW Light Strip Controller"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the light (GPO switch) upon reboot to state:
15 | light_restore_mode: RESTORE_DEFAULT_ON
16 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
17 | dns_domain: ".local"
18 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
19 | timezone: ""
20 | # Set the duration between the sntp service polling ntp.org servers for an update
21 | sntp_update_interval: 6h
22 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
23 | sntp_server_1: "0.pool.ntp.org"
24 | sntp_server_2: "1.pool.ntp.org"
25 | sntp_server_3: "2.pool.ntp.org"
26 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
27 | wifi_fast_connect: "false"
28 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
29 | log_level: "DEBUG"
30 | # Enable or disable the use of IPv6 networking on the device
31 | ipv6_enable: "false"
32 | color_interlock: "true"
33 |
34 | esphome:
35 | name: "${name}"
36 | friendly_name: "${friendly_name}"
37 | comment: "${device_description}"
38 | area: "${room}"
39 | name_add_mac_suffix: true
40 | min_version: 2024.6.0
41 | project:
42 | name: "${project_name}"
43 | version: "${project_version}"
44 |
45 | esp8266:
46 | board: esp8285
47 | restore_from_flash: true
48 |
49 | api:
50 |
51 | ota:
52 | - platform: esphome
53 |
54 | logger:
55 |
56 | mdns:
57 | disabled: false
58 |
59 | web_server:
60 | port: 80
61 |
62 | network:
63 | enable_ipv6: ${ipv6_enable}
64 |
65 | wifi:
66 | # This spawns an AP with the device name and mac address with no password.
67 | ap: {}
68 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
69 | fast_connect: "${wifi_fast_connect}"
70 | # Define dns domain / suffix to add to hostname
71 | domain: "${dns_domain}"
72 |
73 | captive_portal:
74 |
75 | dashboard_import:
76 | package_import_url: github://athom-tech/athom-configs/athom-rgbw-light.yaml
77 |
78 | binary_sensor:
79 | - platform: status
80 | name: "Status"
81 | entity_category: diagnostic
82 |
83 | - platform: gpio
84 | pin:
85 | number: 0
86 | mode: INPUT_PULLUP
87 | inverted: true
88 | name: "Power Button"
89 | disabled_by_default: true
90 | on_multi_click:
91 | - timing:
92 | - ON for at most 1s
93 | - OFF for at least 0.2s
94 | then:
95 | - light.toggle: leds
96 | - timing:
97 | - ON for at least 4s
98 | then:
99 | - button.press: Reset
100 |
101 | sensor:
102 | - platform: uptime
103 | name: "Uptime Sensor"
104 | id: uptime_sensor
105 | entity_category: diagnostic
106 | internal: true
107 |
108 | - platform: wifi_signal
109 | name: "WiFi Signal dB"
110 | id: wifi_signal_db
111 | update_interval: 60s
112 | entity_category: "diagnostic"
113 |
114 | - platform: copy
115 | source_id: wifi_signal_db
116 | name: "WiFi Signal Percent"
117 | filters:
118 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
119 | unit_of_measurement: "Signal %"
120 | entity_category: "diagnostic"
121 | device_class: ""
122 |
123 | button:
124 | - platform: restart
125 | name: "Restart"
126 | entity_category: config
127 |
128 | - platform: factory_reset
129 | name: "Factory Reset"
130 | id: Reset
131 | entity_category: config
132 |
133 | - platform: safe_mode
134 | name: "Safe Mode"
135 | internal: false
136 | entity_category: config
137 |
138 | output:
139 | - platform: esp8266_pwm
140 | id: output_red
141 | pin: GPIO4
142 |
143 | - platform: esp8266_pwm
144 | id: output_green
145 | pin: GPIO12
146 |
147 | - platform: esp8266_pwm
148 | id: output_blue
149 | pin: GPIO14
150 |
151 | - platform: esp8266_pwm
152 | id: output_white
153 | pin: GPIO13
154 |
155 | light:
156 | - platform: rgbw
157 | name: "RGBW_Controller"
158 | id: leds
159 | red: output_red
160 | green: output_green
161 | blue: output_blue
162 | white: output_white
163 | color_interlock: ${color_interlock}
164 |
165 | text_sensor:
166 | - platform: wifi_info
167 | ip_address:
168 | name: "IP Address"
169 | entity_category: diagnostic
170 | ssid:
171 | name: "Connected SSID"
172 | entity_category: diagnostic
173 | mac_address:
174 | name: "Mac Address"
175 | entity_category: diagnostic
176 |
177 | # Creates a sensor showing when the device was last restarted
178 | - platform: template
179 | name: 'Last Restart'
180 | id: device_last_restart
181 | icon: mdi:clock
182 | entity_category: diagnostic
183 | # device_class: timestamp
184 |
185 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
186 | - platform: template
187 | name: "Uptime"
188 | entity_category: diagnostic
189 | lambda: |-
190 | int seconds = (id(uptime_sensor).state);
191 | int days = seconds / (24 * 3600);
192 | seconds = seconds % (24 * 3600);
193 | int hours = seconds / 3600;
194 | seconds = seconds % 3600;
195 | int minutes = seconds / 60;
196 | seconds = seconds % 60;
197 | if ( days > 3650 ) {
198 | return { "Starting up" };
199 | } else if ( days ) {
200 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
201 | } else if ( hours ) {
202 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
203 | } else if ( minutes ) {
204 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
205 | } else {
206 | return { (String(seconds) +"s").c_str() };
207 | }
208 | icon: mdi:clock-start
209 |
210 | time:
211 | - platform: sntp
212 | id: sntp_time
213 | # Define the timezone of the device
214 | timezone: "${timezone}"
215 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
216 | update_interval: ${sntp_update_interval}
217 | # Set specific sntp servers to use
218 | servers:
219 | - "${sntp_server_1}"
220 | - "${sntp_server_2}"
221 | - "${sntp_server_3}"
222 | # Publish the time the device was last restarted
223 | on_time_sync:
224 | then:
225 | # Update last restart time, but only once.
226 | - if:
227 | condition:
228 | lambda: 'return id(device_last_restart).state == "";'
229 | then:
230 | - text_sensor.template.publish:
231 | id: device_last_restart
232 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
233 |
--------------------------------------------------------------------------------
/athom-rgbww-light.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-rgbcw-bulb"
4 | # Default friendly name
5 | friendly_name: "Athom RGBCW Bulb"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom 7w rgbcw light bulb"
10 | # Project Name
11 | project_name: "Athom Technology.Athom RGBCW Bulb"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the light (GPO switch) upon reboot to state:
15 | light_restore_mode: RESTORE_DEFAULT_ON
16 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
17 | dns_domain: ".local"
18 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
19 | timezone: ""
20 | # Set the duration between the sntp service polling ntp.org servers for an update
21 | sntp_update_interval: 6h
22 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
23 | sntp_server_1: "0.pool.ntp.org"
24 | sntp_server_2: "1.pool.ntp.org"
25 | sntp_server_3: "2.pool.ntp.org"
26 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
27 | wifi_fast_connect: "false"
28 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
29 | log_level: "DEBUG"
30 | # Enable or disable the use of IPv6 networking on the device
31 | ipv6_enable: "false"
32 | color_interlock: "true"
33 |
34 | globals:
35 | - id: fast_boot
36 | type: int
37 | restore_value: yes
38 | initial_value: '0'
39 |
40 | - id: restore_mode
41 | type: int
42 | restore_value: yes
43 | initial_value: "1"
44 |
45 | select:
46 | - platform: template
47 | name: "Power On State"
48 | id: "power_mode"
49 | optimistic: true
50 | options:
51 | - Always Off
52 | - Always On
53 | - Restore Power Off State
54 | on_value:
55 | then:
56 | - lambda: |-
57 | id(restore_mode)=i+1;
58 |
59 | esphome:
60 | name: "${name}"
61 | friendly_name: "${friendly_name}"
62 | comment: "${device_description}"
63 | area: "${room}"
64 | name_add_mac_suffix: true
65 | min_version: 2024.6.0
66 | project:
67 | name: "${project_name}"
68 | version: "${project_version}"
69 | on_boot:
70 | then:
71 | - script.execute: fast_boot_script
72 | - select.set_index:
73 | id: power_mode
74 | index: !lambda |-
75 | return id(restore_mode)-1;
76 | - lambda: |-
77 | switch(id(restore_mode))
78 | {
79 | case 1:{
80 | auto call = id(rgbww_light).turn_off();
81 | call.perform();
82 | break;
83 | }
84 | case 2:{
85 | auto call = id(rgbww_light).turn_on();
86 | call.set_color_mode(ColorMode::WHITE);
87 | call.set_brightness(1.0);
88 | call.perform();
89 | break;
90 | }
91 | default:{
92 | break;
93 | }
94 | }
95 |
96 | esp8266:
97 | board: esp8285
98 | restore_from_flash: true
99 |
100 | preferences:
101 | flash_write_interval: 1min
102 |
103 | api:
104 |
105 | ota:
106 | - platform: esphome
107 |
108 | logger:
109 |
110 | mdns:
111 | disabled: false
112 |
113 | web_server:
114 | port: 80
115 |
116 | network:
117 | enable_ipv6: ${ipv6_enable}
118 |
119 | wifi:
120 | # This spawns an AP with the device name and mac address with no password.
121 | ap: {}
122 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
123 | fast_connect: "${wifi_fast_connect}"
124 | # Define dns domain / suffix to add to hostname
125 | domain: "${dns_domain}"
126 |
127 | captive_portal:
128 |
129 | dashboard_import:
130 | package_import_url: github://athom-tech/athom-configs/athom-rgbww-light.yaml
131 |
132 | binary_sensor:
133 | - platform: status
134 | name: "Status"
135 | entity_category: diagnostic
136 |
137 | sensor:
138 | - platform: uptime
139 | name: "Uptime Sensor"
140 | id: uptime_sensor
141 | entity_category: diagnostic
142 | internal: true
143 |
144 | - platform: wifi_signal
145 | name: "WiFi Signal dB"
146 | id: wifi_signal_db
147 | update_interval: 60s
148 | entity_category: "diagnostic"
149 |
150 | - platform: copy
151 | source_id: wifi_signal_db
152 | name: "WiFi Signal Percent"
153 | filters:
154 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
155 | unit_of_measurement: "Signal %"
156 | entity_category: "diagnostic"
157 | device_class: ""
158 |
159 | button:
160 | - platform: restart
161 | name: "Restart"
162 | entity_category: config
163 |
164 | - platform: factory_reset
165 | name: "Factory Reset"
166 | id: Reset
167 | entity_category: config
168 |
169 | - platform: safe_mode
170 | name: "Safe Mode"
171 | internal: false
172 | entity_category: config
173 |
174 | output:
175 | - platform: esp8266_pwm
176 | id: red_output
177 | pin: GPIO4
178 | min_power: 0.000499
179 | max_power: 1
180 | - platform: esp8266_pwm
181 | id: green_output
182 | pin: GPIO12
183 | min_power: 0.000499
184 | max_power: 1
185 | - platform: esp8266_pwm
186 | id: blue_output
187 | pin: GPIO14
188 | min_power: 0.000499
189 | max_power: 1
190 | - platform: esp8266_pwm
191 | id: warm_white_output
192 | pin: GPIO13
193 | min_power: 0.000499
194 | max_power: 0.9
195 | - platform: esp8266_pwm
196 | id: white_output
197 | pin: GPIO5
198 | min_power: 0.000499
199 | max_power: 0.9
200 |
201 | light:
202 | - platform: rgbww
203 | id: rgbww_light
204 | name: "RGBCW_Bulb"
205 | restore_mode: ${light_restore_mode}
206 | red: red_output
207 | green: green_output
208 | blue: blue_output
209 | warm_white: warm_white_output
210 | cold_white: white_output
211 | cold_white_color_temperature: 6000 K
212 | warm_white_color_temperature: 3000 K
213 | color_interlock: ${color_interlock}
214 |
215 | text_sensor:
216 | - platform: wifi_info
217 | ip_address:
218 | name: "IP Address"
219 | entity_category: diagnostic
220 | ssid:
221 | name: "Connected SSID"
222 | entity_category: diagnostic
223 | mac_address:
224 | name: "Mac Address"
225 | entity_category: diagnostic
226 |
227 | # Creates a sensor showing when the device was last restarted
228 | - platform: template
229 | name: 'Last Restart'
230 | id: device_last_restart
231 | icon: mdi:clock
232 | entity_category: diagnostic
233 | # device_class: timestamp
234 |
235 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
236 | - platform: template
237 | name: "Uptime"
238 | entity_category: diagnostic
239 | lambda: |-
240 | int seconds = (id(uptime_sensor).state);
241 | int days = seconds / (24 * 3600);
242 | seconds = seconds % (24 * 3600);
243 | int hours = seconds / 3600;
244 | seconds = seconds % 3600;
245 | int minutes = seconds / 60;
246 | seconds = seconds % 60;
247 | if ( days > 3650 ) {
248 | return { "Starting up" };
249 | } else if ( days ) {
250 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
251 | } else if ( hours ) {
252 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
253 | } else if ( minutes ) {
254 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
255 | } else {
256 | return { (String(seconds) +"s").c_str() };
257 | }
258 | icon: mdi:clock-start
259 |
260 | time:
261 | - platform: sntp
262 | id: sntp_time
263 | # Define the timezone of the device
264 | timezone: "${timezone}"
265 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
266 | update_interval: ${sntp_update_interval}
267 | # Set specific sntp servers to use
268 | servers:
269 | - "${sntp_server_1}"
270 | - "${sntp_server_2}"
271 | - "${sntp_server_3}"
272 | # Publish the time the device was last restarted
273 | on_time_sync:
274 | then:
275 | # Update last restart time, but only once.
276 | - if:
277 | condition:
278 | lambda: 'return id(device_last_restart).state == "";'
279 | then:
280 | - text_sensor.template.publish:
281 | id: device_last_restart
282 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
283 |
284 | script:
285 | - id: fast_boot_script
286 | then:
287 | - if:
288 | condition:
289 | lambda: return ( id(fast_boot) >= 3 );
290 | then:
291 | - lambda: |-
292 | ESP_LOGD("athom-rgbww-light.yaml", "Now the counter is greater than or equal to 3, perform reset device and reboot");
293 | id(fast_boot) = 0;
294 | fast_boot->loop();
295 | global_preferences->sync();
296 | auto call = id(rgbww_light).turn_on();
297 | call.set_transition_length(500);
298 | call.set_brightness(1.0);
299 | call.set_color_mode(ColorMode::RGB);
300 | call.set_rgb(0.0, 0.0, 1.0);
301 | call.perform();
302 | - delay: 5s
303 | - button.press: Reset
304 | - lambda: |-
305 | id(fast_boot) += 1;
306 | fast_boot->loop();
307 | global_preferences->sync();
308 | ESP_LOGD("athom-rgbww-light.yaml", "Now the counter is %d. Reset the device when the counter is greater than or equal to 3", id(fast_boot));
309 | - delay: 10s
310 | - lambda: |-
311 | ESP_LOGD("athom-rgbww-light.yaml", "Reset counter");
312 | id(fast_boot) = 0;
313 | fast_boot->loop();
314 | global_preferences->sync();
315 |
--------------------------------------------------------------------------------
/athom-smart-plug-v2.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | name: "athom-smart-plug-v2"
3 | friendly_name: "Smart Plug V2"
4 | # Allows ESP device to be automatically lined to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
5 | room: ""
6 | device_description: "athom smart plug v2"
7 | project_name: "Athom Technology.Smart Plug V2"
8 | project_version: "v2.0.7"
9 | sensor_update_interval: "10s"
10 | relay_restore_mode: RESTORE_DEFAULT_ON
11 | # Current Limit in Amps. AU Plug = 10. IL, BR, EU, UK, US Plug = 16.
12 | current_limit : "16"
13 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
14 | dns_domain: ".local"
15 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
16 | timezone: ""
17 | # Set the duration between the sntp service polling ntp.org servers for an update
18 | sntp_update_interval: "6h"
19 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
20 | sntp_server_1: "0.pool.ntp.org"
21 | sntp_server_2: "1.pool.ntp.org"
22 | sntp_server_3: "2.pool.ntp.org"
23 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
24 | wifi_fast_connect: "false"
25 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
26 | log_level: "INFO"
27 | # Enable or disable the use of IPv6 networking on the device
28 | ipv6_enable: "false"
29 | # Hide the ENERGY sensor that shows kWh consumed, but with no time period associated with it. Resets when device restarted and reflashed.
30 | hide_energy_sensor: "false"
31 | # Specifies whether pins should be initialised as early as possible to known values. Recommended value is false where switches are involved, as these will toggle when updating the firmware or when restarting the device. Defaults to true.
32 | early_pin_init: "true"
33 | # Power plug icon selection. Change to reflect the type/country of powr plug in use, this will update the power plug icon shown next to the switch
34 | power_plug_type: "power-socket-us" # Options: power-socket-au | power-socket-ch | power-socket-de | power-socket-eu | power-socket-fr | power-socket-it | power-socket-jp | power-socket-uk | power-socket-us |
35 |
36 |
37 | ########################## End of Substitutions #########################
38 |
39 | esphome:
40 | name: "${name}"
41 | friendly_name: "${friendly_name}"
42 | comment: "${device_description}"
43 | area: "${room}"
44 | name_add_mac_suffix: true
45 | min_version: 2024.6.0
46 | project:
47 | name: "${project_name}"
48 | version: "${project_version}"
49 | on_boot:
50 | - priority: 600
51 | then:
52 | - select.set_index:
53 | id: power_mode
54 | index: !lambda |-
55 | return id(restore_mode)-1;
56 | - lambda: |-
57 | switch(id(restore_mode))
58 | {
59 | case 1:{
60 | id(relay).turn_off();
61 | break;
62 | }
63 | case 2:{
64 | id(relay).turn_on();
65 | break;
66 | }
67 | default:{
68 | break;
69 | }
70 | }
71 |
72 | esp8266:
73 | board: esp8285
74 | restore_from_flash: true
75 | early_pin_init: ${early_pin_init}
76 |
77 | preferences:
78 | flash_write_interval: 5min
79 |
80 | api:
81 |
82 | ota:
83 | - platform: esphome
84 |
85 | logger:
86 | level: ${log_level}
87 | baud_rate: 0
88 |
89 | mdns:
90 | disabled: false
91 |
92 | web_server:
93 | port: 80
94 | # version: 3
95 |
96 | network:
97 | enable_ipv6: ${ipv6_enable}
98 |
99 | wifi:
100 | # This spawns an AP with the device name and mac address with no password.
101 | ap: {}
102 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
103 | fast_connect: "${wifi_fast_connect}"
104 | # Define dns domain / suffix to add to hostname
105 | domain: "${dns_domain}"
106 |
107 | captive_portal:
108 |
109 | dashboard_import:
110 | package_import_url: github://athom-tech/athom-configs/athom-smart-plug-v2.yaml
111 |
112 | # Dentra Components - Adds 'Platform - Energy Statistics'
113 | # https://github.com/dentra/esphome-components/tree/master/components/energy_statistics
114 | # external_components:
115 | # - source: github://dentra/esphome-components
116 |
117 | uart:
118 | rx_pin: RX
119 | baud_rate: 4800
120 | parity: EVEN
121 |
122 | globals:
123 | - id: total_energy
124 | type: float
125 | restore_value: yes
126 | initial_value: '0.0'
127 | - id: restore_mode
128 | type: int
129 | restore_value: yes
130 | initial_value: "2" # 0 = Always_Off. 1 = Restore_Power_Off. 2 = Always_On.
131 |
132 | select:
133 | - platform: template
134 | name: "Power On State"
135 | id: "power_mode"
136 | optimistic: true
137 | icon: mdi:electric-switch
138 | options:
139 | - Always Off
140 | - Always On
141 | - Restore Power Off State
142 | on_value:
143 | then:
144 | - lambda: |-
145 | id(restore_mode)=i+1;
146 |
147 | binary_sensor:
148 | - platform: status
149 | name: "Status"
150 | icon: mdi:check-network-outline
151 | entity_category: diagnostic
152 |
153 | - platform: gpio
154 | pin:
155 | number: 5
156 | mode: INPUT_PULLUP
157 | inverted: true
158 | id: power_button
159 | name: "Power Button"
160 | disabled_by_default: true
161 | on_multi_click:
162 | - timing:
163 | - ON for at most 1s
164 | - OFF for at least 0.2s
165 | then:
166 | - switch.toggle: relay
167 | - timing:
168 | - ON for at least 4s
169 | then:
170 | - button.press: Reset
171 |
172 | sensor:
173 | - platform: uptime
174 | name: "Uptime Sensor"
175 | id: uptime_sensor
176 | entity_category: diagnostic
177 | internal: true
178 |
179 | # Reports the WiFi signal strength/RSSI in dB
180 | - platform: wifi_signal
181 | name: "WiFi Signal dB"
182 | id: wifi_signal_db
183 | update_interval: 60s
184 | entity_category: diagnostic
185 |
186 | # Reports the WiFi signal strength in %
187 | - platform: copy
188 | source_id: wifi_signal_db
189 | name: "WiFi Signal Percent"
190 | filters:
191 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
192 | unit_of_measurement: "%"
193 | entity_category: diagnostic
194 | device_class: ""
195 |
196 | - platform: cse7766
197 | id: athom_cse7766
198 | current:
199 | name: "Current"
200 | icon: mdi:current-ac
201 | filters:
202 | - throttle_average: ${sensor_update_interval}
203 | - lambda: if (x < 0.060) return 0.0; else return x; #For the chip will report less than 3w power when no load is connected
204 | on_value_range:
205 | - above: ${current_limit}
206 | then:
207 | - switch.turn_off: relay
208 |
209 | voltage:
210 | name: "Voltage"
211 | icon: mdi:sine-wave
212 | filters:
213 | - throttle_average: ${sensor_update_interval}
214 |
215 | power:
216 | name: "Power"
217 | id: power_sensor
218 | icon: mdi:power
219 | filters:
220 | - throttle_average: ${sensor_update_interval}
221 | - lambda: if (x < 3.0) return 0.0; else return x; #For the chip will report less than 3w power when no load is connected
222 |
223 | energy:
224 | name: "Energy"
225 | id: energy
226 | icon: mdi:lightning-bolt
227 | unit_of_measurement: kWh
228 | internal: ${hide_energy_sensor}
229 | filters:
230 | - throttle: ${sensor_update_interval}
231 | # Multiplication factor from W to kW is 0.001
232 | - multiply: 0.001
233 | on_value:
234 | then:
235 | - lambda: |-
236 | static float previous_energy_value = 0.0;
237 | float current_energy_value = id(energy).state;
238 | id(total_energy) += current_energy_value - previous_energy_value;
239 | previous_energy_value = current_energy_value;
240 | id(total_energy_sensor).update();
241 |
242 |
243 | apparent_power:
244 | name: "Apparent Power"
245 | icon: mdi:power
246 | filters:
247 | - throttle_average: ${sensor_update_interval}
248 |
249 | reactive_power:
250 | name: "Reactive Power"
251 | icon: mdi:flash
252 | filters:
253 | - throttle_average: ${sensor_update_interval}
254 |
255 | power_factor:
256 | name: "Power Factor"
257 | icon: mdi:percent-outline
258 | filters:
259 | - throttle_average: ${sensor_update_interval}
260 |
261 | - platform: template
262 | name: "Total Energy"
263 | id: total_energy_sensor
264 | unit_of_measurement: kWh
265 | device_class: "energy"
266 | state_class: "total_increasing"
267 | icon: mdi:lightning-bolt
268 | accuracy_decimals: 3
269 | lambda: |-
270 | return id(total_energy);
271 | update_interval: ${sensor_update_interval}
272 |
273 | - platform: total_daily_energy
274 | name: "Total Energy Since Boot"
275 | restore: true
276 | power_id: power_sensor
277 | unit_of_measurement: kWh
278 | icon: mdi:hours-24
279 | accuracy_decimals: 3
280 | filters:
281 | - multiply: 0.001
282 |
283 | # # Dentra Components - Define the id of the sensor providing 'Total Energy' used
284 | # - platform: "energy_statistics"
285 | # total: total_energy_sensor
286 |
287 | # # Dentra Components - Adds Energy Today. Persistents if restarted, unlike 'total_daily_energy'
288 | # energy_today:
289 | # name: "Energy Today"
290 | # id: total_energy_today
291 | # accuracy_decimals: 3
292 | # icon: mdi:hours-24
293 |
294 | # # Dentra Components - Adds Energy Yesterday
295 | # energy_yesterday:
296 | # name: "Total Energy Yesterday"
297 | # id: total_energy_yesterday
298 | # icon: mdi:calendar-today
299 | # accuracy_decimals: 3
300 |
301 | # # Dentra Components - Adds Energy Week
302 | # energy_week:
303 | # name: "Total Energy Week"
304 | # id: total_energy_week
305 | # icon: mdi:calendar-week
306 | # accuracy_decimals: 3
307 |
308 | # # Dentra Components - Adds Energy Month
309 | # energy_month:
310 | # name: "Total Energy Month"
311 | # id: total_energy_month
312 | # accuracy_decimals: 3
313 | # icon: mdi:calendar-month
314 |
315 | button:
316 | - platform: restart
317 | name: "Restart"
318 | entity_category: config
319 |
320 | - platform: factory_reset
321 | name: "Factory Reset"
322 | id: Reset
323 | entity_category: config
324 |
325 | - platform: safe_mode
326 | name: "Safe Mode"
327 | internal: false
328 | entity_category: config
329 |
330 | switch:
331 | - platform: gpio
332 | name: "Switch"
333 | pin: GPIO12
334 | id: relay
335 | restore_mode: ${relay_restore_mode}
336 | icon: mdi:${power_plug_type}
337 |
338 | light:
339 | - platform: status_led
340 | name: "Status LED"
341 | id: blue_led
342 | icon: mdi:lightbulb-outline
343 | disabled_by_default: true
344 | pin:
345 | inverted: true
346 | number: GPIO13
347 |
348 | text_sensor:
349 | - platform: wifi_info
350 | ip_address:
351 | name: "IP Address"
352 | icon: mdi:ip-network
353 | entity_category: diagnostic
354 | ssid:
355 | name: "Connected SSID"
356 | icon: mdi:wifi-strength-2
357 | entity_category: diagnostic
358 | mac_address:
359 | name: "Mac Address"
360 | icon: mdi:network-pos
361 | entity_category: diagnostic
362 |
363 | # Creates a sensor showing when the device was last restarted
364 | - platform: template
365 | name: 'Last Restart'
366 | id: device_last_restart
367 | icon: mdi:clock
368 | entity_category: diagnostic
369 | # device_class: timestamp
370 |
371 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
372 | - platform: template
373 | name: "Uptime"
374 | entity_category: diagnostic
375 | lambda: |-
376 | int seconds = (id(uptime_sensor).state);
377 | int days = seconds / (24 * 3600);
378 | seconds = seconds % (24 * 3600);
379 | int hours = seconds / 3600;
380 | seconds = seconds % 3600;
381 | int minutes = seconds / 60;
382 | seconds = seconds % 60;
383 | if ( days > 3650 ) {
384 | return { "Starting up" };
385 | } else if ( days ) {
386 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
387 | } else if ( hours ) {
388 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
389 | } else if ( minutes ) {
390 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
391 | } else {
392 | return { (String(seconds) +"s").c_str() };
393 | }
394 | icon: mdi:clock-start
395 |
396 | time:
397 | - platform: sntp
398 | id: sntp_time
399 | # Define the timezone of the device
400 | timezone: "${timezone}"
401 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
402 | update_interval: ${sntp_update_interval}
403 | # Set specific sntp servers to use
404 | servers:
405 | - "${sntp_server_1}"
406 | - "${sntp_server_2}"
407 | - "${sntp_server_3}"
408 | # Publish the time the device was last restarted
409 | on_time_sync:
410 | then:
411 | # Update last restart time, but only once.
412 | - if:
413 | condition:
414 | lambda: 'return id(device_last_restart).state == "";'
415 | then:
416 | - text_sensor.template.publish:
417 | id: device_last_restart
418 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
419 |
--------------------------------------------------------------------------------
/athom-sw01-v2.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-1gang-switch-v2"
4 | # Default friendly name
5 | friendly_name: "1Gang Switch"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom 1gang switch v2"
10 | # Project Name
11 | project_name: "Athom Technology.1Gang Switch V2"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | light_restore_mode: RESTORE_DEFAULT_OFF
16 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
17 | dns_domain: ".local"
18 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
19 | timezone: ""
20 | # Set the duration between the sntp service polling ntp.org servers for an update
21 | sntp_update_interval: 6h
22 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
23 | sntp_server_1: "0.pool.ntp.org"
24 | sntp_server_2: "1.pool.ntp.org"
25 | sntp_server_3: "2.pool.ntp.org"
26 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
27 | wifi_fast_connect: "false"
28 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
29 | log_level: "DEBUG"
30 | # Enable or disable the use of IPv6 networking on the device
31 | ipv6_enable: "false"
32 |
33 | esphome:
34 | name: "${name}"
35 | friendly_name: "${friendly_name}"
36 | comment: "${device_description}"
37 | area: "${room}"
38 | name_add_mac_suffix: true
39 | min_version: 2024.6.0
40 | project:
41 | name: "${project_name}"
42 | version: "${project_version}"
43 | on_boot:
44 | - priority: 600
45 | then:
46 | - select.set_index:
47 | id: power_mode
48 | index: !lambda |-
49 | return id(restore_mode)-1;
50 | - lambda: |-
51 | switch(id(restore_mode))
52 | {
53 | case 1:{
54 | id(light1).turn_off();
55 | break;
56 | }
57 | case 2:{
58 | id(light1).turn_on();
59 | break;
60 | }
61 | default:{
62 | break;
63 | }
64 | }
65 |
66 | esp8266:
67 | board: esp8285
68 | restore_from_flash: true
69 |
70 | preferences:
71 | flash_write_interval: 1min
72 |
73 | api:
74 |
75 | ota:
76 | - platform: esphome
77 |
78 | logger:
79 | level: ${log_level}
80 | baud_rate: 115200
81 |
82 | mdns:
83 | disabled: false
84 |
85 | web_server:
86 | port: 80
87 |
88 | network:
89 | enable_ipv6: ${ipv6_enable}
90 |
91 | wifi:
92 | # This spawns an AP with the device name and mac address with no password.
93 | ap: {}
94 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
95 | fast_connect: "${wifi_fast_connect}"
96 | # Define dns domain / suffix to add to hostname
97 | domain: "${dns_domain}"
98 |
99 | captive_portal:
100 |
101 | dashboard_import:
102 | package_import_url: github://athom-tech/athom-configs/athom-sw01-v2.yaml
103 |
104 | globals:
105 | - id: restore_mode
106 | type: int
107 | restore_value: yes
108 | initial_value: "3"
109 |
110 | select:
111 | - platform: template
112 | name: "Power On State"
113 | id: "power_mode"
114 | optimistic: true
115 | options:
116 | - Always Off
117 | - Always On
118 | - Restore Power Off State
119 | on_value:
120 | then:
121 | - lambda: |-
122 | id(restore_mode)=i+1;
123 |
124 | binary_sensor:
125 | - platform: status
126 | name: "Status"
127 | entity_category: diagnostic
128 |
129 | # Touch Button
130 | - platform: gpio
131 | pin:
132 | inverted: true
133 | number: GPIO3
134 | mode:
135 | input: true
136 | pullup: true
137 | name: "Button"
138 | id: button1
139 | disabled_by_default: true
140 | on_multi_click:
141 | - timing:
142 | - ON for at most 0.5s
143 | - OFF for at least 0.2s
144 | then:
145 | - light.toggle: light1
146 | - timing:
147 | - ON for at least 4s
148 | then:
149 | - button.press: Reset
150 |
151 | sensor:
152 | - platform: uptime
153 | name: "Uptime Sensor"
154 | id: uptime_sensor
155 | entity_category: diagnostic
156 | internal: true
157 |
158 | - platform: wifi_signal
159 | name: "WiFi Signal dB"
160 | id: wifi_signal_db
161 | update_interval: 60s
162 | entity_category: "diagnostic"
163 |
164 | - platform: copy
165 | source_id: wifi_signal_db
166 | name: "WiFi Signal Percent"
167 | filters:
168 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
169 | unit_of_measurement: "Signal %"
170 | entity_category: "diagnostic"
171 | device_class: ""
172 |
173 | button:
174 | - platform: restart
175 | name: "Restart"
176 | entity_category: config
177 |
178 | - platform: factory_reset
179 | name: "Factory Reset"
180 | id: Reset
181 | entity_category: config
182 |
183 | - platform: safe_mode
184 | name: "Safe Mode"
185 | internal: false
186 | entity_category: config
187 |
188 | output:
189 | # Relay
190 | - platform: gpio
191 | pin: GPIO13
192 | id: relay1
193 |
194 | # Button LED (1.0 = Blue / 0.0 = Red)
195 | - platform: esp8266_pwm
196 | pin: GPIO16
197 | inverted: true
198 | id: button_led1
199 |
200 | light:
201 | - platform: status_led
202 | name: "Status LED"
203 | disabled_by_default: true
204 | pin:
205 | number: GPIO0
206 | inverted: true
207 |
208 | # Relay
209 | - platform: binary
210 | name: "Light"
211 | id: light1
212 | output: relay1
213 | restore_mode: ${light_restore_mode}
214 | on_turn_on:
215 | - light.turn_on: led1
216 | on_turn_off:
217 | - light.turn_off: led1
218 |
219 | # Button LED
220 | - platform: monochromatic
221 | name: "LED"
222 | disabled_by_default: true
223 | id: led1
224 | output: button_led1
225 | default_transition_length: 500ms
226 |
227 | text_sensor:
228 | - platform: wifi_info
229 | ip_address:
230 | name: "IP Address"
231 | entity_category: diagnostic
232 | ssid:
233 | name: "Connected SSID"
234 | entity_category: diagnostic
235 | mac_address:
236 | name: "Mac Address"
237 | entity_category: diagnostic
238 |
239 | # Creates a sensor showing when the device was last restarted
240 | - platform: template
241 | name: 'Last Restart'
242 | id: device_last_restart
243 | icon: mdi:clock
244 | entity_category: diagnostic
245 | # device_class: timestamp
246 |
247 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
248 | - platform: template
249 | name: "Uptime"
250 | entity_category: diagnostic
251 | lambda: |-
252 | int seconds = (id(uptime_sensor).state);
253 | int days = seconds / (24 * 3600);
254 | seconds = seconds % (24 * 3600);
255 | int hours = seconds / 3600;
256 | seconds = seconds % 3600;
257 | int minutes = seconds / 60;
258 | seconds = seconds % 60;
259 | if ( days > 3650 ) {
260 | return { "Starting up" };
261 | } else if ( days ) {
262 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
263 | } else if ( hours ) {
264 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
265 | } else if ( minutes ) {
266 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
267 | } else {
268 | return { (String(seconds) +"s").c_str() };
269 | }
270 | icon: mdi:clock-start
271 |
272 | time:
273 | - platform: sntp
274 | id: sntp_time
275 | # Define the timezone of the device
276 | timezone: "${timezone}"
277 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
278 | update_interval: ${sntp_update_interval}
279 | # Set specific sntp servers to use
280 | servers:
281 | - "${sntp_server_1}"
282 | - "${sntp_server_2}"
283 | - "${sntp_server_3}"
284 | # Publish the time the device was last restarted
285 | on_time_sync:
286 | then:
287 | # Update last restart time, but only once.
288 | - if:
289 | condition:
290 | lambda: 'return id(device_last_restart).state == "";'
291 | then:
292 | - text_sensor.template.publish:
293 | id: device_last_restart
294 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
295 |
--------------------------------------------------------------------------------
/athom-sw01.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-1gang-switch"
4 | # Default friendly name
5 | friendly_name: "1Gang Switch"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom 1gang switch"
10 | # Project Name
11 | project_name: "Athom Technology.1Gang Switch"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | light_restore_mode: RESTORE_DEFAULT_OFF
16 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
17 | dns_domain: ".local"
18 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
19 | timezone: ""
20 | # Set the duration between the sntp service polling ntp.org servers for an update
21 | sntp_update_interval: 6h
22 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
23 | sntp_server_1: "0.pool.ntp.org"
24 | sntp_server_2: "1.pool.ntp.org"
25 | sntp_server_3: "2.pool.ntp.org"
26 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
27 | wifi_fast_connect: "false"
28 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
29 | log_level: "DEBUG"
30 | # Enable or disable the use of IPv6 networking on the device
31 | ipv6_enable: "false"
32 |
33 | esphome:
34 | name: "${name}"
35 | friendly_name: "${friendly_name}"
36 | comment: "${device_description}"
37 | area: "${room}"
38 | name_add_mac_suffix: true
39 | min_version: 2024.6.0
40 | project:
41 | name: "${project_name}"
42 | version: "${project_version}"
43 | on_boot:
44 | - priority: 600
45 | then:
46 | - select.set_index:
47 | id: power_mode
48 | index: !lambda |-
49 | return id(restore_mode)-1;
50 | - lambda: |-
51 | switch(id(restore_mode))
52 | {
53 | case 1:{
54 | id(light1).turn_off();
55 | break;
56 | }
57 | case 2:{
58 | id(light1).turn_on();
59 | break;
60 | }
61 | default:{
62 | break;
63 | }
64 | }
65 |
66 | esp8266:
67 | board: esp8285
68 | restore_from_flash: true
69 |
70 | preferences:
71 | flash_write_interval: 1min
72 |
73 | api:
74 |
75 | ota:
76 | - platform: esphome
77 |
78 | logger:
79 | level: ${log_level}
80 | baud_rate: 115200
81 |
82 | mdns:
83 | disabled: false
84 |
85 | web_server:
86 | port: 80
87 |
88 | network:
89 | enable_ipv6: ${ipv6_enable}
90 |
91 | wifi:
92 | # This spawns an AP with the device name and mac address with no password.
93 | ap: {}
94 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
95 | fast_connect: "${wifi_fast_connect}"
96 | # Define dns domain / suffix to add to hostname
97 | domain: "${dns_domain}"
98 |
99 | captive_portal:
100 |
101 | dashboard_import:
102 | package_import_url: github://athom-tech/athom-configs/athom-sw01.yaml
103 |
104 | globals:
105 | - id: restore_mode
106 | type: int
107 | restore_value: yes
108 | initial_value: "3"
109 |
110 | select:
111 | - platform: template
112 | name: "Power On State"
113 | id: "power_mode"
114 | optimistic: true
115 | options:
116 | - Always Off
117 | - Always On
118 | - Restore Power Off State
119 | on_value:
120 | then:
121 | - lambda: |-
122 | id(restore_mode)=i+1;
123 |
124 | binary_sensor:
125 | - platform: status
126 | name: "Status"
127 | entity_category: diagnostic
128 |
129 | # Touch Button
130 | - platform: gpio
131 | pin:
132 | inverted: true
133 | number: GPIO3
134 | mode:
135 | input: true
136 | pullup: true
137 | name: "Button"
138 | id: button1
139 | disabled_by_default: true
140 | on_multi_click:
141 | - timing:
142 | - ON for at most 0.5s
143 | - OFF for at least 0.2s
144 | then:
145 | - light.toggle: light1
146 | - timing:
147 | - ON for at least 4s
148 | then:
149 | - button.press: Reset
150 |
151 | sensor:
152 | - platform: uptime
153 | name: "Uptime Sensor"
154 | id: uptime_sensor
155 | entity_category: diagnostic
156 | internal: true
157 |
158 | - platform: wifi_signal
159 | name: "WiFi Signal dB"
160 | id: wifi_signal_db
161 | update_interval: 60s
162 | entity_category: "diagnostic"
163 |
164 | - platform: copy
165 | source_id: wifi_signal_db
166 | name: "WiFi Signal Percent"
167 | filters:
168 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
169 | unit_of_measurement: "Signal %"
170 | entity_category: "diagnostic"
171 | device_class: ""
172 |
173 | button:
174 | - platform: restart
175 | name: "Restart"
176 | entity_category: config
177 |
178 | - platform: factory_reset
179 | name: "Factory Reset"
180 | id: Reset
181 | entity_category: config
182 |
183 | - platform: safe_mode
184 | name: "Safe Mode"
185 | internal: false
186 | entity_category: config
187 |
188 | output:
189 | # Relay
190 | - platform: gpio
191 | pin: GPIO13
192 | id: relay1
193 |
194 | # Button LED (1.0 = Blue / 0.0 = Red)
195 | - platform: esp8266_pwm
196 | pin: GPIO14
197 | inverted: true
198 | id: button_led1
199 |
200 | light:
201 | - platform: status_led
202 | name: "Status LED"
203 | disabled_by_default: true
204 | pin:
205 | number: GPIO0
206 | inverted: true
207 |
208 | # Relay
209 | - platform: binary
210 | name: "Light"
211 | id: light1
212 | output: relay1
213 | restore_mode: ${light_restore_mode}
214 | on_turn_on:
215 | - light.turn_on: led1
216 | on_turn_off:
217 | - light.turn_off: led1
218 |
219 | # Button LED
220 | - platform: monochromatic
221 | name: "LED"
222 | disabled_by_default: true
223 | id: led1
224 | output: button_led1
225 | default_transition_length: 500ms
226 |
227 | text_sensor:
228 | - platform: wifi_info
229 | ip_address:
230 | name: "IP Address"
231 | entity_category: diagnostic
232 | ssid:
233 | name: "Connected SSID"
234 | entity_category: diagnostic
235 | mac_address:
236 | name: "Mac Address"
237 | entity_category: diagnostic
238 |
239 | # Creates a sensor showing when the device was last restarted
240 | - platform: template
241 | name: 'Last Restart'
242 | id: device_last_restart
243 | icon: mdi:clock
244 | entity_category: diagnostic
245 | # device_class: timestamp
246 |
247 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
248 | - platform: template
249 | name: "Uptime"
250 | entity_category: diagnostic
251 | lambda: |-
252 | int seconds = (id(uptime_sensor).state);
253 | int days = seconds / (24 * 3600);
254 | seconds = seconds % (24 * 3600);
255 | int hours = seconds / 3600;
256 | seconds = seconds % 3600;
257 | int minutes = seconds / 60;
258 | seconds = seconds % 60;
259 | if ( days > 3650 ) {
260 | return { "Starting up" };
261 | } else if ( days ) {
262 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
263 | } else if ( hours ) {
264 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
265 | } else if ( minutes ) {
266 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
267 | } else {
268 | return { (String(seconds) +"s").c_str() };
269 | }
270 | icon: mdi:clock-start
271 |
272 | time:
273 | - platform: sntp
274 | id: sntp_time
275 | # Define the timezone of the device
276 | timezone: "${timezone}"
277 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
278 | update_interval: ${sntp_update_interval}
279 | # Set specific sntp servers to use
280 | servers:
281 | - "${sntp_server_1}"
282 | - "${sntp_server_2}"
283 | - "${sntp_server_3}"
284 | # Publish the time the device was last restarted
285 | on_time_sync:
286 | then:
287 | # Update last restart time, but only once.
288 | - if:
289 | condition:
290 | lambda: 'return id(device_last_restart).state == "";'
291 | then:
292 | - text_sensor.template.publish:
293 | id: device_last_restart
294 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
295 |
--------------------------------------------------------------------------------
/athom-sw02-v2.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-2gang-switch-v2"
4 | # Default friendly name
5 | friendly_name: "2Gang Switch V2"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom 2gang switch v2"
10 | # Project Name
11 | project_name: "Athom Technology.2Gang Switch V2"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | light1_restore_mode: RESTORE_DEFAULT_OFF
16 | light2_restore_mode: RESTORE_DEFAULT_OFF
17 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
18 | dns_domain: ".local"
19 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
20 | timezone: ""
21 | # Set the duration between the sntp service polling ntp.org servers for an update
22 | sntp_update_interval: 6h
23 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
24 | sntp_server_1: "0.pool.ntp.org"
25 | sntp_server_2: "1.pool.ntp.org"
26 | sntp_server_3: "2.pool.ntp.org"
27 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
28 | wifi_fast_connect: "false"
29 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
30 | log_level: "DEBUG"
31 | # Enable or disable the use of IPv6 networking on the device
32 | ipv6_enable: "false"
33 |
34 | esphome:
35 | name: "${name}"
36 | friendly_name: "${friendly_name}"
37 | comment: "${device_description}"
38 | area: "${room}"
39 | name_add_mac_suffix: true
40 | min_version: 2024.6.0
41 | project:
42 | name: "${project_name}"
43 | version: "${project_version}"
44 | on_boot:
45 | - priority: 600
46 | then:
47 | - select.set_index:
48 | id: power_mode
49 | index: !lambda |-
50 | return id(restore_mode)-1;
51 | - lambda: |-
52 | switch(id(restore_mode))
53 | {
54 | case 1:{
55 | id(light1).turn_off();
56 | id(light2).turn_off();
57 | break;
58 | }
59 | case 2:{
60 | id(light1).turn_on();
61 | id(light2).turn_on();
62 | break;
63 | }
64 | default:{
65 | break;
66 | }
67 | }
68 |
69 | esp8266:
70 | board: esp8285
71 | restore_from_flash: true
72 |
73 | preferences:
74 | flash_write_interval: 1min
75 |
76 | api:
77 |
78 | ota:
79 | - platform: esphome
80 |
81 | logger:
82 | level: ${log_level}
83 | baud_rate: 115200
84 |
85 | mdns:
86 | disabled: false
87 |
88 | web_server:
89 | port: 80
90 |
91 | network:
92 | enable_ipv6: ${ipv6_enable}
93 |
94 | wifi:
95 | # This spawns an AP with the device name and mac address with no password.
96 | ap: {}
97 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
98 | fast_connect: "${wifi_fast_connect}"
99 | # Define dns domain / suffix to add to hostname
100 | domain: "${dns_domain}"
101 |
102 | captive_portal:
103 |
104 | dashboard_import:
105 | package_import_url: github://athom-tech/athom-configs/athom-sw02-v2.yaml
106 |
107 | globals:
108 | - id: restore_mode
109 | type: int
110 | restore_value: yes
111 | initial_value: "3"
112 |
113 | select:
114 | - platform: template
115 | name: "Power On State"
116 | id: "power_mode"
117 | optimistic: true
118 | options:
119 | - Always Off
120 | - Always On
121 | - Restore Power Off State
122 | on_value:
123 | then:
124 | - lambda: |-
125 | id(restore_mode)=i+1;
126 |
127 | binary_sensor:
128 | - platform: status
129 | name: "Status"
130 | entity_category: diagnostic
131 |
132 | # Touch Buttons
133 | - platform: gpio
134 | pin:
135 | inverted: true
136 | number: GPIO3
137 | mode:
138 | input: true
139 | pullup: true
140 | name: "Button1"
141 | id: button1
142 | disabled_by_default: true
143 | on_multi_click:
144 | - timing:
145 | - ON for at most 0.5s
146 | - OFF for at least 0.2s
147 | then:
148 | - light.toggle: light1
149 | - timing:
150 | - ON for at least 4s
151 | then:
152 | - button.press: Reset
153 |
154 | - platform: gpio
155 | pin:
156 | inverted: true
157 | number: GPIO5
158 | mode:
159 | input: true
160 | pullup: true
161 | name: "Button2"
162 | id: button2
163 | disabled_by_default: true
164 | on_click:
165 | max_length: 0.5s
166 | then:
167 | - light.toggle: light2
168 |
169 | sensor:
170 | - platform: uptime
171 | name: "Uptime Sensor"
172 | id: uptime_sensor
173 | entity_category: diagnostic
174 | internal: true
175 |
176 | - platform: wifi_signal
177 | name: "WiFi Signal dB"
178 | id: wifi_signal_db
179 | update_interval: 60s
180 | entity_category: "diagnostic"
181 |
182 | - platform: copy
183 | source_id: wifi_signal_db
184 | name: "WiFi Signal Percent"
185 | filters:
186 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
187 | unit_of_measurement: "Signal %"
188 | entity_category: "diagnostic"
189 | device_class: ""
190 |
191 | button:
192 | - platform: restart
193 | name: "Restart"
194 | entity_category: config
195 |
196 | - platform: factory_reset
197 | name: "Factory Reset"
198 | id: Reset
199 | entity_category: config
200 |
201 | - platform: safe_mode
202 | name: "Safe Mode"
203 | internal: false
204 | entity_category: config
205 |
206 | output:
207 | # Relays
208 | - platform: gpio
209 | pin: GPIO13
210 | id: relay1
211 | - platform: gpio
212 | pin: GPIO4
213 | id: relay2
214 |
215 | # - platform: gpio
216 | # pin: GPIO16
217 | # id: io16
218 |
219 | # Button LEDs (1.0 = Blue / 0.0 = Red)
220 | - platform: esp8266_pwm
221 | pin: GPIO16
222 | inverted: true
223 | id: button_led1
224 | - platform: esp8266_pwm
225 | pin: GPIO1
226 | inverted: true
227 | id: button_led2
228 |
229 | light:
230 | - platform: status_led
231 | name: "Status LED"
232 | disabled_by_default: true
233 | pin:
234 | number: GPIO0
235 | inverted: true
236 |
237 | # Relays
238 | - platform: binary
239 | name: "Light1"
240 | id: light1
241 | output: relay1
242 | restore_mode: ${light1_restore_mode}
243 | on_turn_on:
244 | - light.turn_on: led1
245 | on_turn_off:
246 | - light.turn_off: led1
247 |
248 | - platform: binary
249 | name: "Light2"
250 | id: light2
251 | output: relay2
252 | restore_mode: ${light2_restore_mode}
253 | on_turn_on:
254 | - light.turn_on: led2
255 | on_turn_off:
256 | - light.turn_off: led2
257 |
258 | # Button LEDs
259 | - platform: monochromatic
260 | name: "LED1"
261 | disabled_by_default: true
262 | id: led1
263 | output: button_led1
264 | default_transition_length: 500ms
265 |
266 | - platform: monochromatic
267 | name: "LED2"
268 | disabled_by_default: true
269 | id: led2
270 | output: button_led2
271 | default_transition_length: 500ms
272 |
273 | text_sensor:
274 | - platform: wifi_info
275 | ip_address:
276 | name: "IP Address"
277 | entity_category: diagnostic
278 | ssid:
279 | name: "Connected SSID"
280 | entity_category: diagnostic
281 | mac_address:
282 | name: "Mac Address"
283 | entity_category: diagnostic
284 |
285 | # Creates a sensor showing when the device was last restarted
286 | - platform: template
287 | name: 'Last Restart'
288 | id: device_last_restart
289 | icon: mdi:clock
290 | entity_category: diagnostic
291 | # device_class: timestamp
292 |
293 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
294 | - platform: template
295 | name: "Uptime"
296 | entity_category: diagnostic
297 | lambda: |-
298 | int seconds = (id(uptime_sensor).state);
299 | int days = seconds / (24 * 3600);
300 | seconds = seconds % (24 * 3600);
301 | int hours = seconds / 3600;
302 | seconds = seconds % 3600;
303 | int minutes = seconds / 60;
304 | seconds = seconds % 60;
305 | if ( days > 3650 ) {
306 | return { "Starting up" };
307 | } else if ( days ) {
308 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
309 | } else if ( hours ) {
310 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
311 | } else if ( minutes ) {
312 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
313 | } else {
314 | return { (String(seconds) +"s").c_str() };
315 | }
316 | icon: mdi:clock-start
317 |
318 | time:
319 | - platform: sntp
320 | id: sntp_time
321 | # Define the timezone of the device
322 | timezone: "${timezone}"
323 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
324 | update_interval: ${sntp_update_interval}
325 | # Set specific sntp servers to use
326 | servers:
327 | - "${sntp_server_1}"
328 | - "${sntp_server_2}"
329 | - "${sntp_server_3}"
330 | # Publish the time the device was last restarted
331 | on_time_sync:
332 | then:
333 | # Update last restart time, but only once.
334 | - if:
335 | condition:
336 | lambda: 'return id(device_last_restart).state == "";'
337 | then:
338 | - text_sensor.template.publish:
339 | id: device_last_restart
340 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
341 |
--------------------------------------------------------------------------------
/athom-sw02.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-2gang-switch"
4 | # Default friendly name
5 | friendly_name: "2Gang Switch"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom 2gang switch"
10 | # Project Name
11 | project_name: "Athom Technology.2Gang Switch"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | light1_restore_mode: RESTORE_DEFAULT_OFF
16 | light2_restore_mode: RESTORE_DEFAULT_OFF
17 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
18 | dns_domain: ".local"
19 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
20 | timezone: ""
21 | # Set the duration between the sntp service polling ntp.org servers for an update
22 | sntp_update_interval: 6h
23 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
24 | sntp_server_1: "0.pool.ntp.org"
25 | sntp_server_2: "1.pool.ntp.org"
26 | sntp_server_3: "2.pool.ntp.org"
27 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
28 | wifi_fast_connect: "false"
29 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
30 | log_level: "DEBUG"
31 | # Enable or disable the use of IPv6 networking on the device
32 | ipv6_enable: "false"
33 |
34 | esphome:
35 | name: "${name}"
36 | friendly_name: "${friendly_name}"
37 | comment: "${device_description}"
38 | area: "${room}"
39 | name_add_mac_suffix: true
40 | min_version: 2024.6.0
41 | project:
42 | name: "${project_name}"
43 | version: "${project_version}"
44 | on_boot:
45 | - priority: 600
46 | then:
47 | - select.set_index:
48 | id: power_mode
49 | index: !lambda |-
50 | return id(restore_mode)-1;
51 | - lambda: |-
52 | switch(id(restore_mode))
53 | {
54 | case 1:{
55 | id(light1).turn_off();
56 | id(light2).turn_off();
57 | break;
58 | }
59 | case 2:{
60 | id(light1).turn_on();
61 | id(light2).turn_on();
62 | break;
63 | }
64 | default:{
65 | break;
66 | }
67 | }
68 |
69 | esp8266:
70 | board: esp8285
71 | restore_from_flash: true
72 |
73 | preferences:
74 | flash_write_interval: 1min
75 |
76 | api:
77 |
78 | ota:
79 | - platform: esphome
80 |
81 | logger:
82 | level: ${log_level}
83 | baud_rate: 115200
84 |
85 | mdns:
86 | disabled: false
87 |
88 | web_server:
89 | port: 80
90 |
91 | network:
92 | enable_ipv6: ${ipv6_enable}
93 |
94 | wifi:
95 | # This spawns an AP with the device name and mac address with no password.
96 | ap: {}
97 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
98 | fast_connect: "${wifi_fast_connect}"
99 | # Define dns domain / suffix to add to hostname
100 | domain: "${dns_domain}"
101 |
102 | captive_portal:
103 |
104 | dashboard_import:
105 | package_import_url: github://athom-tech/athom-configs/athom-sw02.yaml
106 |
107 | globals:
108 | - id: restore_mode
109 | type: int
110 | restore_value: yes
111 | initial_value: "3"
112 |
113 | select:
114 | - platform: template
115 | name: "Power On State"
116 | id: "power_mode"
117 | optimistic: true
118 | options:
119 | - Always Off
120 | - Always On
121 | - Restore Power Off State
122 | on_value:
123 | then:
124 | - lambda: |-
125 | id(restore_mode)=i+1;
126 |
127 | binary_sensor:
128 | - platform: status
129 | name: "Status"
130 | entity_category: diagnostic
131 |
132 | # Touch Buttons
133 | - platform: gpio
134 | pin:
135 | inverted: true
136 | number: GPIO3
137 | mode:
138 | input: true
139 | pullup: true
140 | name: "Button1"
141 | id: button1
142 | disabled_by_default: true
143 | on_multi_click:
144 | - timing:
145 | - ON for at most 0.5s
146 | - OFF for at least 0.2s
147 | then:
148 | - light.toggle: light1
149 | - timing:
150 | - ON for at least 4s
151 | then:
152 | - button.press: Reset
153 |
154 | - platform: gpio
155 | pin:
156 | inverted: true
157 | number: GPIO5
158 | mode:
159 | input: true
160 | pullup: true
161 | name: "Button2"
162 | id: button2
163 | disabled_by_default: true
164 | on_click:
165 | max_length: 0.5s
166 | then:
167 | - light.toggle: light2
168 |
169 | sensor:
170 | - platform: uptime
171 | name: "Uptime Sensor"
172 | id: uptime_sensor
173 | entity_category: diagnostic
174 | internal: true
175 |
176 | - platform: wifi_signal
177 | name: "WiFi Signal dB"
178 | id: wifi_signal_db
179 | update_interval: 60s
180 | entity_category: "diagnostic"
181 |
182 | - platform: copy
183 | source_id: wifi_signal_db
184 | name: "WiFi Signal Percent"
185 | filters:
186 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
187 | unit_of_measurement: "Signal %"
188 | entity_category: "diagnostic"
189 | device_class: ""
190 |
191 | button:
192 | - platform: restart
193 | name: "Restart"
194 | entity_category: config
195 |
196 | - platform: factory_reset
197 | name: "Factory Reset"
198 | id: Reset
199 | entity_category: config
200 |
201 | - platform: safe_mode
202 | name: "Safe Mode"
203 | internal: false
204 | entity_category: config
205 |
206 | output:
207 | # Relays
208 | - platform: gpio
209 | pin: GPIO13
210 | id: relay1
211 | - platform: gpio
212 | pin: GPIO4
213 | id: relay2
214 |
215 | # Button LEDs (1.0 = Blue / 0.0 = Red)
216 | - platform: esp8266_pwm
217 | pin: GPIO14
218 | inverted: true
219 | id: button_led1
220 | - platform: esp8266_pwm
221 | pin: GPIO1
222 | inverted: true
223 | id: button_led2
224 |
225 | light:
226 | - platform: status_led
227 | name: "Status LED"
228 | disabled_by_default: true
229 | pin:
230 | number: GPIO0
231 | inverted: true
232 |
233 | # Relays
234 | - platform: binary
235 | name: "Light1"
236 | id: light1
237 | output: relay1
238 | restore_mode: ${light1_restore_mode}
239 | on_turn_on:
240 | - light.turn_on: led1
241 | on_turn_off:
242 | - light.turn_off: led1
243 |
244 | - platform: binary
245 | name: "Light2"
246 | id: light2
247 | output: relay2
248 | restore_mode: ${light2_restore_mode}
249 | on_turn_on:
250 | - light.turn_on: led2
251 | on_turn_off:
252 | - light.turn_off: led2
253 |
254 | # Button LEDs
255 | - platform: monochromatic
256 | name: "LED1"
257 | disabled_by_default: true
258 | id: led1
259 | output: button_led1
260 | default_transition_length: 500ms
261 | - platform: monochromatic
262 | name: "LED2"
263 | disabled_by_default: true
264 | id: led2
265 | output: button_led2
266 | default_transition_length: 500ms
267 |
268 | text_sensor:
269 | - platform: wifi_info
270 | ip_address:
271 | name: "IP Address"
272 | entity_category: diagnostic
273 | ssid:
274 | name: "Connected SSID"
275 | entity_category: diagnostic
276 | mac_address:
277 | name: "Mac Address"
278 | entity_category: diagnostic
279 |
280 | # Creates a sensor showing when the device was last restarted
281 | - platform: template
282 | name: 'Last Restart'
283 | id: device_last_restart
284 | icon: mdi:clock
285 | entity_category: diagnostic
286 | # device_class: timestamp
287 |
288 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
289 | - platform: template
290 | name: "Uptime"
291 | entity_category: diagnostic
292 | lambda: |-
293 | int seconds = (id(uptime_sensor).state);
294 | int days = seconds / (24 * 3600);
295 | seconds = seconds % (24 * 3600);
296 | int hours = seconds / 3600;
297 | seconds = seconds % 3600;
298 | int minutes = seconds / 60;
299 | seconds = seconds % 60;
300 | if ( days > 3650 ) {
301 | return { "Starting up" };
302 | } else if ( days ) {
303 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
304 | } else if ( hours ) {
305 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
306 | } else if ( minutes ) {
307 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
308 | } else {
309 | return { (String(seconds) +"s").c_str() };
310 | }
311 | icon: mdi:clock-start
312 |
313 | time:
314 | - platform: sntp
315 | id: sntp_time
316 | # Define the timezone of the device
317 | timezone: "${timezone}"
318 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
319 | update_interval: ${sntp_update_interval}
320 | # Set specific sntp servers to use
321 | servers:
322 | - "${sntp_server_1}"
323 | - "${sntp_server_2}"
324 | - "${sntp_server_3}"
325 | # Publish the time the device was last restarted
326 | on_time_sync:
327 | then:
328 | # Update last restart time, but only once.
329 | - if:
330 | condition:
331 | lambda: 'return id(device_last_restart).state == "";'
332 | then:
333 | - text_sensor.template.publish:
334 | id: device_last_restart
335 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
336 |
--------------------------------------------------------------------------------
/athom-sw03.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-3gang-switch"
4 | # Default friendly name
5 | friendly_name: "3Gang Switch"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom 3gang switch"
10 | # Project Name
11 | project_name: "Athom Technology.3Gang Switch"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | light1_restore_mode: RESTORE_DEFAULT_OFF
16 | light2_restore_mode: RESTORE_DEFAULT_OFF
17 | light3_restore_mode: RESTORE_DEFAULT_OFF
18 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
19 | dns_domain: ".local"
20 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
21 | timezone: ""
22 | # Set the duration between the sntp service polling ntp.org servers for an update
23 | sntp_update_interval: 6h
24 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
25 | sntp_server_1: "0.pool.ntp.org"
26 | sntp_server_2: "1.pool.ntp.org"
27 | sntp_server_3: "2.pool.ntp.org"
28 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
29 | wifi_fast_connect: "false"
30 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
31 | log_level: "DEBUG"
32 | # Enable or disable the use of IPv6 networking on the device
33 | ipv6_enable: "false"
34 |
35 | esphome:
36 | name: "${name}"
37 | friendly_name: "${friendly_name}"
38 | comment: "${device_description}"
39 | area: "${room}"
40 | name_add_mac_suffix: true
41 | min_version: 2024.6.0
42 | project:
43 | name: "${project_name}"
44 | version: "${project_version}"
45 | on_boot:
46 | - priority: 600
47 | then:
48 | - select.set_index:
49 | id: power_mode
50 | index: !lambda |-
51 | return id(restore_mode)-1;
52 | - lambda: |-
53 | switch(id(restore_mode))
54 | {
55 | case 1:{
56 | id(light1).turn_off();
57 | id(light2).turn_off();
58 | id(light3).turn_off();
59 | break;
60 | }
61 | case 2:{
62 | id(light1).turn_on();
63 | id(light2).turn_on();
64 | id(light3).turn_on();
65 | break;
66 | }
67 | default:{
68 | break;
69 | }
70 | }
71 |
72 | esp8266:
73 | board: esp8285
74 | restore_from_flash: true
75 |
76 | preferences:
77 | flash_write_interval: 1min
78 |
79 | api:
80 |
81 | ota:
82 | - platform: esphome
83 |
84 | logger:
85 | level: ${log_level}
86 | baud_rate: 115200
87 |
88 | mdns:
89 | disabled: false
90 |
91 | web_server:
92 | port: 80
93 |
94 | network:
95 | enable_ipv6: ${ipv6_enable}
96 |
97 | wifi:
98 | # This spawns an AP with the device name and mac address with no password.
99 | ap: {}
100 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
101 | fast_connect: "${wifi_fast_connect}"
102 | # Define dns domain / suffix to add to hostname
103 | domain: "${dns_domain}"
104 |
105 | captive_portal:
106 |
107 | dashboard_import:
108 | package_import_url: github://athom-tech/athom-configs/athom-sw03.yaml
109 |
110 | globals:
111 | - id: restore_mode
112 | type: int
113 | restore_value: yes
114 | initial_value: "3"
115 |
116 | select:
117 | - platform: template
118 | name: "Power On State"
119 | id: "power_mode"
120 | optimistic: true
121 | options:
122 | - Always Off
123 | - Always On
124 | - Restore Power Off State
125 | on_value:
126 | then:
127 | - lambda: |-
128 | id(restore_mode)=i+1;
129 |
130 | binary_sensor:
131 | - platform: status
132 | name: "Status"
133 | entity_category: diagnostic
134 |
135 | # Touch Buttons
136 | - platform: gpio
137 | pin:
138 | inverted: true
139 | number: GPIO12
140 | mode:
141 | input: true
142 | pullup: true
143 | name: "Button1"
144 | id: button1
145 | disabled_by_default: true
146 | on_multi_click:
147 | - timing:
148 | - ON for at most 0.5s
149 | - OFF for at least 0.2s
150 | then:
151 | - light.toggle: light1
152 | - timing:
153 | - ON for at least 4s
154 | then:
155 | - button.press: Reset
156 |
157 | - platform: gpio
158 | pin:
159 | inverted: true
160 | number: GPIO3
161 | mode:
162 | input: true
163 | pullup: true
164 | name: "Button2"
165 | id: button2
166 | disabled_by_default: true
167 | on_click:
168 | max_length: 0.5s
169 | then:
170 | - light.toggle: light2
171 |
172 | - platform: gpio
173 | pin:
174 | inverted: true
175 | number: GPIO5
176 | mode:
177 | input: true
178 | pullup: true
179 | name: "Button3"
180 | id: button3
181 | disabled_by_default: true
182 | on_click:
183 | max_length: 0.5s
184 | then:
185 | - light.toggle: light3
186 |
187 | sensor:
188 | - platform: uptime
189 | name: "Uptime Sensor"
190 | id: uptime_sensor
191 | entity_category: diagnostic
192 | internal: true
193 |
194 | - platform: wifi_signal
195 | name: "WiFi Signal dB"
196 | id: wifi_signal_db
197 | update_interval: 60s
198 | entity_category: "diagnostic"
199 |
200 | - platform: copy
201 | source_id: wifi_signal_db
202 | name: "WiFi Signal Percent"
203 | filters:
204 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
205 | unit_of_measurement: "Signal %"
206 | entity_category: "diagnostic"
207 | device_class: ""
208 |
209 | button:
210 | - platform: restart
211 | name: "Restart"
212 | entity_category: config
213 |
214 | - platform: factory_reset
215 | name: "Factory Reset"
216 | id: Reset
217 | entity_category: config
218 |
219 | - platform: safe_mode
220 | name: "Safe Mode"
221 | internal: false
222 | entity_category: config
223 |
224 | output:
225 | # Relays
226 | - platform: gpio
227 | pin: GPIO13
228 | id: relay1
229 | - platform: gpio
230 | pin: GPIO4
231 | id: relay2
232 | - platform: gpio
233 | pin: GPIO15
234 | id: relay3
235 |
236 | # Button LEDs (1.0 = Blue / 0.0 = Red)
237 | - platform: esp8266_pwm
238 | pin: GPIO16
239 | inverted: true
240 | id: button_led1
241 | - platform: esp8266_pwm
242 | pin: GPIO14
243 | inverted: true
244 | id: button_led2
245 | - platform: esp8266_pwm
246 | pin: GPIO1
247 | inverted: true
248 | id: button_led3
249 |
250 | light:
251 | - platform: status_led
252 | name: "Status LED"
253 | disabled_by_default: true
254 | pin:
255 | number: GPIO0
256 | inverted: true
257 |
258 | # Relays
259 | - platform: binary
260 | name: "Light1"
261 | id: light1
262 | output: relay1
263 | restore_mode: ${light1_restore_mode}
264 | on_turn_on:
265 | - light.turn_on: led1
266 | on_turn_off:
267 | - light.turn_off: led1
268 |
269 | - platform: binary
270 | name: "Light2"
271 | id: light2
272 | output: relay2
273 | restore_mode: ${light2_restore_mode}
274 | on_turn_on:
275 | - light.turn_on: led2
276 | on_turn_off:
277 | - light.turn_off: led2
278 |
279 | - platform: binary
280 | name: "Light3"
281 | id: light3
282 | output: relay3
283 | restore_mode: ${light3_restore_mode}
284 | on_turn_on:
285 | - light.turn_on: led3
286 | on_turn_off:
287 | - light.turn_off: led3
288 |
289 | # Button LEDs
290 | - platform: monochromatic
291 | name: "LED1"
292 | disabled_by_default: true
293 | id: led1
294 | output: button_led1
295 | default_transition_length: 500ms
296 | - platform: monochromatic
297 | name: "LED2"
298 | disabled_by_default: true
299 | id: led2
300 | output: button_led2
301 | default_transition_length: 500ms
302 | - platform: monochromatic
303 | name: "LED3"
304 | disabled_by_default: true
305 | id: led3
306 | output: button_led3
307 | default_transition_length: 500ms
308 |
309 | text_sensor:
310 | - platform: wifi_info
311 | ip_address:
312 | name: "IP Address"
313 | entity_category: diagnostic
314 | ssid:
315 | name: "Connected SSID"
316 | entity_category: diagnostic
317 | mac_address:
318 | name: "Mac Address"
319 | entity_category: diagnostic
320 |
321 | # Creates a sensor showing when the device was last restarted
322 | - platform: template
323 | name: 'Last Restart'
324 | id: device_last_restart
325 | icon: mdi:clock
326 | entity_category: diagnostic
327 | # device_class: timestamp
328 |
329 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
330 | - platform: template
331 | name: "Uptime"
332 | entity_category: diagnostic
333 | lambda: |-
334 | int seconds = (id(uptime_sensor).state);
335 | int days = seconds / (24 * 3600);
336 | seconds = seconds % (24 * 3600);
337 | int hours = seconds / 3600;
338 | seconds = seconds % 3600;
339 | int minutes = seconds / 60;
340 | seconds = seconds % 60;
341 | if ( days > 3650 ) {
342 | return { "Starting up" };
343 | } else if ( days ) {
344 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
345 | } else if ( hours ) {
346 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
347 | } else if ( minutes ) {
348 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
349 | } else {
350 | return { (String(seconds) +"s").c_str() };
351 | }
352 | icon: mdi:clock-start
353 |
354 | time:
355 | - platform: sntp
356 | id: sntp_time
357 | # Define the timezone of the device
358 | timezone: "${timezone}"
359 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
360 | update_interval: ${sntp_update_interval}
361 | # Set specific sntp servers to use
362 | servers:
363 | - "${sntp_server_1}"
364 | - "${sntp_server_2}"
365 | - "${sntp_server_3}"
366 | # Publish the time the device was last restarted
367 | on_time_sync:
368 | then:
369 | # Update last restart time, but only once.
370 | - if:
371 | condition:
372 | lambda: 'return id(device_last_restart).state == "";'
373 | then:
374 | - text_sensor.template.publish:
375 | id: device_last_restart
376 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
377 |
--------------------------------------------------------------------------------
/athom-sw04.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | # Default name
3 | name: "athom-4gang-switch"
4 | # Default friendly name
5 | friendly_name: "4Gang Switch"
6 | # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
7 | room: ""
8 | # Description as appears in ESPHome & top of webserver page
9 | device_description: "athom 4gang switch"
10 | # Project Name
11 | project_name: "Athom Technology.4Gang Switch"
12 | # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
13 | project_version: "v1.1.3"
14 | # Restore the relay (GPO switch) upon reboot to state:
15 | light1_restore_mode: RESTORE_DEFAULT_OFF
16 | light2_restore_mode: RESTORE_DEFAULT_OFF
17 | light3_restore_mode: RESTORE_DEFAULT_OFF
18 | light4_restore_mode: RESTORE_DEFAULT_OFF
19 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
20 | dns_domain: ".local"
21 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
22 | timezone: ""
23 | # Set the duration between the sntp service polling ntp.org servers for an update
24 | sntp_update_interval: 6h
25 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
26 | sntp_server_1: "0.pool.ntp.org"
27 | sntp_server_2: "1.pool.ntp.org"
28 | sntp_server_3: "2.pool.ntp.org"
29 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
30 | wifi_fast_connect: "false"
31 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
32 | log_level: "DEBUG"
33 | # Enable or disable the use of IPv6 networking on the device
34 | ipv6_enable: "false"
35 |
36 | esphome:
37 | name: "${name}"
38 | friendly_name: "${friendly_name}"
39 | comment: "${device_description}"
40 | area: "${room}"
41 | name_add_mac_suffix: true
42 | min_version: 2024.6.0
43 | project:
44 | name: "${project_name}"
45 | version: "${project_version}"
46 | on_boot:
47 | - priority: 600
48 | then:
49 | - select.set_index:
50 | id: power_mode
51 | index: !lambda |-
52 | return id(restore_mode)-1;
53 | - lambda: |-
54 | switch(id(restore_mode))
55 | {
56 | case 1:{
57 | id(light1).turn_off();
58 | id(light2).turn_off();
59 | id(light3).turn_off();
60 | id(light4).turn_off();
61 | break;
62 | }
63 | case 2:{
64 | id(light1).turn_on();
65 | id(light2).turn_on();
66 | id(light3).turn_on();
67 | id(light4).turn_on();
68 | break;
69 | }
70 | default:{
71 | break;
72 | }
73 | }
74 |
75 | esp8266:
76 | board: esp8285
77 | restore_from_flash: true
78 |
79 | preferences:
80 | flash_write_interval: 1min
81 |
82 | api:
83 |
84 | ota:
85 | - platform: esphome
86 |
87 | logger:
88 | level: ${log_level}
89 | baud_rate: 115200
90 |
91 | mdns:
92 | disabled: false
93 |
94 | web_server:
95 | port: 80
96 |
97 | network:
98 | enable_ipv6: ${ipv6_enable}
99 |
100 | wifi:
101 | # This spawns an AP with the device name and mac address with no password.
102 | ap: {}
103 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
104 | fast_connect: "${wifi_fast_connect}"
105 | # Define dns domain / suffix to add to hostname
106 | domain: "${dns_domain}"
107 |
108 | captive_portal:
109 |
110 | dashboard_import:
111 | package_import_url: github://athom-tech/athom-configs/athom-sw04.yaml
112 |
113 | globals:
114 | - id: restore_mode
115 | type: int
116 | restore_value: yes
117 | initial_value: "3"
118 |
119 | select:
120 | - platform: template
121 | name: "Power On State"
122 | id: "power_mode"
123 | optimistic: true
124 | options:
125 | - Always Off
126 | - Always On
127 | - Restore Power Off State
128 | on_value:
129 | then:
130 | - lambda: |-
131 | id(restore_mode)=i+1;
132 |
133 | binary_sensor:
134 | - platform: status
135 | name: "Status"
136 | entity_category: diagnostic
137 |
138 | # Touch Buttons
139 | - platform: gpio
140 | pin:
141 | inverted: true
142 | number: GPIO12
143 | name: "Button1"
144 | disabled_by_default: true
145 | on_multi_click:
146 | - timing:
147 | - ON for at most 0.5s
148 | - OFF for at least 0.2s
149 | then:
150 | - light.toggle: light1
151 | - timing:
152 | - ON for at least 4s
153 | then:
154 | - button.press: Reset
155 |
156 | - platform: gpio
157 | pin:
158 | inverted: true
159 | number: GPIO3
160 | name: "Button2"
161 | disabled_by_default: true
162 | on_click:
163 | max_length: 0.5s
164 | then:
165 | - light.toggle: light2
166 |
167 | - platform: gpio
168 | pin:
169 | inverted: true
170 | number: GPIO5
171 | name: "Button3"
172 | disabled_by_default: true
173 | on_click:
174 | max_length: 0.5s
175 | then:
176 | - light.toggle: light3
177 |
178 | - platform: gpio
179 | pin:
180 | inverted: true
181 | number: GPIO16
182 | name: "Button4"
183 | disabled_by_default: true
184 | on_click:
185 | max_length: 0.5s
186 | then:
187 | - light.toggle: light4
188 |
189 | sensor:
190 | - platform: uptime
191 | name: "Uptime Sensor"
192 | id: uptime_sensor
193 | entity_category: diagnostic
194 | internal: true
195 |
196 | - platform: wifi_signal
197 | name: "WiFi Signal dB"
198 | id: wifi_signal_db
199 | update_interval: 60s
200 | entity_category: "diagnostic"
201 |
202 | - platform: copy
203 | source_id: wifi_signal_db
204 | name: "WiFi Signal Percent"
205 | filters:
206 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
207 | unit_of_measurement: "Signal %"
208 | entity_category: "diagnostic"
209 | device_class: ""
210 |
211 | button:
212 | - platform: restart
213 | name: "Restart"
214 | entity_category: config
215 |
216 | - platform: factory_reset
217 | name: "Factory Reset"
218 | id: Reset
219 | entity_category: config
220 |
221 | - platform: safe_mode
222 | name: "Safe Mode"
223 | internal: false
224 | entity_category: config
225 |
226 | output:
227 | # Relays
228 | - platform: gpio
229 | pin: GPIO13
230 | id: relay1
231 | - platform: gpio
232 | pin: GPIO4
233 | id: relay2
234 | - platform: gpio
235 | pin: GPIO15
236 | id: relay3
237 | - platform: gpio
238 | pin: GPIO14
239 | id: relay4
240 |
241 | light:
242 | - platform: status_led
243 | name: "Status LED"
244 | disabled_by_default: true
245 | pin:
246 | number: GPIO0
247 | inverted: true
248 |
249 | # Relays
250 | - platform: binary
251 | name: "Light1"
252 | id: light1
253 | output: relay1
254 | restore_mode: ${light1_restore_mode}
255 | - platform: binary
256 | name: "Light2"
257 | id: light2
258 | output: relay2
259 | restore_mode: ${light2_restore_mode}
260 | - platform: binary
261 | name: "Light3"
262 | id: light3
263 | output: relay3
264 | restore_mode: ${light3_restore_mode}
265 | - platform: binary
266 | name: "Light4"
267 | id: light4
268 | output: relay4
269 | restore_mode: ${light4_restore_mode}
270 |
271 | text_sensor:
272 | - platform: wifi_info
273 | ip_address:
274 | name: "IP Address"
275 | entity_category: diagnostic
276 | ssid:
277 | name: "Connected SSID"
278 | entity_category: diagnostic
279 | mac_address:
280 | name: "Mac Address"
281 | entity_category: diagnostic
282 |
283 | # Creates a sensor showing when the device was last restarted
284 | - platform: template
285 | name: 'Last Restart'
286 | id: device_last_restart
287 | icon: mdi:clock
288 | entity_category: diagnostic
289 | # device_class: timestamp
290 |
291 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
292 | - platform: template
293 | name: "Uptime"
294 | entity_category: diagnostic
295 | lambda: |-
296 | int seconds = (id(uptime_sensor).state);
297 | int days = seconds / (24 * 3600);
298 | seconds = seconds % (24 * 3600);
299 | int hours = seconds / 3600;
300 | seconds = seconds % 3600;
301 | int minutes = seconds / 60;
302 | seconds = seconds % 60;
303 | if ( days > 3650 ) {
304 | return { "Starting up" };
305 | } else if ( days ) {
306 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
307 | } else if ( hours ) {
308 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
309 | } else if ( minutes ) {
310 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
311 | } else {
312 | return { (String(seconds) +"s").c_str() };
313 | }
314 | icon: mdi:clock-start
315 |
316 | time:
317 | - platform: sntp
318 | id: sntp_time
319 | # Define the timezone of the device
320 | timezone: "${timezone}"
321 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
322 | update_interval: ${sntp_update_interval}
323 | # Set specific sntp servers to use
324 | servers:
325 | - "${sntp_server_1}"
326 | - "${sntp_server_2}"
327 | - "${sntp_server_3}"
328 | # Publish the time the device was last restarted
329 | on_time_sync:
330 | then:
331 | # Update last restart time, but only once.
332 | - if:
333 | condition:
334 | lambda: 'return id(device_last_restart).state == "";'
335 | then:
336 | - text_sensor.template.publish:
337 | id: device_last_restart
338 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
339 |
--------------------------------------------------------------------------------
/athom-wall-outlet.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | name: "athom-wall-outlet"
3 | friendly_name: "Athom Wall Outlet"
4 | # Allows ESP device to be automatically lined to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
5 | room: ""
6 | device_description: "athom wall outlet"
7 | project_name: "Athom Technology.Athom Wall Outlet"
8 | project_version: "v1.1.4"
9 | sensor_update_interval: "10s"
10 | relay_restore_mode: RESTORE_DEFAULT_OFF
11 | # Current Limit in Amps. AU Plug = 10. IL, BR, EU, UK, US Plug = 16.
12 | current_limit : "16"
13 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
14 | dns_domain: ".local"
15 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
16 | timezone: ""
17 | # Set the duration between the sntp service polling ntp.org servers for an update
18 | sntp_update_interval: "6h"
19 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
20 | sntp_server_1: "0.pool.ntp.org"
21 | sntp_server_2: "1.pool.ntp.org"
22 | sntp_server_3: "2.pool.ntp.org"
23 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
24 | wifi_fast_connect: "false"
25 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
26 | log_level: "INFO"
27 | # Enable or disable the use of IPv6 networking on the device
28 | ipv6_enable: "false"
29 | # Hide the ENERGY sensor that shows kWh consumed, but with no time period associated with it. Resets when device restarted and reflashed.
30 | hide_energy_sensor: "true"
31 |
32 | esphome:
33 | name: "${name}"
34 | friendly_name: "${friendly_name}"
35 | comment: "${device_description}"
36 | area: "${room}"
37 | name_add_mac_suffix: true
38 | min_version: 2024.6.0
39 | project:
40 | name: "${project_name}"
41 | version: "${project_version}"
42 | on_boot:
43 | - priority: 600
44 | then:
45 | - select.set_index:
46 | id: power_mode
47 | index: !lambda |-
48 | return id(restore_mode)-1;
49 | - lambda: |-
50 | switch(id(restore_mode))
51 | {
52 | case 1:{
53 | id(relay).turn_off();
54 | break;
55 | }
56 | case 2:{
57 | id(relay).turn_on();
58 | break;
59 | }
60 | default:{
61 | break;
62 | }
63 | }
64 |
65 | esp8266:
66 | board: esp8285
67 | restore_from_flash: true
68 |
69 | preferences:
70 | flash_write_interval: 5min
71 |
72 | api:
73 |
74 | ota:
75 | - platform: esphome
76 |
77 | logger:
78 | baud_rate: 0
79 |
80 | mdns:
81 | disabled: false
82 |
83 | web_server:
84 | port: 80
85 |
86 | network:
87 | enable_ipv6: ${ipv6_enable}
88 |
89 | wifi:
90 | # This spawns an AP with the device name and mac address with no password.
91 | ap: {}
92 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
93 | fast_connect: "${wifi_fast_connect}"
94 | # Define dns domain / suffix to add to hostname
95 | domain: "${dns_domain}"
96 |
97 | captive_portal:
98 |
99 | dashboard_import:
100 | package_import_url: github://athom-tech/athom-configs/athom-wall-outlet.yaml
101 |
102 | uart:
103 | rx_pin: RX
104 | baud_rate: 4800
105 | parity: EVEN
106 |
107 | globals:
108 | - id: total_energy
109 | type: float
110 | restore_value: yes
111 | initial_value: '0.0'
112 |
113 | - id: restore_mode
114 | type: int
115 | restore_value: yes
116 | initial_value: "3"
117 |
118 | select:
119 | - platform: template
120 | name: "Power On State"
121 | id: "power_mode"
122 | optimistic: true
123 | options:
124 | - Always Off
125 | - Always On
126 | - Restore Power Off State
127 | on_value:
128 | then:
129 | - lambda: |-
130 | id(restore_mode)=i+1;
131 |
132 | binary_sensor:
133 | - platform: status
134 | name: "Status"
135 | entity_category: diagnostic
136 |
137 | - platform: gpio
138 | pin:
139 | number: 5
140 | mode: INPUT_PULLUP
141 | inverted: true
142 | name: "Power Button"
143 | disabled_by_default: true
144 | on_multi_click:
145 | - timing:
146 | - ON for at most 1s
147 | - OFF for at least 0.2s
148 | then:
149 | - switch.toggle: relay
150 | - timing:
151 | - ON for at least 4s
152 | then:
153 | - button.press: Reset
154 |
155 | sensor:
156 | - platform: uptime
157 | name: "Uptime Sensor"
158 | id: uptime_sensor
159 | entity_category: diagnostic
160 | internal: true
161 |
162 | # Reports the WiFi signal strength/RSSI in dB
163 | - platform: wifi_signal
164 | name: "WiFi Signal dB"
165 | id: wifi_signal_db
166 | update_interval: 60s
167 | entity_category: diagnostic
168 |
169 | # Reports the WiFi signal strength in %
170 | - platform: copy
171 | source_id: wifi_signal_db
172 | name: "WiFi Signal Percent"
173 | filters:
174 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
175 | unit_of_measurement: "%"
176 | entity_category: diagnostic
177 | device_class: ""
178 |
179 | - platform: cse7766
180 | id: athom_cse7766
181 | current:
182 | name: "Current"
183 | filters:
184 | - throttle_average: ${sensor_update_interval}
185 | - lambda: if (x < 0.060) return 0.0; else return x; #For the chip will report less than 3w power when no load is connected
186 | on_value_range:
187 | - above: ${current_limit}
188 | then:
189 | - switch.turn_off: relay
190 |
191 | voltage:
192 | name: "Voltage"
193 | filters:
194 | - throttle_average: ${sensor_update_interval}
195 |
196 | power:
197 | name: "Power"
198 | id: power_sensor
199 | filters:
200 | - throttle_average: ${sensor_update_interval}
201 | - lambda: if (x < 3.0) return 0.0; else return x; #For the chip will report less than 3w power when no load is connected
202 |
203 | energy:
204 | name: "Energy"
205 | id: energy
206 | unit_of_measurement: kWh
207 | filters:
208 | - throttle: ${sensor_update_interval}
209 | # Multiplication factor from W to kW is 0.001
210 | - multiply: 0.001
211 | on_value:
212 | then:
213 | - lambda: |-
214 | static float previous_energy_value = 0.0;
215 | float current_energy_value = id(energy).state;
216 | id(total_energy) += current_energy_value - previous_energy_value;
217 | previous_energy_value = current_energy_value;
218 | id(total_energy_sensor).update();
219 | # internal: ${hide_energy_sensor}
220 |
221 | apparent_power:
222 | name: "Apparent Power"
223 | filters:
224 | - throttle_average: ${sensor_update_interval}
225 | reactive_power:
226 | name: "Reactive Power"
227 | filters:
228 | - throttle_average: ${sensor_update_interval}
229 | power_factor:
230 | name: "Power Factor"
231 | filters:
232 | - throttle_average: ${sensor_update_interval}
233 |
234 | - platform: template
235 | name: "Total Energy"
236 | id: total_energy_sensor
237 | unit_of_measurement: kWh
238 | device_class: "energy"
239 | state_class: "total_increasing"
240 | icon: "mdi:lightning-bolt"
241 | accuracy_decimals: 3
242 | lambda: |-
243 | return id(total_energy);
244 | update_interval: ${sensor_update_interval}
245 |
246 | - platform: total_daily_energy
247 | name: "Total Energy Since Boot"
248 | restore: true
249 | power_id: power_sensor
250 | unit_of_measurement: kWh
251 | icon: mdi:hours-24
252 | accuracy_decimals: 3
253 | filters:
254 | - multiply: 0.001
255 |
256 | # # Dentra Components - Define the id of the sensor providing 'Total Energy' used
257 | # - platform: "energy_statistics"
258 | # total: total_energy_sensor
259 |
260 | # # Dentra Components - Adds Energy Today. Persistents if restarted, unlike 'total_daily_energy'
261 | # energy_today:
262 | # name: "Energy Today"
263 | # id: total_energy_today
264 | # accuracy_decimals: 3
265 | # icon: mdi:hours-24
266 |
267 | # # Dentra Components - Adds Energy Yesterday
268 | # energy_yesterday:
269 | # name: "Total Energy Yesterday"
270 | # id: total_energy_yesterday
271 | # accuracy_decimals: 3
272 |
273 | # # Dentra Components - Adds Energy Week
274 | # energy_week:
275 | # name: "Total Energy Week"
276 | # id: total_energy_week
277 | # accuracy_decimals: 3
278 |
279 | # # Dentra Components - Adds Energy Month
280 | # energy_month:
281 | # name: "Total Energy Month"
282 | # id: total_energy_month
283 | # accuracy_decimals: 3
284 |
285 | button:
286 | - platform: restart
287 | name: "Restart"
288 | entity_category: config
289 |
290 | - platform: factory_reset
291 | name: "Factory Reset"
292 | id: Reset
293 | entity_category: config
294 |
295 | - platform: safe_mode
296 | name: "Safe Mode"
297 | internal: false
298 | entity_category: config
299 |
300 | switch:
301 | - platform: gpio
302 | name: "Switch"
303 | pin: GPIO12
304 | id: relay
305 | restore_mode: ${relay_restore_mode}
306 | on_turn_on:
307 | - light.turn_on: red_led
308 | on_turn_off:
309 | - light.turn_off: red_led
310 |
311 | light:
312 | - platform: status_led
313 | name: "Status LED"
314 | id: red_led
315 | disabled_by_default: true
316 | pin:
317 | inverted: true
318 | number: GPIO13
319 |
320 | text_sensor:
321 | - platform: wifi_info
322 | ip_address:
323 | name: "IP Address"
324 | entity_category: diagnostic
325 | ssid:
326 | name: "Connected SSID"
327 | entity_category: diagnostic
328 | mac_address:
329 | name: "Mac Address"
330 | entity_category: diagnostic
331 |
332 | # Creates a sensor showing when the device was last restarted
333 | - platform: template
334 | name: 'Last Restart'
335 | id: device_last_restart
336 | icon: mdi:clock
337 | entity_category: diagnostic
338 | # device_class: timestamp
339 |
340 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
341 | - platform: template
342 | name: "Uptime"
343 | entity_category: diagnostic
344 | lambda: |-
345 | int seconds = (id(uptime_sensor).state);
346 | int days = seconds / (24 * 3600);
347 | seconds = seconds % (24 * 3600);
348 | int hours = seconds / 3600;
349 | seconds = seconds % 3600;
350 | int minutes = seconds / 60;
351 | seconds = seconds % 60;
352 | if ( days > 3650 ) {
353 | return { "Starting up" };
354 | } else if ( days ) {
355 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
356 | } else if ( hours ) {
357 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
358 | } else if ( minutes ) {
359 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
360 | } else {
361 | return { (String(seconds) +"s").c_str() };
362 | }
363 | icon: mdi:clock-start
364 |
365 | time:
366 | - platform: sntp
367 | id: sntp_time
368 | # Define the timezone of the device
369 | timezone: "${timezone}"
370 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
371 | update_interval: ${sntp_update_interval}
372 | # Set specific sntp servers to use
373 | servers:
374 | - "${sntp_server_1}"
375 | - "${sntp_server_2}"
376 | - "${sntp_server_3}"
377 | # Publish the time the device was last restarted
378 | on_time_sync:
379 | then:
380 | # Update last restart time, but only once.
381 | - if:
382 | condition:
383 | lambda: 'return id(device_last_restart).state == "";'
384 | then:
385 | - text_sensor.template.publish:
386 | id: device_last_restart
387 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
388 |
--------------------------------------------------------------------------------
/athom-without-relay-plug.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | name: "athom-without-relay-plug"
3 | friendly_name: "Smart Plug"
4 | # Allows ESP device to be automatically lined to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
5 | room: ""
6 | device_description: "athom esp8285 without relay plug"
7 | project_name: "Athom Technology.Athom Without Relay Plug"
8 | project_version: "v2.0.7"
9 | sensor_update_interval: "10s"
10 | # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
11 | dns_domain: ".local"
12 | # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
13 | timezone: ""
14 | # Set the duration between the sntp service polling ntp.org servers for an update
15 | sntp_update_interval: "6h"
16 | # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
17 | sntp_server_1: "0.pool.ntp.org"
18 | sntp_server_2: "1.pool.ntp.org"
19 | sntp_server_3: "2.pool.ntp.org"
20 | # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
21 | wifi_fast_connect: "false"
22 | # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
23 | log_level: "INFO"
24 | # Enable or disable the use of IPv6 networking on the device
25 | ipv6_enable: "false"
26 | # Hide the ENERGY sensor that shows kWh consumed, but with no time period associated with it. Resets when device restarted and reflashed.
27 | hide_energy_sensor: "false"
28 |
29 | esphome:
30 | name: "${name}"
31 | friendly_name: "${friendly_name}"
32 | comment: "${device_description}"
33 | area: "${room}"
34 | name_add_mac_suffix: true
35 | min_version: 2024.6.0
36 | project:
37 | name: "${project_name}"
38 | version: "${project_version}"
39 |
40 | esp8266:
41 | board: esp8285
42 | restore_from_flash: true
43 |
44 | preferences:
45 | flash_write_interval: 5min
46 |
47 | api:
48 |
49 | ota:
50 | - platform: esphome
51 |
52 | logger:
53 | level: ${log_level}
54 | baud_rate: 0
55 |
56 | mdns:
57 | disabled: false
58 |
59 | web_server:
60 | port: 80
61 |
62 | network:
63 | enable_ipv6: ${ipv6_enable}
64 |
65 | wifi:
66 | # This spawns an AP with the device name and mac address with no password.
67 | ap: {}
68 | # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
69 | fast_connect: "${wifi_fast_connect}"
70 | # Define dns domain / suffix to add to hostname
71 | domain: "${dns_domain}"
72 |
73 | captive_portal:
74 |
75 | dashboard_import:
76 | package_import_url: github://athom-tech/athom-configs/athom-without-relay-plug.yaml
77 |
78 | # Dentra Components - Adds 'Platform - Energy Statistics'
79 | # https://github.com/dentra/esphome-components/tree/master/components/energy_statistics
80 | # external_components:
81 | # - source: github://dentra/esphome-components
82 |
83 | uart:
84 | rx_pin: RX
85 | baud_rate: 4800
86 | parity: EVEN
87 |
88 | globals:
89 | - id: total_energy
90 | type: float
91 | restore_value: yes
92 | initial_value: '0.0'
93 |
94 | binary_sensor:
95 | - platform: status
96 | name: "Status"
97 | entity_category: diagnostic
98 |
99 | - platform: gpio
100 | pin:
101 | number: 5
102 | mode: INPUT_PULLUP
103 | inverted: true
104 | name: "Button"
105 | disabled_by_default: true
106 | on_multi_click:
107 | - timing:
108 | - ON for at least 4s
109 | then:
110 | - button.press: Reset
111 |
112 | sensor:
113 | - platform: uptime
114 | name: "Uptime Sensor"
115 | id: uptime_sensor
116 | entity_category: diagnostic
117 | internal: true
118 |
119 | # Reports the WiFi signal strength/RSSI in dB
120 | - platform: wifi_signal
121 | name: "WiFi Signal dB"
122 | id: wifi_signal_db
123 | update_interval: 60s
124 | entity_category: diagnostic
125 |
126 | # Reports the WiFi signal strength in %
127 | - platform: copy
128 | source_id: wifi_signal_db
129 | name: "WiFi Signal Percent"
130 | filters:
131 | - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
132 | unit_of_measurement: "%"
133 | entity_category: diagnostic
134 | device_class: ""
135 |
136 | - platform: cse7766
137 | id: athom_cse7766
138 | current:
139 | name: "Current"
140 | filters:
141 | - throttle_average: ${sensor_update_interval}
142 | - lambda: if (x < 0.060) return 0.0; else return x; #For the chip will report less than 3w power when no load is connected
143 |
144 | voltage:
145 | name: "Voltage"
146 | filters:
147 | - throttle_average: ${sensor_update_interval}
148 |
149 | power:
150 | name: "Power"
151 | id: power_sensor
152 | filters:
153 | - throttle_average: ${sensor_update_interval}
154 | - lambda: if (x < 3.0) return 0.0; else return x; #For the chip will report less than 3w power when no load is connected
155 |
156 | energy:
157 | name: "Energy"
158 | id: energy
159 | unit_of_measurement: kWh
160 | internal: ${hide_energy_sensor}
161 | filters:
162 | - throttle: ${sensor_update_interval}
163 | # Multiplication factor from W to kW is 0.001
164 | - multiply: 0.001
165 | on_value:
166 | then:
167 | - lambda: |-
168 | static float previous_energy_value = 0.0;
169 | float current_energy_value = id(energy).state;
170 | id(total_energy) += current_energy_value - previous_energy_value;
171 | previous_energy_value = current_energy_value;
172 | id(total_energy_sensor).update();
173 |
174 |
175 | apparent_power:
176 | name: "Apparent Power"
177 | filters:
178 | - throttle_average: ${sensor_update_interval}
179 | reactive_power:
180 | name: "Reactive Power"
181 | filters:
182 | - throttle_average: ${sensor_update_interval}
183 | power_factor:
184 | name: "Power Factor"
185 | filters:
186 | - throttle_average: ${sensor_update_interval}
187 |
188 | - platform: template
189 | name: "Total Energy"
190 | id: total_energy_sensor
191 | unit_of_measurement: kWh
192 | device_class: "energy"
193 | state_class: "total_increasing"
194 | icon: "mdi:lightning-bolt"
195 | accuracy_decimals: 3
196 | lambda: |-
197 | return id(total_energy);
198 | update_interval: ${sensor_update_interval}
199 |
200 | - platform: total_daily_energy
201 | name: "Total Energy Since Boot"
202 | restore: true
203 | power_id: power_sensor
204 | unit_of_measurement: kWh
205 | icon: mdi:hours-24
206 | accuracy_decimals: 3
207 | filters:
208 | - multiply: 0.001
209 |
210 | # # Dentra Components - Define the id of the sensor providing 'Total Energy' used
211 | # - platform: "energy_statistics"
212 | # total: total_energy_sensor
213 |
214 | # # Dentra Components - Adds Energy Today. Persistents if restarted, unlike 'total_daily_energy'
215 | # energy_today:
216 | # name: "Energy Today"
217 | # id: total_energy_today
218 | # accuracy_decimals: 3
219 | # icon: mdi:hours-24
220 |
221 | # # Dentra Components - Adds Energy Yesterday
222 | # energy_yesterday:
223 | # name: "Total Energy Yesterday"
224 | # id: total_energy_yesterday
225 | # accuracy_decimals: 3
226 |
227 | # # Dentra Components - Adds Energy Week
228 | # energy_week:
229 | # name: "Total Energy Week"
230 | # id: total_energy_week
231 | # accuracy_decimals: 3
232 |
233 | # # Dentra Components - Adds Energy Month
234 | # energy_month:
235 | # name: "Total Energy Month"
236 | # id: total_energy_month
237 | # accuracy_decimals: 3
238 |
239 | button:
240 | - platform: restart
241 | name: "Restart"
242 | entity_category: config
243 |
244 | - platform: factory_reset
245 | name: "Factory Reset"
246 | id: Reset
247 | entity_category: config
248 |
249 | - platform: safe_mode
250 | name: "Safe Mode"
251 | internal: false
252 | entity_category: config
253 |
254 | light:
255 | - platform: status_led
256 | name: "Status LED"
257 | id: blue_led
258 | disabled_by_default: true
259 | pin:
260 | inverted: true
261 | number: GPIO13
262 |
263 | text_sensor:
264 | - platform: wifi_info
265 | ip_address:
266 | name: "IP Address"
267 | entity_category: diagnostic
268 | ssid:
269 | name: "Connected SSID"
270 | entity_category: diagnostic
271 | mac_address:
272 | name: "Mac Address"
273 | entity_category: diagnostic
274 |
275 | # Creates a sensor showing when the device was last restarted
276 | - platform: template
277 | name: 'Last Restart'
278 | id: device_last_restart
279 | icon: mdi:clock
280 | entity_category: diagnostic
281 | # device_class: timestamp
282 |
283 | # Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
284 | - platform: template
285 | name: "Uptime"
286 | entity_category: diagnostic
287 | lambda: |-
288 | int seconds = (id(uptime_sensor).state);
289 | int days = seconds / (24 * 3600);
290 | seconds = seconds % (24 * 3600);
291 | int hours = seconds / 3600;
292 | seconds = seconds % 3600;
293 | int minutes = seconds / 60;
294 | seconds = seconds % 60;
295 | if ( days > 3650 ) {
296 | return { "Starting up" };
297 | } else if ( days ) {
298 | return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
299 | } else if ( hours ) {
300 | return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
301 | } else if ( minutes ) {
302 | return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
303 | } else {
304 | return { (String(seconds) +"s").c_str() };
305 | }
306 | icon: mdi:clock-start
307 |
308 | time:
309 | - platform: sntp
310 | id: sntp_time
311 | # Define the timezone of the device
312 | timezone: "${timezone}"
313 | # Change sync interval from default 5min to 6 hours (or as set in substitutions)
314 | update_interval: ${sntp_update_interval}
315 | # Set specific sntp servers to use
316 | servers:
317 | - "${sntp_server_1}"
318 | - "${sntp_server_2}"
319 | - "${sntp_server_3}"
320 | # Publish the time the device was last restarted
321 | on_time_sync:
322 | then:
323 | # Update last restart time, but only once.
324 | - if:
325 | condition:
326 | lambda: 'return id(device_last_restart).state == "";'
327 | then:
328 | - text_sensor.template.publish:
329 | id: device_last_restart
330 | state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
331 |
--------------------------------------------------------------------------------
/athom-ws2812b.yaml:
--------------------------------------------------------------------------------
1 | substitutions:
2 | device_name: "athom-ws2812b"
3 | project_name: "Athom Technology.WS2812B Controller"
4 | project_version: "1.1.1"
5 | button_toggle: "true"
6 | led_restore_mode: RESTORE_DEFAULT_OFF
7 | number_of_leds: '150'
8 | led_rgb_order: GRB
9 | led_chipset: WS2811
10 |
11 | esphome:
12 | name: "${device_name}"
13 | friendly_name: ""
14 | name_add_mac_suffix: true
15 | min_version: 2024.6.0
16 | project:
17 | name: "${project_name}"
18 | version: "${project_version}"
19 |
20 | esp8266:
21 | board: esp8285
22 | restore_from_flash: true
23 | framework:
24 | version: 2.7.4
25 |
26 | preferences:
27 | flash_write_interval: 1min
28 |
29 | api:
30 |
31 | ota:
32 | - platform: esphome
33 |
34 | logger:
35 | baud_rate: 0
36 |
37 | mdns:
38 | disabled: false
39 |
40 | web_server:
41 | port: 80
42 |
43 | wifi:
44 | ap: {} # This spawns an AP with the device name and mac address with no password.
45 |
46 | captive_portal:
47 |
48 | dashboard_import:
49 | package_import_url: github://athom-tech/athom-configs/athom-ws2812b.yaml
50 |
51 | binary_sensor:
52 | - platform: status
53 | name: "Status"
54 |
55 | - platform: gpio
56 | pin:
57 | number: 0
58 | mode: INPUT_PULLUP
59 | inverted: true
60 | name: "Power Button"
61 | disabled_by_default: true
62 | on_multi_click:
63 | - timing:
64 | - ON for at most 1s
65 | - OFF for at least 0.2s
66 | then:
67 | - light.toggle: leds
68 | - timing:
69 | - ON for at least 4s
70 | then:
71 | - button.press: Reset
72 |
73 | sensor:
74 | - platform: uptime
75 | name: "Uptime Sensor"
76 |
77 | - platform: wifi_signal
78 | name: "WiFi Signal"
79 | update_interval: 60s
80 |
81 | button:
82 | - platform: factory_reset
83 | name: "Reset"
84 | id: Reset
85 |
86 | - platform: safe_mode
87 | name: "Safe Mode"
88 | internal: false
89 |
90 | light:
91 | - platform: fastled_clockless
92 | pin: GPIO1
93 | id: leds
94 | name: "WS2812B Controller"
95 | chipset: ${led_chipset}
96 | num_leds: ${number_of_leds}
97 | rgb_order: ${led_rgb_order}
98 | restore_mode: ${led_restore_mode}
99 | effects:
100 | - addressable_rainbow:
101 | - addressable_scan:
102 |
103 | text_sensor:
104 | - platform: wifi_info
105 | ip_address:
106 | name: "IP Address"
107 | ssid:
108 | name: "Connected SSID"
109 | mac_address:
110 | name: "Mac Address"
111 |
112 | time:
113 | - platform: sntp
114 | id: sntp_time
115 |
--------------------------------------------------------------------------------
/images/Athom_15w_Bulb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_15w_Bulb.png
--------------------------------------------------------------------------------
/images/Athom_1Gang_Key_Switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_1Gang_Key_Switch.png
--------------------------------------------------------------------------------
/images/Athom_1Gang_Touch_Switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_1Gang_Touch_Switch.png
--------------------------------------------------------------------------------
/images/Athom_1Gang_US_Switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_1Gang_US_Switch.png
--------------------------------------------------------------------------------
/images/Athom_2Gang_Key_Switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_2Gang_Key_Switch.png
--------------------------------------------------------------------------------
/images/Athom_2Gang_Touch_Switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_2Gang_Touch_Switch.png
--------------------------------------------------------------------------------
/images/Athom_3Gang_Key_Switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_3Gang_Key_Switch.png
--------------------------------------------------------------------------------
/images/Athom_3Gang_Touch_Switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_3Gang_Touch_Switch.png
--------------------------------------------------------------------------------
/images/Athom_3Pin_Controller.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_3Pin_Controller.png
--------------------------------------------------------------------------------
/images/Athom_4Gang_Touch_Swtich.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_4Gang_Touch_Swtich.png
--------------------------------------------------------------------------------
/images/Athom_4Pin_Controller.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_4Pin_Controller.png
--------------------------------------------------------------------------------
/images/Athom_7w_Bulb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_7w_Bulb.png
--------------------------------------------------------------------------------
/images/Athom_AU_Plug_V2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_AU_Plug_V2.png
--------------------------------------------------------------------------------
/images/Athom_BR30_Bulb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_BR30_Bulb.png
--------------------------------------------------------------------------------
/images/Athom_BR_Plug_V2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_BR_Plug_V2.png
--------------------------------------------------------------------------------
/images/Athom_CB01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_CB01.png
--------------------------------------------------------------------------------
/images/Athom_CB02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_CB02.png
--------------------------------------------------------------------------------
/images/Athom_EU_Plug.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_EU_Plug.png
--------------------------------------------------------------------------------
/images/Athom_EU_Plug_V2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_EU_Plug_V2.png
--------------------------------------------------------------------------------
/images/Athom_GU10_Bulb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_GU10_Bulb.png
--------------------------------------------------------------------------------
/images/Athom_Garage_Door_Opener.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_Garage_Door_Opener.png
--------------------------------------------------------------------------------
/images/Athom_IL_Plug_V2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_IL_Plug_V2.png
--------------------------------------------------------------------------------
/images/Athom_IT_Plug_V2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_IT_Plug_V2.png
--------------------------------------------------------------------------------
/images/Athom_Mini_Relay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_Mini_Relay.png
--------------------------------------------------------------------------------
/images/Athom_Presence_Sensor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_Presence_Sensor.png
--------------------------------------------------------------------------------
/images/Athom_RGBW_Controller.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_RGBW_Controller.png
--------------------------------------------------------------------------------
/images/Athom_RGB_Controller.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_RGB_Controller.png
--------------------------------------------------------------------------------
/images/Athom_UK_Plug.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_UK_Plug.png
--------------------------------------------------------------------------------
/images/Athom_UK_Plug_V2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_UK_Plug_V2.png
--------------------------------------------------------------------------------
/images/Athom_US_Plug.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_US_Plug.png
--------------------------------------------------------------------------------
/images/Athom_US_Plug_V2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_US_Plug_V2.png
--------------------------------------------------------------------------------
/images/Athom_Wall_Outlet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/images/Athom_Wall_Outlet.png
--------------------------------------------------------------------------------
/static/_config.yml:
--------------------------------------------------------------------------------
1 | # CHANGEME: Set these variable to your liking
2 | title: Athom Technology ESPHome Project
3 | description: Powered by ESPHome and ESP Web Tools
4 | theme: jekyll-theme-slate
--------------------------------------------------------------------------------
/static/index.md:
--------------------------------------------------------------------------------
1 | # About
2 |
3 | ESPhome project by Shenzhen Athom Technology Co., Ltd., China.
4 |
5 | # Installation
6 |
7 | You can use the button below to install the pre-built firmware directly to your device via USB from the browser.
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/tasmota-minimal.bin.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/athom-tech/athom-configs/f0481679decbfde70fac8269ac9cae4448994ee8/tasmota-minimal.bin.gz
--------------------------------------------------------------------------------