Compare commits
2 commits
4d3a6f6e21
...
52a48817ea
Author | SHA1 | Date | |
---|---|---|---|
52a48817ea | |||
a55cd504a1 |
2 changed files with 87 additions and 82 deletions
|
@ -37,6 +37,9 @@ wifi:
|
||||||
# Connect to the first AP found.
|
# Connect to the first AP found.
|
||||||
fast_connect: true
|
fast_connect: true
|
||||||
|
|
||||||
|
network:
|
||||||
|
enable_ipv6: true
|
||||||
|
|
||||||
time:
|
time:
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: homeassistant_time
|
id: homeassistant_time
|
||||||
|
|
166
pm6006.yaml
166
pm6006.yaml
|
@ -32,87 +32,89 @@ remote_transmitter:
|
||||||
number: GPIO13
|
number: GPIO13
|
||||||
carrier_duty_percent: 100%
|
carrier_duty_percent: 100%
|
||||||
|
|
||||||
switch:
|
packages:
|
||||||
- platform: template
|
pm6006:
|
||||||
name: "PM6006 power"
|
switch:
|
||||||
icon: "mdi:power"
|
- platform: template
|
||||||
lambda: |-
|
name: "PM6006 power"
|
||||||
if (id(pm6006_power_sense).state) {
|
icon: "mdi:power"
|
||||||
return true;
|
lambda: |-
|
||||||
} else {
|
if (id(pm6006_power_sense).state) {
|
||||||
return false;
|
return true;
|
||||||
}
|
} else {
|
||||||
turn_on_action:
|
return false;
|
||||||
if:
|
}
|
||||||
condition:
|
turn_on_action:
|
||||||
binary_sensor.is_off: pm6006_power_sense
|
if:
|
||||||
then:
|
condition:
|
||||||
- remote_transmitter.transmit_rc5:
|
binary_sensor.is_off: pm6006_power_sense
|
||||||
address: 0x10
|
then:
|
||||||
command: 0x0C
|
- remote_transmitter.transmit_rc5:
|
||||||
# Needs to be sent twice to reliably wake up.
|
address: 0x10
|
||||||
repeat: 2
|
command: 0x0C
|
||||||
- delay: 500ms
|
# Needs to be sent twice to reliably wake up.
|
||||||
- if:
|
repeat: 2
|
||||||
# However, sometimes it turns on then off. Turn on again if so.
|
- delay: 500ms
|
||||||
condition:
|
- if:
|
||||||
binary_sensor.is_off: pm6006_power_sense
|
# However, sometimes it turns on then off. Turn on again if so.
|
||||||
then:
|
condition:
|
||||||
- remote_transmitter.transmit_rc5:
|
binary_sensor.is_off: pm6006_power_sense
|
||||||
address: 0x10
|
then:
|
||||||
command: 0x0C
|
- remote_transmitter.transmit_rc5:
|
||||||
repeat: 2
|
address: 0x10
|
||||||
turn_off_action:
|
command: 0x0C
|
||||||
if:
|
repeat: 2
|
||||||
condition:
|
turn_off_action:
|
||||||
binary_sensor.is_on: pm6006_power_sense
|
if:
|
||||||
then:
|
condition:
|
||||||
- remote_transmitter.transmit_rc5:
|
binary_sensor.is_on: pm6006_power_sense
|
||||||
address: 0x10
|
then:
|
||||||
command: 0x0C
|
- remote_transmitter.transmit_rc5:
|
||||||
repeat: 2
|
address: 0x10
|
||||||
- delay: 500ms
|
command: 0x0C
|
||||||
- if:
|
repeat: 2
|
||||||
# However, sometimes it doesn't turn off.
|
- delay: 500ms
|
||||||
condition:
|
- if:
|
||||||
binary_sensor.is_on: pm6006_power_sense
|
# However, sometimes it doesn't turn off.
|
||||||
then:
|
condition:
|
||||||
- remote_transmitter.transmit_rc5:
|
binary_sensor.is_on: pm6006_power_sense
|
||||||
address: 0x10
|
then:
|
||||||
command: 0x0C
|
- remote_transmitter.transmit_rc5:
|
||||||
repeat: 2
|
address: 0x10
|
||||||
- platform: template
|
command: 0x0C
|
||||||
name: "PM6006 volume up"
|
repeat: 2
|
||||||
icon: "mdi:volume-plus"
|
- platform: template
|
||||||
turn_on_action:
|
name: "PM6006 volume up"
|
||||||
remote_transmitter.transmit_rc5:
|
icon: "mdi:volume-plus"
|
||||||
address: 0x10
|
turn_on_action:
|
||||||
command: 16
|
remote_transmitter.transmit_rc5:
|
||||||
turn_off_action:
|
address: 0x10
|
||||||
remote_transmitter.transmit_rc5:
|
command: 16
|
||||||
address: 0x10
|
turn_off_action:
|
||||||
command: 16
|
remote_transmitter.transmit_rc5:
|
||||||
- platform: template
|
address: 0x10
|
||||||
name: "PM6006 volume down"
|
command: 16
|
||||||
icon: "mdi:volume-minus"
|
- platform: template
|
||||||
turn_on_action:
|
name: "PM6006 volume down"
|
||||||
remote_transmitter.transmit_rc5:
|
icon: "mdi:volume-minus"
|
||||||
address: 0x10
|
turn_on_action:
|
||||||
command: 17
|
remote_transmitter.transmit_rc5:
|
||||||
turn_off_action:
|
address: 0x10
|
||||||
remote_transmitter.transmit_rc5:
|
command: 17
|
||||||
address: 0x10
|
turn_off_action:
|
||||||
command: 17
|
remote_transmitter.transmit_rc5:
|
||||||
- platform: template
|
address: 0x10
|
||||||
name: "PM6006 mute"
|
command: 17
|
||||||
icon: "mdi:volume-mute"
|
- platform: template
|
||||||
turn_on_action:
|
name: "PM6006 mute"
|
||||||
remote_transmitter.transmit_rc5:
|
icon: "mdi:volume-mute"
|
||||||
address: 0x10
|
turn_on_action:
|
||||||
command: 13
|
remote_transmitter.transmit_rc5:
|
||||||
turn_off_action:
|
address: 0x10
|
||||||
remote_transmitter.transmit_rc5:
|
command: 13
|
||||||
address: 0x10
|
turn_off_action:
|
||||||
command: 13
|
remote_transmitter.transmit_rc5:
|
||||||
|
address: 0x10
|
||||||
|
command: 13
|
||||||
|
|
||||||
<<: !include base.yaml
|
<<: !include base.yaml
|
||||||
|
|
Loading…
Reference in a new issue