Skip to content

Instantly share code, notes, and snippets.

@oki
Created December 7, 2022 16:53
Show Gist options
  • Save oki/c5ed412d07527f6086c4fe2a93558ab2 to your computer and use it in GitHub Desktop.
Save oki/c5ed412d07527f6086c4fe2a93558ab2 to your computer and use it in GitHub Desktop.
Momentary switch configuration for light and iTL-16-20-230 16A 2NO 230VAC/110VDC Acti9 A9C30812 Schneider relay
mqtt:
discovery: true
broker: localhost
username: xxx
password: xxx
port: xxx
birth_message:
topic: 'hass/status'
payload: 'online'
will_message:
topic: 'hass/status'
payload: 'offline'
light:
- schema: template
unique_id: light.work1
name: "Work 1"
state_topic: "boneio1/binary_sensor/in_12/state"
state_template: "{{ value|lower }}"
command_topic: "boneio1/switch/relay_20/command"
command_on_template: "TOGGLE"
command_off_template: "TOGGLE"
retain: false
- platform: gpio
id: relay_20
name: "Relay_20"
pin:
pcf8574: pcf_1
# Use pin number 12
number: 3
mode:
output: true
inverted: true
on_turn_on:
- delay: 200ms
- switch.turn_off: relay_20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment