-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
568 additions
and
126 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
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,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 |
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,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 |
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,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 |
Oops, something went wrong.