substitutions:
adc_io: A0
light_sensor_io: GPIO3 #RX
motion_sensor_io: GPIO4
key_io: GPIO5
am2302_io: GPIO12
transmitter_io: GPIO13
receiver_io: GPIO14
led_io: GPIO16
output:
- platform: gpio
id: led
pin: $led_io
light:
- platform: binary
name: "Status light"
id: status_light
output: led
sensor:
- platform: dht
pin:
number: $am2302_io
model: DHT22
temperature:
name: "Bathroom Temperature"
humidity:
name: "Bathroom Humidity"
update_interval: 20s
# - platform: adc
# name: "Light Sensor"
# unit_of_measurement: lx
# icon: mdi:white-balance-incandescent
# id: "adc1"
# pin: $adc_io
# filters:
# - multiply: 5
# update_interval: 10s
remote_transmitter:
pin:
number: $transmitter_io
carrier_duty_percent: 50%
id: irtransmitter
remote_receiver:
pin:
number: $receiver_io
inverted: True
dump: all
binary_sensor:
- platform: gpio
pin:
number: $light_sensor_io
mode: INPUT_PULLUP
inverted: True
name: "Bathroom Light Sensor"
id: light_sensor
device_class: light
- platform: gpio
pin:
number: $motion_sensor_io
name: "Shower Motion Sensor"
device_class: motion
filters:
- delayed_off: 10s
on_press:
then:
- light.turn_on: status_light
on_release:
then:
- light.turn_off: status_light
- platform: gpio
name: "reset key"
id: "key1"
device_class: power
pin:
number: $key_io
mode: INPUT_PULLUP
- platform: remote_receiver
name: "Off"
panasonic:
address: 0x4004
command: 0x0B244D08
- platform: remote_receiver
name: "Heat"
panasonic:
address: 0x4004
command: 0x0B244D48
- platform: remote_receiver
name: "Ventilate"
panasonic:
address: 0x4004
command: 0x0B244D88
- platform: remote_receiver
name: "Cool"
panasonic:
address: 0x4004
command: 0x0B244D28
- platform: remote_receiver
name: "Dry"
panasonic:
address: 0x4004
command: 0x0B244DC8
switch:
- platform: template
name: "Off"
turn_on_action:
remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
repeat:
times: 2
code: [3551,-1685,504,-379,503,-1249,505,-378,504,-378,504,-378,557,-325,504,-378,513,-370,502,-380,502,-379,528,-354,502,-379,529,-352,530,-1223,528,-354,530,-352,503,-378,504,-377,529,-352,530,-352,503,-1250,505,-377,505,-1248,529,-1225,532,-352,501,-378,504,-1248,505,-378,504,-381,527,-1222,505,-377,504,-379,504,-377,530,-1223,558,-324,504,-377,504,-1250,504,-1250,531,-351,531,-1223,504,-377,505,-377,530,-351,504,-377,531,-1222,532,-350,530,-352,529,-352,531,-352,504,-377,529,-353,528,-353,531,-350,504,-1249,531,-352,530,-351,505,-378,503,-377,504,-378,505,-376,504,-378,505,-377,505,-1248,505,-377,504,-378,504,-377,505,-377,531,-351,529,-1225,504,-378,504,-1250,504,-378,559,-323,503,-379,504,-377,504,-377,502,-380,530,-1224,530,-1224,504,-378,505,-377,530,-351,531,-351,503,-378,503,-380,503,-378,504,-379,502,-1251,528,-353,531,-1222,527,-1226,529,-354,502,-379,504,-379,502,-379,502,-1252,503]
- platform: template
name: "Heat"
turn_on_action:
remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
repeat:
times: 2
code: [3606,-1650,482,-400,480,-1273,510,-371,507,-374,512,-370,480,-402,509,-372,482,-400,509,-373,514,-367,510,-372,509,-372,506,-375,538,-1216,509,-373,508,-373,510,-372,508,-372,541,-341,538,-344,511,-1242,482,-400,508,-1245,509,-1244,511,-372,509,-370,481,-1273,481,-400,510,-373,481,-1272,511,-371,509,-372,511,-370,481,-1272,511,-370,509,-373,481,-1271,539,-1215,510,-372,510,-1244,506,-375,510,-1243,511,-372,479,-402,510,-1243,511,-371,509,-372,482,-401,508,-1245,480,-402,479,-1274,482,-400,507,-375,482,-1272,511,-370,509,-373,481,-401,481,-399,509,-373,510,-371,507,-375,511,-370,507,-1246,510,-372,509,-1245,481,-401,479,-402,507,-375,481,-1271,509,-374,509,-1244,509,-373,508,-1246,508,-374,537,-1216,509,-374,506,-375,481,-1272,482,-1273,506,-376,482,-400,508,-372,482,-401,479,-401,479,-403,506,-376,508,-374,506,-1247,480,-1274,509,-373,479,-1274,507,-375,506,-376,480,-402,505,-376,480,-1274,508]
- platform: template
name: "Ventilate"
turn_on_action:
remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
repeat:
times: 2
code: [3545,-1710,449,-433,449,-1305,448,-434,448,-434,477,-404,480,-403,448,-432,479,-404,507,-375,478,-402,479,-402,480,-402,477,-405,480,-1273,480,-403,478,-403,477,-404,480,-402,507,-374,482,-400,479,-1276,478,-403,508,-1246,476,-1277,507,-375,508,-374,508,-1245,509,-373,507,-374,480,-1274,508,-375,509,-372,478,-404,508,-1245,507,-374,508,-374,537,-1216,478,-1275,479,-403,506,-1249,538,-1216,508,-373,510,-372,480,-402,536,-1217,506,-376,481,-400,508,-374,506,-1248,511,-371,509,-1244,509,-374,508,-374,480,-1274,511,-370,506,-376,534,-348,508,-373,507,-375,510,-371,508,-374,509,-372,481,-1273,510,-372,510,-1244,481,-401,509,-372,481,-400,510,-1244,510,-372,481,-1273,510,-371,512,-1243,510,-372,536,-1217,509,-374,509,-372,481,-1273,510,-1244,511,-372,508,-374,509,-372,480,-400,510,-372,509,-373,538,-344,511,-371,539,-1215,487,-394,513,-1241,508,-1244,479,-404,511,-371,510,-373,510,-371,510,-1243,510]
- platform: template
name: "Cool"
turn_on_action:
remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
repeat:
times: 2
code: [3548,-1687,500,-382,501,-1252,450,-432,527,-355,502,-380,450,-433,500,-381,501,-381,500,-382,502,-379,451,-431,500,-382,450,-432,502,-1252,486,-396,450,-433,500,-382,449,-431,500,-382,499,-383,499,-1254,500,-382,450,-1304,449,-1305,449,-433,449,-432,499,-1254,450,-433,498,-384,449,-1304,450,-433,449,-433,449,-433,499,-1255,499,-382,448,-434,498,-1256,500,-1255,498,-384,497,-1259,444,-438,496,-385,496,-1257,445,-437,444,-1310,445,-438,445,-438,445,-437,446,-1309,446,-436,446,-1308,446,-436,448,-433,449,-1305,449,-434,449,-433,449,-432,508,-374,479,-402,534,-348,478,-403,507,-375,508,-1246,511,-370,481,-1274,506,-375,510,-372,509,-372,482,-1270,482,-401,508,-1245,509,-372,481,-1274,507,-375,478,-1275,480,-402,480,-402,477,-1277,505,-1249,503,-380,476,-406,477,-403,478,-403,479,-403,478,-404,477,-404,476,-406,504,-1250,478,-1276,500,-1253,499,-382,474,-407,475,-407,474,-407,475,-407,501,-1254,474]
- platform: template
name: "Dry"
turn_on_action:
remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
repeat:
times: 2
code: [3547,-1689,450,-432,500,-1254,501,-381,500,-382,499,-383,449,-433,499,-383,502,-380,501,-382,500,-380,500,-382,450,-431,450,-433,449,-1304,450,-433,450,-431,451,-431,451,-431,449,-433,449,-433,449,-1304,449,-433,450,-1304,449,-1305,450,-432,449,-432,450,-1305,449,-434,448,-434,448,-1305,449,-434,448,-434,448,-434,447,-1306,497,-385,447,-435,446,-1309,445,-1309,445,-438,444,-1311,444,-1311,443,-1310,444,-438,444,-438,444,-1310,445,-438,444,-437,447,-436,445,-1309,447,-435,448,-1306,447,-436,449,-433,448,-1306,448,-434,448,-433,449,-434,448,-432,535,-348,477,-404,480,-401,507,-375,481,-1273,510,-373,535,-1219,510,-370,539,-344,509,-372,510,-1244,508,-374,509,-1244,482,-400,509,-1245,509,-372,508,-1246,481,-401,480,-403,506,-1247,477,-1278,476,-405,478,-404,476,-406,504,-377,500,-381,473,-409,474,-409,473,-408,503,-1251,503,-379,501,-379,502,-1253,501,-381,473,-408,474,-409,474,-408,472,-1282,474]
|