{{tag>[esp tuya]}} # Koogeek KLUP1 ## Reflashing ### tuya-convert Flashable OTA with [[https://github.com/ct-Open-Source/tuya-convert|tuya-convert]]. (edit: not anymore in 2021) ### Hardware **Extremely difficult**. I've physically damaged a smart plug trying to access the ESP8266-C1. See [[https://notenoughtech.com/featured/hacking-koogeek-smart-plug/]] for a video + writeup of a disassembly + flashing instructions. ## Cookbooks ### Tasmota {"NAME":"Koogeek-KLUP1","GPIO":[0,0,0,32,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":18} Based on [[https://templates.blakadder.com/kogeek_KLUP1.html]] ### ESPHome Based on https://www.esphome-devices.com/devices/Gosund-UP111/ (note different model numbers) ``` substitutions: friendly_name: "My KLUP1 Plug" esphome: name: klup1 platform: ESP8266 board: esp01_1m # define wifi/api/ota/mqtt/... time: - platform: sntp id: sntp_time binary_sensor: - platform: gpio pin: number: GPIO3 mode: INPUT_PULLUP inverted: True name: "${friendly_name} Button" on_press: - switch.toggle: relay internal: true - platform: status name: "${friendly_name} Status" switch: - platform: gpio pin: 14 id: relay name: "${friendly_name}" on_turn_on: - light.turn_on: id: led brightness: 100% transition_length: 0s on_turn_off: - light.turn_off: id: led transition_length: 0s output: # Register the green LED as a dimmable output .... - platform: esp8266_pwm id: state_led pin: number: GPIO1 inverted: True light: # ... and then make a light out of it. - platform: monochromatic name: "${friendly_name} Green LED" id: led output: state_led internal: true sensor: - platform: hlw8012 sel_pin: number: GPIO12 inverted: true cf_pin: GPIO4 cf1_pin: GPIO05 change_mode_every: 3 update_interval: 3s voltage: name: "${friendly_name} Voltage" id: voltage unit_of_measurement: V accuracy_decimals: 1 filters: # Map from sensor -> measured value - calibrate_linear: - 0.0 -> 0.0 - 602.87506 -> 229.9 - 609.8 -> 232.8 power: name: "${friendly_name} Power" id: power unit_of_measurement: W accuracy_decimals: 0 filters: # Map from sensor -> measured value - calibrate_linear: - 0.0 -> 1.14 - 62.06167 -> 10.93 - 1503.27161 -> 247.6 - 1599.81213 -> 263.7 - 3923.67700 -> 631.4 - 7109.50928 -> 1148.0 - 7237.0857 -> 1193.0 - 7426.71338 -> 1217.0 current: name: "${friendly_name} Current" id: current unit_of_measurement: A accuracy_decimals: 3 filters: # Map from sensor -> measured value - calibrate_linear: - 0.0 -> 0.013 - 0.08208 -> 0.071 - 1.34223 -> 1.066 - 5.57170 -> 4.408 - 6.69184 -> 5.259 - 6.97187 -> 5.540 # Total daily energy sensor - platform: total_daily_energy name: "${friendly_name} Daily Energy" power_id: power filters: # Multiplication factor from W to kW is 0.001 - multiply: 0.001 unit_of_measurement: kWh status_led: pin: number: GPIO13 inverted: True ```