devices.esphome.io

Qiachip KR2201WB WIFI remote control (Without RF)

Qiachip KR2201WB WIFI remote control (Without RF)

Device Type: switch
Electrical Standard: global
Board: bk72xx

Notice

  • This switch is flashable using the latest tuya-cloudcutter with a compiled ESPHome binary. I recommend following this Youtube Video.
  • Version 1.1.4 in the App and with BK7231N (WB2S module)

Product Images

switch

GPIO Pinout

PinFunction
P7Switch button
P10Green LED
P8Relay

Configuration

substitutions:
devicename: qia-smart-switch
friendly_name: QIA Smart switch
esphome:
name: ${devicename}
bk72xx:
board: generic-bk7231n-qfn32-tuya
# OTA flashing
ota:
- platform: esphome
wifi: # Your Wifi network details
# Enable fallback hotspot in case wifi connection fails
ap:
# Enabling the logging component
logger:
# Enable Home Assistant API
api:
# Enable the captive portal
captive_portal:
time:
- platform: homeassistant
id: homeassistant_time
# Enable the Web Server component
webserver:
sensor:
- platform: uptime
name: Uptime Sensor
id: uptime_sensor
update_interval: 60s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
light:
- platform: status_led
name: "led"
internal: true
id: led
pin:
number: P10
inverted: true
binary_sensor:
- platform: status
name: ${friendly_name} status
- platform: gpio
pin:
number: P7
mode: INPUT_PULLUP
inverted: true
name: ${friendly_name} button
internal: true
filters:
- delayed_on: 10ms
- delayed_off: 10ms
on_press:
- switch.toggle: relay
switch:
- platform: gpio
id: relay
name: ${friendly_name} relay
pin: P8
icon: mdi:electric-switch
on_turn_on:
- light.turn_on: led
on_turn_off:
- light.turn_off: led
button:
- platform: restart
id: restart_button
name: ${friendly_name} restart
entity_category: diagnostic
Edit this page on GitHub