Skip to content

Commit

Permalink
Switch to ESP-IDF framework
Browse files Browse the repository at this point in the history
  • Loading branch information
tarontop committed Sep 10, 2024
1 parent 8cb77a0 commit 3dc70dd
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 84 deletions.
43 changes: 15 additions & 28 deletions athom-2ch-relay-board.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ substitutions:
room: ""
device_description: "athom esp32 2ch relay board"
project_name: "Athom Technology.ESP32 2CH Relay Board"
project_version: "v2.0.2"
project_version: "v2.0.3"
update_interval: 60s
# 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)
dns_domain: ""
Expand All @@ -28,6 +28,7 @@ substitutions:
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
comment: "${device_description}"
area: "${room}"
name_add_mac_suffix: true
min_version: 2024.6.0
Expand All @@ -41,7 +42,8 @@ esp32:
board: esp32dev
flash_size: 4MB
framework:
type: arduino
type: esp-idf
version: recommended

preferences:
flash_write_interval: 5min
Expand Down Expand Up @@ -84,6 +86,15 @@ esp32_improv:
dashboard_import:
package_import_url: github://athom-tech/esp32-configs/athom-2ch-relay-board.yaml

# esp32_ble_tracker:
# scan_parameters:
# interval: 1100ms
# window: 1100ms
# active: true

# bluetooth_proxy:
# active: true

remote_receiver:
pin: GPIO17
dump: rc_switch
Expand Down Expand Up @@ -134,8 +145,9 @@ sensor:
- platform: uptime
name: "Uptime Sensor"
id: uptime_sensor
type:
timestamp
entity_category: "diagnostic"
internal: true

- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi Signal dB"
Expand Down Expand Up @@ -207,31 +219,6 @@ text_sensor:
entity_category: "diagnostic"
# device_class: timestamp

# Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
- platform: template
name: "Uptime"
entity_category: "diagnostic"
lambda: |-
int seconds = (id(uptime_sensor).state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
if ( days > 3650 ) {
return { "Starting up" };
} else if ( days ) {
return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else if ( hours ) {
return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else if ( minutes ) {
return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else {
return { (String(seconds) +"s").c_str() };
}
icon: mdi:clock-start

time:
- platform: sntp
id: sntp_time
Expand Down
43 changes: 15 additions & 28 deletions athom-4ch-relay-board.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ substitutions:
room: ""
device_description: "athom esp32 4ch relay board"
project_name: "Athom Technology.ESP32 4CH Relay Board"
project_version: "v2.0.2"
project_version: "v2.0.3"
update_interval: 60s
# 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)
dns_domain: ""
Expand All @@ -30,6 +30,7 @@ substitutions:
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
comment: "${device_description}"
area: "${room}"
name_add_mac_suffix: true
min_version: 2024.6.0
Expand All @@ -43,7 +44,8 @@ esp32:
board: esp32dev
flash_size: 4MB
framework:
type: arduino
type: esp-idf
version: recommended

preferences:
flash_write_interval: 5min
Expand Down Expand Up @@ -86,6 +88,15 @@ esp32_improv:
dashboard_import:
package_import_url: github://athom-tech/esp32-configs/athom-4ch-relay-board.yaml

# esp32_ble_tracker:
# scan_parameters:
# interval: 1100ms
# window: 1100ms
# active: true

# bluetooth_proxy:
# active: true

remote_receiver:
pin: GPIO17
dump: rc_switch
Expand Down Expand Up @@ -172,8 +183,9 @@ sensor:
- platform: uptime
name: "Uptime Sensor"
id: uptime_sensor
type:
timestamp
entity_category: "diagnostic"
internal: true

- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi Signal dB"
Expand Down Expand Up @@ -257,31 +269,6 @@ text_sensor:
entity_category: "diagnostic"
# device_class: timestamp

# Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
- platform: template
name: "Uptime"
entity_category: "diagnostic"
lambda: |-
int seconds = (id(uptime_sensor).state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
if ( days > 3650 ) {
return { "Starting up" };
} else if ( days ) {
return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else if ( hours ) {
return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else if ( minutes ) {
return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else {
return { (String(seconds) +"s").c_str() };
}
icon: mdi:clock-start

time:
- platform: sntp
id: sntp_time
Expand Down
43 changes: 15 additions & 28 deletions athom-8ch-relay-board.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ substitutions:
room: ""
device_description: "athom esp32 8ch relay board"
project_name: "Athom Technology.ESP32 8CH Relay Board"
project_version: "v2.0.2"
project_version: "v2.0.3"
update_interval: 60s
# 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)
dns_domain: ""
Expand Down Expand Up @@ -34,6 +34,7 @@ substitutions:
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
comment: "${device_description}"
area: "${room}"
name_add_mac_suffix: true
min_version: 2024.6.0
Expand All @@ -47,7 +48,8 @@ esp32:
board: esp32dev
flash_size: 4MB
framework:
type: arduino
type: esp-idf
version: recommended

preferences:
flash_write_interval: 5min
Expand Down Expand Up @@ -90,6 +92,15 @@ esp32_improv:
dashboard_import:
package_import_url: github://athom-tech/esp32-configs/athom-8ch-relay-board.yaml

# esp32_ble_tracker:
# scan_parameters:
# interval: 1100ms
# window: 1100ms
# active: true

# bluetooth_proxy:
# active: true

remote_receiver:
pin: GPIO17
dump: rc_switch
Expand Down Expand Up @@ -247,8 +258,9 @@ sensor:
- platform: uptime
name: "Uptime Sensor"
id: uptime_sensor
type:
timestamp
entity_category: "diagnostic"
internal: true

- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi Signal dB"
Expand Down Expand Up @@ -356,31 +368,6 @@ text_sensor:
entity_category: "diagnostic"
# device_class: timestamp

# Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
- platform: template
name: "Uptime"
entity_category: "diagnostic"
lambda: |-
int seconds = (id(uptime_sensor).state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
if ( days > 3650 ) {
return { "Starting up" };
} else if ( days ) {
return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else if ( hours ) {
return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else if ( minutes ) {
return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
} else {
return { (String(seconds) +"s").c_str() };
}
icon: mdi:clock-start

time:
- platform: sntp
id: sntp_time
Expand Down

0 comments on commit 3dc70dd

Please sign in to comment.