Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aneisch committed Nov 14, 2023
1 parent d6a2f56 commit 533dcbe
Show file tree
Hide file tree
Showing 6 changed files with 568 additions and 126 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Also using Grafana/Influx for graphing, both running in Docker containers on NUC
## Some statistics about my installation:
Description | value
-- | --
Lines of ESPHome YAML | 2467
Lines of ESPHome YAML | 2689
Lines of Home Assistant YAML | 8172
[Integrations](https://www.home-assistant.io/integrations/) in use | 51
Zigbee devices in [`zha`](https://www.home-assistant.io/integrations/zha/) | 26
Expand Down Expand Up @@ -90,17 +90,17 @@ Entities in the [`remote`](https://www.home-assistant.io/components/remote) doma
Entities in the [`scene`](https://www.home-assistant.io/components/scene) domain | 2
Entities in the [`script`](https://www.home-assistant.io/components/script) domain | 40
Entities in the [`select`](https://www.home-assistant.io/components/select) domain | 2
Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 383
Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 387
Entities in the [`siren`](https://www.home-assistant.io/components/siren) domain | 1
Entities in the [`sun`](https://www.home-assistant.io/components/sun) domain | 1
Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 157
Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 160
Entities in the [`timer`](https://www.home-assistant.io/components/timer) domain | 2
Entities in the [`tts`](https://www.home-assistant.io/components/tts) domain | 1
Entities in the [`update`](https://www.home-assistant.io/components/update) domain | 3
Entities in the [`vacuum`](https://www.home-assistant.io/components/vacuum) domain | 1
Entities in the [`weather`](https://www.home-assistant.io/components/weather) domain | 2
Entities in the [`zone`](https://www.home-assistant.io/components/zone) domain | 6
**Total state objects** | **1116**
**Total state objects** | **1123**
## The HACS integrations/plugins that I use:
**Appdaemon**:<br>
[aneisch/follow_me_appdaemon](https://github.com/aneisch/follow_me_appdaemon)<br>
Expand Down
120 changes: 120 additions & 0 deletions extras/esphome/wyze_plug_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
substitutions:
name: wyze_plug_1
friendly_name: "Wyze Plug 1"
# Higher value gives lower watt readout
current_res: "0.001"
# Lower value gives lower voltage readout
voltage_div: "770"

esphome:
name: ${name}
platform: ESP32
board: esp-wrover-kit

<<: !include common.yaml

switch:
- platform: gpio
name: ${friendly_name} Relay1
pin:
number: GPIO15
inverted: false
id: relay1
on_turn_on:
- light.turn_on: relay1_led
on_turn_off:
- light.turn_off: relay1_led
- platform: gpio
name: ${friendly_name} Relay2
pin:
number: GPIO32
inverted: false
id: relay2
on_turn_on:
- light.turn_on: relay2_led
on_turn_off:
- light.turn_off: relay2_led
- platform: restart
name: ${friendly_name} Restart

output:
- platform: gpio
pin: GPIO19
inverted: True
id: relay1_led_gpio
- platform: gpio
pin: GPIO16
inverted: True
id: relay2_led_gpio

light:
- platform: binary
name: "Relay1 LED"
id: relay1_led
internal: true
output: relay1_led_gpio
- platform: binary
name: "Relay2 LED"
id: relay2_led
internal: true
output: relay2_led_gpio

sensor:
- platform: adc
pin: GPIO34
name: "${friendly_name} LUX"
update_interval: 10s
attenuation: 11db
device_class: illuminance
unit_of_measurement: lx
- platform: hlw8012
sel_pin:
number: GPIO25
inverted: true
cf_pin: GPIO27
cf1_pin: GPIO26
current_resistor: ${current_res}
voltage_divider: ${voltage_div}
change_mode_every: 3
update_interval: 3s
current:
name: "${friendly_name} Amps"
unit_of_measurement: A
accuracy_decimals: 2
voltage:
name: "${friendly_name} Volts"
unit_of_measurement: V
accuracy_decimals: 1
power:
name: "${friendly_name} Watts"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- calibrate_linear:
- 0.0 -> 0.0
- 134 -> 58

binary_sensor:
- platform: gpio
internal: true
pin:
number: GPIO18
mode: INPUT_PULLDOWN
inverted: True
name: ${friendly_name} Button1
on_press:
- switch.toggle: relay1
- platform: gpio
internal: true
pin:
number: GPIO17
mode: INPUT_PULLDOWN
inverted: True
name: ${friendly_name} Button2
on_press:
- switch.toggle: relay2

status_led:
pin:
number: GPIO5
inverted: true
120 changes: 120 additions & 0 deletions extras/esphome/wyze_plug_2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
substitutions:
name: wyze_plug_2
friendly_name: "Wyze Plug 2"
# Higher value gives lower watt readout
current_res: "0.001"
# Lower value gives lower voltage readout
voltage_div: "770"

esphome:
name: ${name}
platform: ESP32
board: esp-wrover-kit

<<: !include common.yaml

switch:
- platform: gpio
name: ${friendly_name} Relay1
pin:
number: GPIO15
inverted: false
id: relay1
on_turn_on:
- light.turn_on: relay1_led
on_turn_off:
- light.turn_off: relay1_led
- platform: gpio
name: ${friendly_name} Relay2
pin:
number: GPIO32
inverted: false
id: relay2
on_turn_on:
- light.turn_on: relay2_led
on_turn_off:
- light.turn_off: relay2_led
- platform: restart
name: ${friendly_name} Restart

output:
- platform: gpio
pin: GPIO19
inverted: True
id: relay1_led_gpio
- platform: gpio
pin: GPIO16
inverted: True
id: relay2_led_gpio

light:
- platform: binary
name: "Relay1 LED"
id: relay1_led
internal: true
output: relay1_led_gpio
- platform: binary
name: "Relay2 LED"
id: relay2_led
internal: true
output: relay2_led_gpio

sensor:
- platform: adc
pin: GPIO34
name: "${friendly_name} LUX"
update_interval: 10s
attenuation: 11db
device_class: illuminance
unit_of_measurement: lx
- platform: hlw8012
sel_pin:
number: GPIO25
inverted: true
cf_pin: GPIO27
cf1_pin: GPIO26
current_resistor: ${current_res}
voltage_divider: ${voltage_div}
change_mode_every: 3
update_interval: 3s
current:
name: "${friendly_name} Amps"
unit_of_measurement: A
accuracy_decimals: 2
voltage:
name: "${friendly_name} Volts"
unit_of_measurement: V
accuracy_decimals: 1
power:
name: "${friendly_name} Watts"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- calibrate_linear:
- 0.0 -> 0.0
- 134 -> 58

binary_sensor:
- platform: gpio
internal: true
pin:
number: GPIO18
mode: INPUT_PULLDOWN
inverted: True
name: ${friendly_name} Button1
on_press:
- switch.toggle: relay1
- platform: gpio
internal: true
pin:
number: GPIO17
mode: INPUT_PULLDOWN
inverted: True
name: ${friendly_name} Button2
on_press:
- switch.toggle: relay2

status_led:
pin:
number: GPIO5
inverted: true
120 changes: 120 additions & 0 deletions extras/esphome/wyze_plug_3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
substitutions:
name: wyze_plug_3
friendly_name: "Wyze Plug 3"
# Higher value gives lower watt readout
current_res: "0.001"
# Lower value gives lower voltage readout
voltage_div: "770"

esphome:
name: ${name}
platform: ESP32
board: esp-wrover-kit

<<: !include common.yaml

switch:
- platform: gpio
name: ${friendly_name} Relay1
pin:
number: GPIO15
inverted: false
id: relay1
on_turn_on:
- light.turn_on: relay1_led
on_turn_off:
- light.turn_off: relay1_led
- platform: gpio
name: ${friendly_name} Relay2
pin:
number: GPIO32
inverted: false
id: relay2
on_turn_on:
- light.turn_on: relay2_led
on_turn_off:
- light.turn_off: relay2_led
- platform: restart
name: ${friendly_name} Restart

output:
- platform: gpio
pin: GPIO19
inverted: True
id: relay1_led_gpio
- platform: gpio
pin: GPIO16
inverted: True
id: relay2_led_gpio

light:
- platform: binary
name: "Relay1 LED"
id: relay1_led
internal: true
output: relay1_led_gpio
- platform: binary
name: "Relay2 LED"
id: relay2_led
internal: true
output: relay2_led_gpio

sensor:
- platform: adc
pin: GPIO34
name: "${friendly_name} LUX"
update_interval: 10s
attenuation: 11db
device_class: illuminance
unit_of_measurement: lx
- platform: hlw8012
sel_pin:
number: GPIO25
inverted: true
cf_pin: GPIO27
cf1_pin: GPIO26
current_resistor: ${current_res}
voltage_divider: ${voltage_div}
change_mode_every: 3
update_interval: 3s
current:
name: "${friendly_name} Amps"
unit_of_measurement: A
accuracy_decimals: 2
voltage:
name: "${friendly_name} Volts"
unit_of_measurement: V
accuracy_decimals: 1
power:
name: "${friendly_name} Watts"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- calibrate_linear:
- 0.0 -> 0.0
- 134 -> 58

binary_sensor:
- platform: gpio
internal: true
pin:
number: GPIO18
mode: INPUT_PULLDOWN
inverted: True
name: ${friendly_name} Button1
on_press:
- switch.toggle: relay1
- platform: gpio
internal: true
pin:
number: GPIO17
mode: INPUT_PULLDOWN
inverted: True
name: ${friendly_name} Button2
on_press:
- switch.toggle: relay2

status_led:
pin:
number: GPIO5
inverted: true
Loading

0 comments on commit 533dcbe

Please sign in to comment.