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.
|
||||
fast_connect: true
|
||||
|
||||
network:
|
||||
enable_ipv6: true
|
||||
|
||||
time:
|
||||
- platform: homeassistant
|
||||
id: homeassistant_time
|
||||
|
|
166
pm6006.yaml
166
pm6006.yaml
|
@ -32,87 +32,89 @@ remote_transmitter:
|
|||
number: GPIO13
|
||||
carrier_duty_percent: 100%
|
||||
|
||||
switch:
|
||||
- platform: template
|
||||
name: "PM6006 power"
|
||||
icon: "mdi:power"
|
||||
lambda: |-
|
||||
if (id(pm6006_power_sense).state) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
turn_on_action:
|
||||
if:
|
||||
condition:
|
||||
binary_sensor.is_off: pm6006_power_sense
|
||||
then:
|
||||
- remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 0x0C
|
||||
# Needs to be sent twice to reliably wake up.
|
||||
repeat: 2
|
||||
- delay: 500ms
|
||||
- if:
|
||||
# However, sometimes it turns on then off. Turn on again if so.
|
||||
condition:
|
||||
binary_sensor.is_off: pm6006_power_sense
|
||||
then:
|
||||
- remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 0x0C
|
||||
repeat: 2
|
||||
turn_off_action:
|
||||
if:
|
||||
condition:
|
||||
binary_sensor.is_on: pm6006_power_sense
|
||||
then:
|
||||
- remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 0x0C
|
||||
repeat: 2
|
||||
- delay: 500ms
|
||||
- if:
|
||||
# However, sometimes it doesn't turn off.
|
||||
condition:
|
||||
binary_sensor.is_on: pm6006_power_sense
|
||||
then:
|
||||
- remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 0x0C
|
||||
repeat: 2
|
||||
- platform: template
|
||||
name: "PM6006 volume up"
|
||||
icon: "mdi:volume-plus"
|
||||
turn_on_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 16
|
||||
turn_off_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 16
|
||||
- platform: template
|
||||
name: "PM6006 volume down"
|
||||
icon: "mdi:volume-minus"
|
||||
turn_on_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 17
|
||||
turn_off_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 17
|
||||
- platform: template
|
||||
name: "PM6006 mute"
|
||||
icon: "mdi:volume-mute"
|
||||
turn_on_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 13
|
||||
turn_off_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 13
|
||||
packages:
|
||||
pm6006:
|
||||
switch:
|
||||
- platform: template
|
||||
name: "PM6006 power"
|
||||
icon: "mdi:power"
|
||||
lambda: |-
|
||||
if (id(pm6006_power_sense).state) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
turn_on_action:
|
||||
if:
|
||||
condition:
|
||||
binary_sensor.is_off: pm6006_power_sense
|
||||
then:
|
||||
- remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 0x0C
|
||||
# Needs to be sent twice to reliably wake up.
|
||||
repeat: 2
|
||||
- delay: 500ms
|
||||
- if:
|
||||
# However, sometimes it turns on then off. Turn on again if so.
|
||||
condition:
|
||||
binary_sensor.is_off: pm6006_power_sense
|
||||
then:
|
||||
- remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 0x0C
|
||||
repeat: 2
|
||||
turn_off_action:
|
||||
if:
|
||||
condition:
|
||||
binary_sensor.is_on: pm6006_power_sense
|
||||
then:
|
||||
- remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 0x0C
|
||||
repeat: 2
|
||||
- delay: 500ms
|
||||
- if:
|
||||
# However, sometimes it doesn't turn off.
|
||||
condition:
|
||||
binary_sensor.is_on: pm6006_power_sense
|
||||
then:
|
||||
- remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 0x0C
|
||||
repeat: 2
|
||||
- platform: template
|
||||
name: "PM6006 volume up"
|
||||
icon: "mdi:volume-plus"
|
||||
turn_on_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 16
|
||||
turn_off_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 16
|
||||
- platform: template
|
||||
name: "PM6006 volume down"
|
||||
icon: "mdi:volume-minus"
|
||||
turn_on_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 17
|
||||
turn_off_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 17
|
||||
- platform: template
|
||||
name: "PM6006 mute"
|
||||
icon: "mdi:volume-mute"
|
||||
turn_on_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 13
|
||||
turn_off_action:
|
||||
remote_transmitter.transmit_rc5:
|
||||
address: 0x10
|
||||
command: 13
|
||||
|
||||
<<: !include base.yaml
|
||||
|
|
Loading…
Reference in a new issue