-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sonoff-s20 template and wifi_signal status diagnostic
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
# We track the project name and version here in the template | ||
packages: | ||
main: !include | ||
file: ../esphome.yaml | ||
vars: | ||
project_name: untergeek.sonoff-s20 | ||
project_version: 1.0.0 | ||
chip: !include | ||
file: ../esp8266.yaml | ||
vars: | ||
board: esp01_1m | ||
sync: !include ../time.yaml | ||
togl: !include ../restart_switch.yaml | ||
logs: !include ../logging.yaml | ||
sgnl: !include ../wifi_signal.yaml | ||
|
||
substitutions: | ||
device_id: relay | ||
icon: mdi:power-socket-us | ||
|
||
binary_sensor: | ||
- platform: gpio | ||
pin: | ||
number: GPIO0 | ||
mode: INPUT_PULLUP | ||
inverted: True | ||
name: Button | ||
on_press: | ||
- switch.toggle: ${device_id} | ||
- platform: status | ||
name: Status | ||
|
||
switch: | ||
- platform: gpio | ||
name: Switch | ||
pin: GPIO12 | ||
id: ${device_id} | ||
restore_mode: ${restore} | ||
|
||
status_led: | ||
pin: | ||
number: GPIO13 | ||
inverted: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
sensor: | ||
- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB | ||
name: "WiFi Signal dB" | ||
id: wifi_signal_db | ||
update_interval: 60s | ||
entity_category: "diagnostic" | ||
|
||
- platform: copy # Reports the WiFi signal strength in % | ||
source_id: wifi_signal_db | ||
name: "WiFi Signal Percent" | ||
filters: | ||
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0); | ||
unit_of_measurement: "Signal %" | ||
entity_category: "diagnostic" | ||
device_class: "" |