Skip to content
Snippets Groups Projects
Commit 02a38830 authored by 3d's avatar 3d
Browse files

change plug behavior; auto generate topics

parent dfd99ead
No related branches found
No related tags found
No related merge requests found
......@@ -18,12 +18,15 @@ external_components:
components: [ obegraensad_panel ]
refresh: 0s
{% include "/includes/common.inc.yaml" %}
{% include "/includes/common.inc.yaml" %}
# force newline
on_message:
- topic: ESPHome/esphome_display02/light/on/state
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
then:
- light.turn_on: matrix_light
- topic: ESPHome/esphome_display02/light/off/state
- topic: ESPHome/{{ devicename }}/state/command
payload: "OFF"
then:
- light.turn_off: matrix_light
......
......@@ -3,6 +3,16 @@
{% 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
status_led:
pin:
......@@ -15,20 +25,15 @@ binary_sensor:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff S26_1 Button"
name: "{{ devicename }} Button"
on_press:
- switch.toggle: relay
- platform: status
name: "Sonoff S26_1 Status"
name: "{{ devicename }} Status"
sensor:
- platform: wifi_signal
name: "sonoffs26_1 WiFi Signal"
update_interval: 60s
switch:
- platform: gpio
name: "Sonoff S26_1 Relay"
name: "{{ devicename }} Relay"
pin: GPIO12
id: "relay"
- platform: restart
name: "sonoffs26_1 Restart"
\ No newline at end of file
restore_mode: RESTORE_DEFAULT_ON
\ No newline at end of file
......@@ -3,6 +3,16 @@
{% 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
status_led:
pin:
......@@ -15,20 +25,15 @@ binary_sensor:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff S26_1 Button"
name: "{{ devicename }} Button"
on_press:
- switch.toggle: relay
- platform: status
name: "Sonoff S26_1 Status"
name: "{{ devicename }} Status"
sensor:
- platform: wifi_signal
name: "sonoffs26_1 WiFi Signal"
update_interval: 60s
switch:
- platform: gpio
name: "Sonoff S26_1 Relay"
name: "{{ devicename }} Relay"
pin: GPIO12
id: "relay"
- platform: restart
name: "sonoffs26_1 Restart"
\ No newline at end of file
restore_mode: RESTORE_DEFAULT_ON
\ No newline at end of file
......@@ -3,6 +3,16 @@
{% 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
status_led:
pin:
......@@ -15,20 +25,15 @@ binary_sensor:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff S26_1 Button"
name: "{{ devicename }} Button"
on_press:
- switch.toggle: relay
- platform: status
name: "Sonoff S26_1 Status"
name: "{{ devicename }} Status"
sensor:
- platform: wifi_signal
name: "sonoffs26_1 WiFi Signal"
update_interval: 60s
switch:
- platform: gpio
name: "Sonoff S26_1 Relay"
name: "{{ devicename }} Relay"
pin: GPIO12
id: "relay"
- platform: restart
name: "sonoffs26_1 Restart"
\ No newline at end of file
restore_mode: RESTORE_DEFAULT_ON
\ No newline at end of file
......@@ -3,6 +3,16 @@
{% 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
status_led:
pin:
......@@ -15,20 +25,15 @@ binary_sensor:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff S26_1 Button"
name: "{{ devicename }} Button"
on_press:
- switch.toggle: relay
- platform: status
name: "Sonoff S26_1 Status"
name: "{{ devicename }} Status"
sensor:
- platform: wifi_signal
name: "sonoffs26_1 WiFi Signal"
update_interval: 60s
switch:
- platform: gpio
name: "Sonoff S26_1 Relay"
name: "{{ devicename }} Relay"
pin: GPIO12
id: "relay"
- platform: restart
name: "sonoffs26_1 Restart"
\ No newline at end of file
restore_mode: RESTORE_DEFAULT_OFF
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment