Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible-warpzone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infrastruktur
ansible-warpzone
Commits
56a1198c
Commit
56a1198c
authored
2 years ago
by
nandXor
Browse files
Options
Downloads
Patches
Plain Diff
Gosund Plug geplugged
parent
6a0fc59f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
intern/docker_esphome/templates/config/esphome_plug04.yaml
+1
-1
1 addition, 1 deletion
intern/docker_esphome/templates/config/esphome_plug04.yaml
intern/docker_esphome/templates/config/esphome_plug05.yaml
+90
-0
90 additions, 0 deletions
intern/docker_esphome/templates/config/esphome_plug05.yaml
with
91 additions
and
1 deletion
intern/docker_esphome/templates/config/esphome_plug04.yaml
+
1
−
1
View file @
56a1198c
...
...
@@ -36,4 +36,4 @@ switch:
name
:
"
{{
devicename
}}
Relay"
pin
:
GPIO12
id
:
"
relay"
restore_mode
:
RESTORE_DEFAULT_OFF
\ No newline at end of file
restore_mode
:
RESTORE_DEFAULT_OFF
This diff is collapsed.
Click to expand it.
intern/docker_esphome/templates/config/esphome_plug05.yaml
0 → 100644
+
90
−
0
View file @
56a1198c
{
%
set devicename = "esphome_plug04" %
}
{
%
include "/includes/ansible.inc.yaml" %
}
{
%
include "/includes/board.esp01_1m.inc.yaml" %
}
{
%
include "/includes/common.inc.yaml" %
}
# force newline
on_message
:
-
topic
:
ESPHome/{{ devicename }}/state/command
payload
:
"
ON"
then
:
-
switch.turn_on
:
relay
-
topic
:
ESPHome/{{ devicename }}/state/command
payload
:
"
OFF"
then
:
-
switch.turn_off
:
relay
substitutions
:
plug_name
:
esphome_plug05
# Higher value gives lower watt readout
current_res
:
"
0.00221"
# Lower value gives lower voltage readout
voltage_div
:
"
920"
binary_sensor
:
# Binary sensor for the button press
-
platform
:
gpio
name
:
"
${plug_name}_button"
pin
:
number
:
GPIO3
inverted
:
true
on_press
:
-
switch.toggle
:
relay
switch
:
-
platform
:
gpio
id
:
relay
name
:
"
${plug_name}_Relay"
restore_mode
:
ALWAYS_OFF
pin
:
GPIO14
on_turn_on
:
-
light.turn_on
:
led
on_turn_off
:
-
light.turn_off
:
led
sensor
:
-
platform
:
hlw8012
sel_pin
:
number
:
GPIO12
inverted
:
True
cf_pin
:
GPIO04
cf1_pin
:
GPIO05
current_resistor
:
${current_res}
voltage_divider
:
${voltage_div}
current
:
name
:
"
${plug_name}_Amperage"
unit_of_measurement
:
A
voltage
:
name
:
"
${plug_name}_Voltage"
unit_of_measurement
:
V
power
:
name
:
"
${plug_name}_Wattage"
unit_of_measurement
:
W
id
:
"
${plug_name}_Wattage"
change_mode_every
:
8
update_interval
:
10s
-
platform
:
wifi_signal
name
:
"
WiFi
Signal"
update_interval
:
60s
output
:
# Relay state led
-
platform
:
esp8266_pwm
id
:
state_led
pin
:
number
:
GPIO1
inverted
:
true
light
:
# Relay state light
-
platform
:
monochromatic
output
:
state_led
id
:
led
# Uses the red LED as a status indicator
status_led
:
pin
:
number
:
GPIO13
inverted
:
true
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment