Browse Source

Add common configs

main
James Moore 11 months ago
parent
commit
3a707ecb8f
10 changed files with 79 additions and 0 deletions
  1. +4
    -0
      common/buttons/restart.yaml
  2. +4
    -0
      common/buttons/safe-mode.yaml
  3. +7
    -0
      common/common.yaml
  4. +7
    -0
      common/config/api.yaml
  5. +19
    -0
      common/config/mqtt.yaml
  6. +6
    -0
      common/config/ota.yaml
  7. +6
    -0
      common/config/time.yaml
  8. +12
    -0
      common/config/wifi.yaml
  9. +7
    -0
      common/sensors/uptime.yaml
  10. +7
    -0
      common/sensors/wifi-signal.yaml

+ 4
- 0
common/buttons/restart.yaml View File

@ -0,0 +1,4 @@
- platform: restart
name: Restart
icon: "mdi:restart"
entity_category: diagnostic

+ 4
- 0
common/buttons/safe-mode.yaml View File

@ -0,0 +1,4 @@
- platform: safe_mode
name: Safe Mode Boot
icon: "mdi:restart"
entity_category: diagnostic

+ 7
- 0
common/common.yaml View File

@ -0,0 +1,7 @@
<<: !include config/wifi.yaml
<<: !include config/time.yaml
<<: !include config/ota.yaml
<<: !include config/api.yaml
<<: !include config/mqtt.yaml
logger:

+ 7
- 0
common/config/api.yaml View File

@ -0,0 +1,7 @@
## Native API Component ##
## https://esphome.io/components/api.html
api:
# Set to 0s to disable switch reboot if nothing connects to the API
reboot_timeout: 15min
encryption:
key: ${encryption_key}

+ 19
- 0
common/config/mqtt.yaml View File

@ -0,0 +1,19 @@
## MQTT Client Component ##
## https://esphome.io/components/mqtt.html
mqtt:
# Set to 0s to disable switch reboot if no MQTT connection exists
reboot_timeout: 15min
broker: ${mqtt_broker}
username: ${mqtt_username}
password: ${mqtt_password}
discovery: false
log_topic:
topic: esphome/logs/${devicename}
level: ERROR
topic_prefix: esphome
birth_message:
topic: esphome/state/${devicename}
payload: online
will_message:
topic: esphome/state/${devicename}
payload: offline

+ 6
- 0
common/config/ota.yaml View File

@ -0,0 +1,6 @@
## Over-the-Air Updates ##
## https://esphome.io/components/ota/
## https://esphome.io/components/ota/esphome
ota:
- platform: esphome
password: ${ota_password}

+ 6
- 0
common/config/time.yaml View File

@ -0,0 +1,6 @@
## Time Component ##
## https://esphome.io/components/time/
time:
- platform: sntp
servers: ${ntp_server_ip}
timezone: ${timezone}

+ 12
- 0
common/config/wifi.yaml View File

@ -0,0 +1,12 @@
## WiFi Component ##
## https://esphome.io/components/wifi.html
wifi:
ssid: ${wifi_ssid}
password: ${wifi_password}
domain: ${wifi_domain}
fast_connect: true
power_save_mode: none
ap:
ssid: "${devicename} Fallback"
password: ${fallback_ap_password}

+ 7
- 0
common/sensors/uptime.yaml View File

@ -0,0 +1,7 @@
- platform: uptime
name: Uptime
type: seconds
update_interval: 60s
entity_category: "diagnostic"
state_class: measurement
device_class: duration

+ 7
- 0
common/sensors/wifi-signal.yaml View File

@ -0,0 +1,7 @@
- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi Signali dB"
id: wifi_signal_db
update_interval: 60s
entity_category: "diagnostic"
state_class: measurement
device_class: signal_strength

Loading…
Cancel
Save