diff --git a/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter-Old/index.md b/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter-Old/index.md new file mode 100644 index 000000000..bba29be71 --- /dev/null +++ b/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter-Old/index.md @@ -0,0 +1,218 @@ +--- +title: Kogan SmarterHome Smart Power Board With USB Ports & Energy Meter +Model: KASPS10A3P3UA +date-published: 2020-05-25 +type: plug +standard: au +board: esp8266 +--- + ![alt text](kogan-smarterhome-smart-power-board-with-usb-ports-energy-meter.jpg "Product Image") + +[Kogan SmarterHome™ Smart Power Board With USB Ports & Energy Meter - (KASPS10A3P3UA) - Manual](https://help.kogan.com/s/article/KoganSmarterHomeSmartPowerBoardWithUSBPortsEnergyMeterKASPS10A3P3UAManual) + +## GPIO Pinout + +| Pin | Function | +|--------|----------------------------| +| GPIO00 | Push Button | +| GPIO01 | Green LED (Inverted: true) | +| GPIO13 | Relay 1 | +| GPIO14 | Relay 2 | +| GPIO03 | Relay 3 | +| GPIO15 | Relay USB | +| GPIO12 | HLW8012 SEL Pin | +| GPIO04 | HLW8012 CF Pin | +| GPIO05 | HLW8012 CF1 Pin | + +**Note:** In the below configuration, the push button (and surrounding LED) is configured to only control Relay 3 (End Plug) + +## Basic Config + +```yaml +substitutions: + device_name: kogan_strip_1 + device_ip: 192.168.x.x + plug_icon: mdi:power-socket-au + usb_icon: mdi:usb-port + plug1_restore: ALWAYS_ON + plug2_restore: ALWAYS_OFF + plug3_restore: ALWAYS_OFF + usb_restore: ALWAYS_ON + + # Higher value gives lower watt readout + current_res: "0.00250" + # Lower value gives lower voltage readout + voltage_div: "799" + +esphome: + name: ${device_name} + +esp8266: + board: esp8285 + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +logger: + +api: + reboot_timeout: 15min + encryption: + key: !secret encryption_key + +ota: + password: !secret ota_password + +binary_sensor: + - platform: gpio + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: true + name: "${device_name}_button" + on_multi_click: + - timing: + - ON for 5ms to 350ms + - OFF for at least 750ms + then: + - switch.toggle: relayusb + - timing: + - ON for 5ms to 350ms + - OFF for 5ms to 350ms + - ON for 5ms to 350ms + - OFF for at least 750ms + then: + - switch.toggle: relay1 + - timing: + - ON for 5ms to 350ms + - OFF for 5ms to 350ms + - ON for 5ms to 350ms + - OFF for 5ms to 350ms + - ON for 5ms to 350ms + - OFF for at least 750ms + then: + - switch.toggle: relay2 + - timing: + - ON for 5ms to 350ms + - OFF for 5ms to 350ms + - ON for 5ms to 350ms + - OFF for 5ms to 350ms + - ON for 5ms to 350ms + - OFF for 5ms to 350ms + - ON for 5ms to 350ms + - OFF for at least 750ms + then: + - switch.toggle: relay3 + + - platform: status + name: "${device_name}_status" + +light: + - platform: status_led + id: green_led + pin: + number: GPIO1 + inverted: true + +switch: + - platform: gpio + name: "${device_name}_plug1" + pin: GPIO13 + id: relay1 + icon: ${plug_icon} + restore_mode: ${plug1_restore} + + - platform: gpio + name: "${device_name}_plug2" + pin: GPIO14 + id: relay2 + icon: ${plug_icon} + restore_mode: ${plug2_restore} + + - platform: gpio + name: "${device_name}_plug3" + pin: GPIO3 + id: relay3 + icon: ${plug_icon} + restore_mode: ${plug3_restore} + on_turn_on: + - light.turn_on: green_led + on_turn_off: + - light.turn_off: green_led + + - platform: gpio + name: "${device_name}_usb" + pin: GPIO15 + id: relayusb + icon: ${usb_icon} + restore_mode: ${usb_restore} + +sensor: + - platform: hlw8012 + sel_pin: + number: GPIO12 + inverted: true + cf_pin: GPIO04 + cf1_pin: GPIO05 + current: + name: "${device_name}_current" + unit_of_measurement: A + voltage: + name: "${device_name}_voltage" + unit_of_measurement: V + power: + id: ${device_name}_wattage + name: "${device_name}_wattage" + unit_of_measurement: W + current_resistor: ${current_res} + voltage_divider: ${voltage_div} + change_mode_every: 8 + update_interval: 15s + + - platform: total_daily_energy + name: "${device_name}_daily_energy" + power_id: ${device_name}_wattage + filters: + - multiply: 0.001 + unit_of_measurement: kWh + + - platform: wifi_signal + name: "${device_name}_rssi" + update_interval: 5min + + - platform: uptime + id: uptime_sec + name: "${device_name}_uptime" + update_interval: 5min + +text_sensor: + - platform: template + name: "${device_name}_upformat" + lambda: |- + uint32_t dur = id(uptime_sec).state; + int dys = 0; + int hrs = 0; + int mnts = 0; + if (dur > 86399) { + dys = trunc(dur / 86400); + dur = dur - (dys * 86400); + } + if (dur > 3599) { + hrs = trunc(dur / 3600); + dur = dur - (hrs * 3600); + } + if (dur > 59) { + mnts = trunc(dur / 60); + dur = dur - (mnts * 60); + } + char buffer[17]; + sprintf(buffer, "%ud %02uh %02um %02us", dys, hrs, mnts, dur); + return {buffer}; + icon: mdi:clock-start + update_interval: 5min + +time: + - platform: homeassistant + id: homeassistant_time +``` diff --git a/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter-Old/kogan-smarterhome-smart-power-board-with-usb-ports-energy-meter.jpg b/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter-Old/kogan-smarterhome-smart-power-board-with-usb-ports-energy-meter.jpg new file mode 100644 index 000000000..d4cfe4f1c Binary files /dev/null and b/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter-Old/kogan-smarterhome-smart-power-board-with-usb-ports-energy-meter.jpg differ diff --git a/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter/index.md b/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter/index.md index ed094f04d..6cbfa9feb 100644 --- a/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter/index.md +++ b/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter/index.md @@ -1,225 +1,121 @@ --- title: Kogan SmarterHome Smart Power Board With USB Ports & Energy Meter -Model: KASPS10A3P3UA -date-published: 2020-05-25 +Model: KASPS30WACB +date-published: 2026-03-31 type: plug standard: au -board: esp8266 +board: bk72xx --- ![alt text](kogan-smarterhome-smart-power-board-with-usb-ports-energy-meter.jpg "Product Image") -[Kogan SmarterHome™ Smart Power Board With USB Ports & Energy Meter - (KASPS10A3P3UA) - Manual](https://help.kogan.com/s/article/KoganSmarterHomeSmartPowerBoardWithUSBPortsEnergyMeterKASPS10A3P3UAManual) +[Kogan SmarterHome™ Smart Power Board With USB Ports & Energy Meter - (KASPS30WACB) - Manual](https://help.kogan.com/s/article/Kogan-SmarterHome-30W-PD-Smart-Power-Board-with-Energy-Metre-3-Outlets-2-USB-C-Ports---KASPS30WACB---Manuals-and-Support) -## GPIO Pinout +## Programming Notes -| Pin | Function | -|--------|----------------------------| -| GPIO00 | Push Button | -| GPIO01 | Green LED (Inverted: true) | -| GPIO13 | Relay 1 | -| GPIO14 | Relay 2 | -| GPIO03 | Relay 3 | -| GPIO15 | Relay USB | -| GPIO12 | HLW8012 SEL Pin | -| GPIO04 | HLW8012 CF Pin | -| GPIO05 | HLW8012 CF1 Pin | +**Warning** This board is mains powered. Do not do ANYTHING while the board is powered. +Power the board via the 3.3v and GND pin and do not connect the board to the mains until you are fully disconnected and the board is fully reassembled. -**Note:** In the below configuration, the push button (and surrounding LED) is configured to only control Relay 3 (End Plug) +To program the board you will need to disassemble the powerboard and solder jumper cables to the CEN, TX, RX, 3.3v and GND pins. +You will also need to bridge the CSN pin on the back of the module to GND (e.g back of the chip) to put the board into programming mode. -## Basic Config +![pins go where](kogan-pins-where.png "Pins go where") -```yaml -substitutions: - device_name: kogan_strip_1 - device_ip: 192.168.x.x - plug_icon: mdi:power-socket-au - usb_icon: mdi:usb-port - plug1_restore: ALWAYS_ON - plug2_restore: ALWAYS_OFF - plug3_restore: ALWAYS_OFF - usb_restore: ALWAYS_ON - - # Higher value gives lower watt readout - current_res: "0.00250" - # Lower value gives lower voltage readout - voltage_div: "799" +Attach 3.3v, GND, TX and RX to your serial adapter and tap CEN to GND while attempting to flash the board in ltchiptool. +It may take a couple attempts to get the timing right, but you should see the board flash and then disconnect the CSN-GND bridge after flashing is complete. -esphome: - name: ${device_name} +## GPIO Pinout + +| Pin | Function | +|-----------|------------------------------| +| P9 (TX1) | BL0942 UART TX | +| P10 (RX1) | BL0942 UART RX | +| P6 (PWM0) | Port 1 relay | +| P7 (PWM1) | Port 2 relay | +| P26(PWM2) | Port 3 relay | +| P24(PWM4) | Push button | +| P8 (PWM5) | Status LED (inverted) | + +**Note:** The button and LED are not configured to do anything in this configuration, but they are included for completeness. -esp8266: - board: esp8285 +## Basic Config +```yaml wifi: ssid: !secret wifi_ssid password: !secret wifi_password - manual_ip: - static_ip: ${device_ip} - gateway: 192.168.x.x - subnet: 255.255.255.0 +# Enable logging logger: -web_server: - port: 80 - +# Enable Home Assistant API api: - reboot_timeout: 15min - encryption: - key: !secret encryption_key ota: - password: !secret ota_password + +esphome: + name: powerboard + platformio_options: + build_flags: + - -DLWIP_DHCP_DOES_ACD_CHECK=0 + +bk72xx: + board: cb2s + framework: + version: latest + debug: + - WIFI + + +uart: + tx_pin: "TX1" + rx_pin: + number: "RX1" + mode: + pullup: true + input: true + baud_rate: 4800 binary_sensor: - platform: gpio pin: - number: GPIO0 - mode: INPUT_PULLUP - inverted: true - name: "${device_name}_button" - on_multi_click: - - timing: - - ON for 5ms to 350ms - - OFF for at least 750ms - then: - - switch.toggle: relayusb - - timing: - - ON for 5ms to 350ms - - OFF for 5ms to 350ms - - ON for 5ms to 350ms - - OFF for at least 750ms - then: - - switch.toggle: relay1 - - timing: - - ON for 5ms to 350ms - - OFF for 5ms to 350ms - - ON for 5ms to 350ms - - OFF for 5ms to 350ms - - ON for 5ms to 350ms - - OFF for at least 750ms - then: - - switch.toggle: relay2 - - timing: - - ON for 5ms to 350ms - - OFF for 5ms to 350ms - - ON for 5ms to 350ms - - OFF for 5ms to 350ms - - ON for 5ms to 350ms - - OFF for 5ms to 350ms - - ON for 5ms to 350ms - - OFF for at least 750ms - then: - - switch.toggle: relay3 - - - platform: status - name: "${device_name}_status" - -light: - - platform: status_led - id: green_led - pin: - number: GPIO1 + number: "PWM4" + mode: + input: true + pullup: true inverted: true + name: "Button" + +sensor: + - platform: bl0942 + voltage: + name: "BL0942 Voltage" + current: + name: "BL0942 Current" + power: + name: "BL0942 Power" + filters: + - multiply: -1 + energy: + name: "BL0942 Energy" + frequency: + name: "BL0942 Frequency" switch: - platform: gpio - name: "${device_name}_plug1" - pin: GPIO13 - id: relay1 - icon: ${plug_icon} - restore_mode: ${plug1_restore} - + name: "Port 1" + pin: "PWM0" + restore_mode: RESTORE_DEFAULT_ON - platform: gpio - name: "${device_name}_plug2" - pin: GPIO14 - id: relay2 - icon: ${plug_icon} - restore_mode: ${plug2_restore} - + name: "Port 2" + pin: "PWM1" + restore_mode: RESTORE_DEFAULT_ON - platform: gpio - name: "${device_name}_plug3" - pin: GPIO3 - id: relay3 - icon: ${plug_icon} - restore_mode: ${plug3_restore} - on_turn_on: - - light.turn_on: green_led - on_turn_off: - - light.turn_off: green_led - + name: "Port 3" + pin: "PWM2" + restore_mode: RESTORE_DEFAULT_ON - platform: gpio - name: "${device_name}_usb" - pin: GPIO15 - id: relayusb - icon: ${usb_icon} - restore_mode: ${usb_restore} - -sensor: - - platform: hlw8012 - sel_pin: - number: GPIO12 - inverted: true - cf_pin: GPIO04 - cf1_pin: GPIO05 - current: - name: "${device_name}_current" - unit_of_measurement: A - voltage: - name: "${device_name}_voltage" - unit_of_measurement: V - power: - id: ${device_name}_wattage - name: "${device_name}_wattage" - unit_of_measurement: W - current_resistor: ${current_res} - voltage_divider: ${voltage_div} - change_mode_every: 8 - update_interval: 15s - - - platform: total_daily_energy - name: "${device_name}_daily_energy" - power_id: ${device_name}_wattage - filters: - - multiply: 0.001 - unit_of_measurement: kWh - - - platform: wifi_signal - name: "${device_name}_rssi" - update_interval: 5min - - - platform: uptime - id: uptime_sec - name: "${device_name}_uptime" - update_interval: 5min - -text_sensor: - - platform: template - name: "${device_name}_upformat" - lambda: |- - uint32_t dur = id(uptime_sec).state; - int dys = 0; - int hrs = 0; - int mnts = 0; - if (dur > 86399) { - dys = trunc(dur / 86400); - dur = dur - (dys * 86400); - } - if (dur > 3599) { - hrs = trunc(dur / 3600); - dur = dur - (hrs * 3600); - } - if (dur > 59) { - mnts = trunc(dur / 60); - dur = dur - (mnts * 60); - } - char buffer[17]; - sprintf(buffer, "%ud %02uh %02um %02us", dys, hrs, mnts, dur); - return {buffer}; - icon: mdi:clock-start - update_interval: 5min - -time: - - platform: homeassistant - id: homeassistant_time + name: "LED" + pin: "PWM5" + restore_mode: RESTORE_DEFAULT_ON + inverted: true ``` diff --git a/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter/kogan-pins-where.png b/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter/kogan-pins-where.png new file mode 100644 index 000000000..2e3cc145b Binary files /dev/null and b/src/docs/devices/Kogan-Smarterhome-Smart-Power-Board-With-Usb-Ports-Energy-Meter/kogan-pins-where.png differ