Add a bunch of smartplugs for energy monitoring (#28)

This commit is contained in:
Chris Nussbaum 2021-09-28 21:26:13 -05:00 committed by GitHub
parent e8717deb6c
commit 5c7c1a2060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 140 additions and 1 deletions

View File

@ -0,0 +1,10 @@
substitutions:
device_id: basement-fridge
device_name: Basement Fridge
ip_address: !secret basement-fridge-ip
ota_pwd: !secret basement-fridge-ota-pwd
api_pwd: !secret basement-fridge-api-pwd
ap_wifi_pwd: !secret basement-fridge-ap-pwd
packages:
feit_dimmer: !include ../packages/topgreener_smart_plug.yaml

10
devices/basement-tv.yaml Normal file
View File

@ -0,0 +1,10 @@
substitutions:
device_id: basement-tv
device_name: Basement TV
ip_address: !secret basement-tv-ip
ota_pwd: !secret basement-tv-ota-pwd
api_pwd: !secret basement-tv-api-pwd
ap_wifi_pwd: !secret basement-tv-ap-pwd
packages:
feit_dimmer: !include ../packages/topgreener_smart_plug.yaml

View File

@ -0,0 +1,10 @@
substitutions:
device_id: family-room-tv
device_name: Family Room TV
ip_address: !secret family-room-tv-ip
ota_pwd: !secret family-room-tv-ota-pwd
api_pwd: !secret family-room-tv-api-pwd
ap_wifi_pwd: !secret family-room-tv-ap-pwd
packages:
feit_dimmer: !include ../packages/topgreener_smart_plug.yaml

View File

@ -0,0 +1,10 @@
substitutions:
device_id: kitchen-fridge
device_name: Kitchen Fridge
ip_address: !secret kitchen-fridge-ip
ota_pwd: !secret kitchen-fridge-ota-pwd
api_pwd: !secret kitchen-fridge-api-pwd
ap_wifi_pwd: !secret kitchen-fridge-ap-pwd
packages:
feit_dimmer: !include ../packages/topgreener_smart_plug.yaml

View File

@ -0,0 +1,10 @@
substitutions:
device_id: network_equipment
device_name: Network Equipment
ip_address: !secret network-equipment-ip
ota_pwd: !secret network-equipment-ota-pwd
api_pwd: !secret network-equipment-api-pwd
ap_wifi_pwd: !secret network-equipment-ap-pwd
packages:
feit_dimmer: !include ../packages/topgreener_smart_plug.yaml

10
devices/sump_pump.yaml Normal file
View File

@ -0,0 +1,10 @@
substitutions:
device_id: sump_pump
device_name: Sump Pump
ip_address: !secret sump-pump-ip
ota_pwd: !secret sump-pump-ota-pwd
api_pwd: !secret sump-pump-api-pwd
ap_wifi_pwd: !secret sump-pump-ap-pwd
packages:
feit_dimmer: !include ../packages/topgreener_smart_plug.yaml

View File

@ -0,0 +1,10 @@
substitutions:
device_id: washing-machine
device_name: Washing Machine
ip_address: !secret washing-machine-ip
ota_pwd: !secret washing-machine-ota-pwd
api_pwd: !secret washing-machine-api-pwd
ap_wifi_pwd: !secret washing-machine-ap-wifi-pwd
packages:
feit_dimmer: !include ../packages/topgreener_smart_plug.yaml

View File

@ -0,0 +1,69 @@
# Model TGWF115PQM
substitutions:
platform: ESP8266
board: esp01_1m
restore_mode: ALWAYS_ON
external_components:
- source: github://cbpowell/ESPSense
components: [ espsense ]
packages:
base: !include device_base.yaml
logger: !include logger/logger_no_serial.yaml
binary_sensor:
- platform: gpio
id: button
pin:
number: GPIO3
inverted: True
on_press:
then:
- switch.toggle: relay
espsense:
plugs:
- name: ${device_name}
power_sensor: power
voltage: 120
sensor:
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: True
cf_pin: GPIO04
cf1_pin: GPIO5
current_resistor: "0.0019"
voltage_divider: "2150"
current:
name: ${device_name} Current
unit_of_measurement: A
power:
id: power
name: ${device_name} Power
unit_of_measurement: W
initial_mode: CURRENT
change_mode_every: 4294967295
update_interval: 2s
- platform: total_daily_energy
name: ${device_name}
power_id: power
method: trapezoid
min_save_interval: 10min
status_led:
pin:
number: GPIO13
inverted: False
switch:
- platform: gpio
name: ${device_name} Power Switch
id: relay
pin: GPIO14
restore_mode: ${restore_mode}
time:
- platform: homeassistant

View File

@ -59,7 +59,7 @@ if ($Args[0] -eq "add")
$secrets["${device}-ota-pwd"] = -join ((48..57) + (65..90) + (97..122) | Get-Random -Count 16 | % {[char]$_}) $secrets["${device}-ota-pwd"] = -join ((48..57) + (65..90) + (97..122) | Get-Random -Count 16 | % {[char]$_})
$secrets["${device}-ap-pwd"] = -join ((48..57) + (65..90) + (97..122) | Get-Random -Count 16 | % {[char]$_}) $secrets["${device}-ap-pwd"] = -join ((48..57) + (65..90) + (97..122) | Get-Random -Count 16 | % {[char]$_})
Out-File $PSScriptRoot\..\secrets.yaml -InputObject (ConvertTo-YAML $secrets) Out-File $PSScriptRoot\..\secrets.yaml -InputObject (ConvertTo-YAML $secrets) -Encoding utf8
} }
if (!$secrets.Contains("${device}-ip")) if (!$secrets.Contains("${device}-ip"))