diff --git a/README.md b/README.md index b9f1cac004f504caf4acd1a1049e4c549317c083..bbfb9615b4d24f1ee048a1039867d4893dba5ae3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,11 @@ Home Grow(n) Monitoring ## Components -* propbox: Propagator Controller, any ESP32 -* propbox-light: Smart Plug for Lights, e.g. Nous A1T -* propbox-fan: Smart Plug for Fan, e.g. Nous A1T -* Xiaomi Mi Temperature and Humidity Monitor 2 (LYWSD03MMC), does what it says on the tin +* propbox: ESP32 Propagator Controller + * BME280 Temperature and Humidity Sensor (3.3V, I2C) + * Dallas DS18B20 Temperature Sensor +* propbox-light: Nous A1T Smart Plug for Light +* propbox-fan: Nous A1T Smart Plug for Fan + +## Configuration +Copy `secrets.yaml.dist` to `secrets.yaml` and adjust to your preferences. diff --git a/common.yaml b/base.yaml similarity index 51% rename from common.yaml rename to base.yaml index 078341359579732c279e2b683830d575495813e8..c823a8f066ffd713e868a8c39db5a647c9a7d87f 100644 --- a/common.yaml +++ b/base.yaml @@ -15,8 +15,6 @@ preferences: logger: # level: INFO - logs: - esp32_ble_tracker: INFO api: password: !secret api_password @@ -42,3 +40,36 @@ web_server: # include_internal: true prometheus: + +sensor: + - platform: wifi_signal + name: "Wifi Signal" + update_interval: 60s + + - platform: uptime + name: "Device Uptime" + update_interval: 60s + +text_sensor: + - platform: version + name: "ESPHome Version" + hide_timestamp: true + + - platform: template + name: "Device Time" + lambda: |- + auto str_time = id(sntp_time).now().strftime("%d-%m-%Y %H:%M"); + return { str_time }; + update_interval: 60s + + - platform: wifi_info + ip_address: + name: "Wifi IP Address" + ssid: + name: "Wifi SSID" + bssid: + name: "Wifi BSSID" + +switch: + - platform: restart + name: "Device Restart" diff --git a/include/nous_a1t.yaml b/include/nous_a1t.yaml index 54b16910c882497186d5a8ea00e1197229d57f5c..8fb21efe342b5c842e855241b2fffc56f17360f2 100644 --- a/include/nous_a1t.yaml +++ b/include/nous_a1t.yaml @@ -46,18 +46,6 @@ switch: pin: GPIO14 sensor: -### Default Sensors - - - platform: wifi_signal - name: "Wifi Signal" - update_interval: 60s - - - platform: uptime - name: "Uptime" - update_interval: 60s - -### Specific Sensors - - platform: total_daily_energy name: "Electric Consumption [kWh]" power_id: "nous_a1t_watt" diff --git a/include/text_sensors.yaml b/include/text_sensors.yaml deleted file mode 100644 index a67a7ec44037bba1ab1b5327ef766c7c4dc75780..0000000000000000000000000000000000000000 --- a/include/text_sensors.yaml +++ /dev/null @@ -1,18 +0,0 @@ -- platform: wifi_info - ip_address: - name: "Wifi IP Address" - ssid: - name: "Wifi SSID" - bssid: - name: "Wifi BSSID" - -- platform: version - name: "ESPHome Version" - hide_timestamp: true - -- platform: template - name: "Device Time" - lambda: |- - auto str_time = id(sntp_time).now().strftime("%d-%m-%Y %H:%M"); - return { str_time }; - update_interval: 60s diff --git a/propbox-fan.yaml b/propbox-fan.yaml index ff99829211dbcbdc3a3b45ac906639cbb046e34a..e54a885a479464af62c6cef5b8509cb5c5f70721 100644 --- a/propbox-fan.yaml +++ b/propbox-fan.yaml @@ -1,6 +1,6 @@ substitutions: devicename: "propbox-fan" - domain: "faked.local" + domain: !secret domain comment: "Propagator Fan Control" project_name: "groovy.propbox-fan" project_version: "1.0" @@ -8,9 +8,7 @@ substitutions: current_res: "0.00280" # Higher value gives lower watt readout voltage_div: "775" # Lower value gives lower voltage readout -<<: !include common.yaml +packages: + device_base: !include base.yaml <<: !include include/nous_a1t.yaml - -text_sensor: - !include include/text_sensors.yaml diff --git a/propbox-light.yaml b/propbox-light.yaml index 6ab726a1c8d8630eb685d4768dd5ebf14ff6562c..b8f1cc867d22cbb9132669bb3bf52c30bdea07df 100644 --- a/propbox-light.yaml +++ b/propbox-light.yaml @@ -1,6 +1,6 @@ substitutions: devicename: "propbox-light" - domain: "faked.local" + domain: !secret domain comment: "Propagator Light Control" project_name: "groovy.propbox-light" project_version: "1.0" @@ -8,9 +8,7 @@ substitutions: current_res: "0.00280" # Higher value gives lower watt readout voltage_div: "775" # Lower value gives lower voltage readout -<<: !include common.yaml +packages: + device_base: !include base.yaml <<: !include include/nous_a1t.yaml - -text_sensor: - !include include/text_sensors.yaml diff --git a/propbox.yaml b/propbox.yaml index d26d6881f3dc1bf9f4068d941ffbcb24e7dbdabb..db2c1daf87ec31b71941aad5e3be903bcaafbd35 100644 --- a/propbox.yaml +++ b/propbox.yaml @@ -1,6 +1,6 @@ substitutions: devicename: "propbox" - domain: "faked.local" + domain: !secret domain comment: "Propagator Monitor" project_name: "groovy.propbox" project_version: "1.0" @@ -19,7 +19,8 @@ substitutions: schedule_bloom_on: "0 * * * * *" schedule_bloom_off: "30 * * * * *" -<<: !include common.yaml +packages: + device_base: !include base.yaml esp32: board: esp32dev @@ -37,22 +38,7 @@ http_request: useragent: esphome/${devicename} timeout: 10s -text_sensor: - !include include/text_sensors.yaml - sensor: -### Default Sensors - - - platform: wifi_signal - name: "Wifi Signal" - update_interval: 60s - - - platform: uptime - name: "Device Uptime" - update_interval: 60s - -### Specific Sensors - - platform: bme280 address: 0x76 update_interval: 5s @@ -133,8 +119,6 @@ select: restore_value: true switch: - - platform: restart - name: "Device Restart" - platform: template id: propbox_light name: "Light Status" diff --git a/secrets.yaml.dist b/secrets.yaml.dist index 94d6535563b5a27ab3422f42165d9ff27a22cb05..07cf9d0f8299a0efa62961aec88417cc85da2a74 100644 --- a/secrets.yaml.dist +++ b/secrets.yaml.dist @@ -1,4 +1,5 @@ wifi_ssid: foo wifi_password: bar ota_password: baz -api_password: qux \ No newline at end of file +api_password: qux +domain: example.com