Updated / improved version
uart:
baud_rate: 115200
tx_pin: GPIO1
rx_pin: GPIO3
binary_sensor:
- platform: status
name: "Piec 2 Relay"
# Led de Estado
status_led:
pin: GPIO2
switch:
- platform: template
name: "Piec Relay 1"
id: relay_1
icon: mdi:fan
optimistic: true
turn_on_action:
- delay: 10ms
- uart.write: [0xA0, 0x01, 0x01, 0xA2]
turn_off_action:
- uart.write: [0xA0, 0x01, 0x00, 0xA1]
- platform: template
name: "Piec Relay 2"
id: relay_2
icon: mdi:fan
optimistic: true
turn_on_action:
- delay: 10ms
- uart.write: [0xA0, 0x02, 0x01, 0xA3]
turn_off_action:
- uart.write: [0xA0, 0x02, 0x00, 0xA2]