Skip to content

Commit

Permalink
Added Arlec-PB89HA_Plug config
Browse files Browse the repository at this point in the history
  • Loading branch information
timsavage committed Jan 4, 2020
1 parent f96516c commit 779435a
Showing 1 changed file with 110 additions and 0 deletions.
110 changes: 110 additions & 0 deletions _devices/Arlec-PB89HA_Plug.md
@@ -1 +1,111 @@
---
title: Arlec PCB89HA Power Board
date-published: 2020-01-04
type: plug
standard: au
---
1. TOC
{:toc}

## GPIO Pinout

| Pin | Function |
|---------|------------------------------------|
| GPIO1 | LED (Inverted: true) |
| GPIO3 | Button (Inverted: true) |
| GPIO04 | Relay 2 |
| GPIO05 | Relay 1 |
| GPIO12 | Relay 4 |
| GPIO13 | Relay 3 |

## Basic Configuration

```yaml
# Basic Config
substitutions:
device_name: "arlec_PCB89HA_1"
name: "ARLEC PCB89HA"

esphome:
name: ${device_name}
comment: ${name}
platform: ESP8266
board: esp01_1m

wifi:
ssid: 'ssid'
password: 'password'

logger:
# Important! The status LED and button are on the Pins used by UART0
hardware_uart: UART1

api:
password: 'api_password'

ota:
password: 'ota_password'

status_led:
pin:
number: GPIO1
inverted: True

sensor:
- platform: uptime
name: ${name} Uptime

- platform: wifi_signal
name: ${name} Signal
update_interval: 300s

binary_sensor:
- platform: gpio
pin:
number: GPIO3
inverted: True
name: ${name} button
internal: True
on_multi_click:
# Support a single or double click to switch on each relay
- timing:
# Single click
- ON for at most 1s
- OFF for at least 0.5s
then:
- switch.toggle: relay_a

- timing:
# Double click
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 0.2s
then:
- switch.toggle: relay_b

switch:
- platform: gpio
pin: GPIO05
name: "${name} - A"
id: relay_a
restore_mode: always off

- platform: gpio
pin: GPIO04
name: "${name} - B"
id: relay_b
restore_mode: always off

- platform: gpio
pin: GPIO13
name: "${name} - C"
id: relay_c
restore_mode: always off

- platform: gpio
pin: GPIO12
name: "${name} - D"
id: relay_d
restore_mode: always off
```

0 comments on commit 779435a

Please sign in to comment.