Integrate Kogan SmarterHome products into HA

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.

Can you still do the tuya convert with the kogan plugs/bunnings ones, or do you have to open them up?

Converted two brilliant plugs (Bunnings) last week using tuya - no issues.

tuya connect or opening them up?

Tuya convert OTA :smiley: