Compare commits

...

2 commits

Author SHA1 Message Date
52a48817ea autohuttli: enable IPv6
Some checks reported errors
continuous-integration/drone/push Build was killed
2024-10-28 19:17:59 +00:00
a55cd504a1 autohuttli: split the switches into a package so the app and base merge 2024-10-28 19:17:36 +00:00
2 changed files with 87 additions and 82 deletions

View file

@ -37,6 +37,9 @@ wifi:
# Connect to the first AP found.
fast_connect: true
network:
enable_ipv6: true
time:
- platform: homeassistant
id: homeassistant_time

View file

@ -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