Integrate Kogan SmarterHome products into HA

I am making some progress with the Kogan RGBW bulbs. I used the template settings for the Luminea ZX-2832 E27 RGBW Bulb here and now have the RGB channels working, and used Setoption19 1 to have HA auto-discover the bulb.

A couple of problems remain, the sliders for Cool/Warm work more like a dimmer and are backwards - at 100% Cool, the bulb is fully Warm in colour, at 100% Warm the bulb is dimmed to an off state.

The brightness of the RGB colours is a little dim as well, they do display accurately though based on the colour wheel selector. So a few things left to sort out and debug, but progress is progress.

I have tried the Mirabella template, does not work as well as the Luminea does.

Try using some of the inverted (i) varients of the GPIO PINs, probably 1 at a time (the 37 and 38 values have inverted options).

I think i’ve tried about 100 different combinations, and what you have suggested, and still no joy. I’m stumped. :roll_eyes:

This is the best I can come up with so far after a solid 3 hours of trying different configs today.

{"NAME":"Kogan RGBW","GPIO":[0,0,0,0,140,38,0,0,0,37,141,0,0],"FLAG":0,"BASE":18}

This has the RGB working and has the brightness slider work independently of the color temp slider. The color temp slider now works (somewhat) in the correct way. Full warm makes the bulb 100% warm, full cool dims the bulb to about 5% brightness and no white light.

I’m starting to think these bulbs fake white light using the RGBs and only have warm LEDs for “normal” white bulb color.

Still happy to donate one to someone in Aus who might have more knowledge on how to work these things out than I do.

1 Like

Could someone confirm the syntax for the binary_sensor relay part. I have this

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      inverted: True
    name: "${plug_name}_button"

But, am getting errors on adding the

on_press:
  switch.toggle: relay

I get an error saying couldn’t find ID ‘relay’

I suggest a bit more info like what product and also your full config.

Good point!
The Kogan Smart Energy Plug.

substitutions:
  plug_name: kogan_plug_1
  # Higher value gives lower watt readout
  current_res: "0.00087"
  # Lower value gives lower voltage readout
  voltage_div: "2072"
esphome:
  name: ${plug_name}
  platform: ESP8266
  board: esp8285
wifi:
  ssid: 'XX'
  password: 'XX'
# Enable logging
logger:
# Enable Web server
web_server:
  port: 80
# Enable Home Assistant API
api:
  password: 'XX'
ota:
  password: 'XX'
time:
  - platform: homeassistant
    id: homeassistant_time
    
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      inverted: True
    name: "${plug_name}_button"

switch:
  - platform: gpio
    name: "${plug_name}_Relay"
    pin: GPIO14
    restore_mode: ALWAYS_ON
  - platform: gpio
    name: "${plug_name}_LED_Green"
    pin: GPIO13
    inverted: True
    restore_mode: ALWAYS_OFF

sensor:
  - platform: hlw8012
    sel_pin:
      number: GPIO12
      inverted: True
    cf_pin: GPIO04
    cf1_pin: GPIO05
    current_resistor: ${current_res}
    voltage_divider: ${voltage_div}
    current:
      name: "${plug_name}_Amperage"
      unit_of_measurement: A
    voltage:
      name: "${plug_name}_Voltage"
      unit_of_measurement: V
    power:
      name: "${plug_name}_Wattage"
      unit_of_measurement: W
      id: "${plug_name}_Wattage"
    change_mode_every: 8
    update_interval: 10s
  - platform: total_daily_energy
    name: "${plug_name}_Total Daily Energy"
    power_id: "${plug_name}_Wattage"
    filters:
        # Multiplication factor from W to kW is 0.001
        - multiply: 0.001
    unit_of_measurement: kWh
      
# Extra sensor to keep track of plug uptime
  - platform: uptime
    name: ${plug_name}_Uptime Sensor
# Extra sensor for wifi signal
  - platform: wifi_signal
    name: ${plug_name}_WiFi Signal Sensor
switch:
  - platform: gpio
    name: "${plug_name}_Relay"
    pin: GPIO14
    restore_mode: ALWAYS_ON
    id: relay

That worked. The code uploaded without error. Thank you.

But, on button press on the plug, the plug switches off, but won’t switch back on. Am I missing some code?

Check this post here
@sparkydave has a working ESPhome config for the Kogan plug.

I like the Kogan app because it doesn’t need the cloud (ie I can control the wifi switch with my phone via the home router over the local network even if the router has no internet connection). If I swap to tasmota will that cloud independence be preserved?

Yes. 100%.

Really? I was under the impression that their devices used the Tuya server in China


Swap to ESPhome
 There is a working config I posted in another thread which is linked above

I have a goldair heater (link) The goldair app is the same as the Tuya app.

I registered the heater with the Tuya app, and I can control the heater using the tuya app.

However
 I can’t see the device in home assistant. Also in the logs there is no errors. I have this in my configuration file:

tuya:
  username: [email protected]
  password: xxx
  country_code: 64

Have successfully previously flashed several kogan bulbs and plugs.

Just received new 4 pack of white ambient bulbs, none of them flashing OTA. Stuffed.

Most likely you can still flash them, but you need to open them and solder some wires to them. There are some other treads around here that explain it.

Has anyone got these heaters to work with home assistant yet (or flash with tasmota / esphome).

I have it working fine in the tuya or smart life apps but can’t get the heater to show up in home assistant.

Do they work with Google Assistant? When I originally got some sonoffs, I used GA+IFTTT to get them into HA - maybe you can use a similar approach?

No I can’t see them.

I can add tuya or smart life to Google assistant or iftt, but I don’t see the heater.

PS. I have no other tuya products either, which makes it a bit harder to test.

Thanks to previous efforts on this, I have added a light component using pytuya for local control, available here: https://github.com/Alfiegerner/localtuya

I only have white with temperature bulbs, so no RGBW, but it should be easy enough from the code where to add. Added test.py top allow debugging, let me know if you need a hand.

Also worth noting my bulbs operate up to 1000 for brightness for colour temp, so had to change pytuya.