Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add POWRUI AHR-079 Power Strip #22

Merged
merged 2 commits into from
Nov 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions _devices/POWRUI-AHR-079/POWRUI-AHR-079.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
title: POWRUI AHR-079
date-published: 2020-09-29
type: plug
standard: us
---

1. TOC
{:toc}

## GPIO Pinout

| Pin | Function |
|--------|---------------------------------------|
| GPIO03 | Button 1 (Leftmost, closest to cable) |
| GPIO04 | Button 3 |
| GPIO05 | Relay 1 (Leftmost, closest to cable) |
| GPIO12 | Relay 3 |
| GPIO13 | Button 4 (Rightmost, closest to USB) |
| GPIO14 | Relay 2 |
| GPIO15 | Relay 4 (Rightmost, closest to USB) |
| GPIO16 | Button 2 |

Pinout from [Powrui AHR-079 Power Strip Template for Tasmota](https://templates.blakadder.com/powrui_AHR-079.html)

## Basic Configuration

```yaml
substitutions:
devicename: ahr_079
friendlyname: POWRUI AHR-079

esphome:
name: $devicename
platform: ESP8266
board: esp01_1m

wifi:
ssid: !secret iot_wifi_ssid
password: !secret iot_wifi_password
fast_connect: true

# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${devicename} Fallback"
password: !secret fallback_wifi_password

captive_portal:

# Enable logging
logger:
baud_rate: 0

# Enable Home Assistant API
api:

ota:
password: !secret ota_pw

# Buttons (not exposed in HA)
binary_sensor:
- platform: gpio
name: "${friendlyname} Button 1"
id: button1
internal: true
pin:
number: GPIO3
on_press:
then:
- switch.toggle:
id: relay1

- platform: gpio
name: "${friendlyname} Button 2"
id: button2
internal: true
pin:
number: GPIO16
on_press:
then:
- switch.toggle:
id: relay2

- platform: gpio
name: "${friendlyname} Button 3"
id: button3
internal: true
pin:
number: GPIO4
on_press:
then:
- switch.toggle:
id: relay3

- platform: gpio
name: "${friendlyname} Button 4"
id: button4
internal: true
pin:
number: GPIO13
on_press:
then:
- switch.toggle:
id: relay4

# Relays/Outlets
switch:
- platform: gpio
name: "${friendlyname} Outlet 1"
icon: mdi:power-socket-us
id: relay1
pin:
number: GPIO5
restore_mode: RESTORE_DEFAULT_ON

- platform: gpio
name: "${friendlyname} Outlet 2"
icon: mdi:power-socket-us
id: relay2
pin:
number: GPIO14
restore_mode: RESTORE_DEFAULT_ON

- platform: gpio
name: "${friendlyname} Outlet 3"
icon: mdi:power-socket-us
id: relay3
pin:
number: GPIO12
restore_mode: RESTORE_DEFAULT_ON

- platform: gpio
name: "${friendlyname} Outlet 4"
icon: mdi:power-socket-us
id: relay4
pin:
number: GPIO15
restore_mode: RESTORE_DEFAULT_ON
```