AHRise AHR-083 Power Strip Tuya-Convert & esphome

Hi All, just want to share a success I had in flashing a fairly inexpensive power strip with 4 controllable outlets, 4 always-on outlets, & 4 always-on USB ports with esphome!


Steps I took are pretty straight forward, if you’re not familiar with tuya-convert, I suggest watching this video to get that working: https://www.youtube.com/watch?v=dyUyewiKpRA

Once you’ve got tasmota on the power strip, you’ll need to create a device in esphome, here’s my code for the power strip:

esphome:
  name: power_strip_1
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "WiFi_ssid"
  password: "wifi_password"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Power Strip 1 Fallback Hotspot"
    password: "generated_password"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "api_password"

ota:
  password: "ota_password"
  
switch:
  - platform: gpio
    name: "Relay1"
    id: relay1
    pin:
      number: GPIO13
  - platform: gpio
    name: "Relay2"
    id: relay2
    pin:
      number: GPIO12
  - platform: gpio
    name: "Relay3"
    pin:
      number: GPIO14
    id: relay3
  - platform: gpio
    name: "Relay4"
    id: relay4
    pin:
      number: GPIO15
      
light:
# Blue LED PWM
# GPIO4
  - platform: monochromatic
    name: "PowerStrip-Blue_LED"
    output: output_component_blue

output:
#Blue LED
  - platform: esp8266_pwm
    id: output_component_blue
    pin: GPIO4
    inverted: yes

# Button & Automation to toggle all switches
# GPIO5

binary_sensor:
  - platform: gpio
    pin: GPIO5
    id: button
    name: "PowerStrip_Button"
    on_press:
      - switch.toggle: relay1
      - switch.toggle: relay2
      - switch.toggle: relay3
      - switch.toggle: relay4
    internal: True

Compile and download that from esphome and upload it using tasmota’s web interface for the device and you’ll be all set!

Thanks to @LUNZ for posting the code to a similar device here: https://community.home-assistant.io/t/migrating-tasmota-to-esphome-teckin-ss30-yaml/140447

Cheers!

2 Likes

Hey @Kip thanks for sharing and the shout out!

Please post the working config to:

I am using a similar product from POWRUI (Amazon link https://www.amazon.com/gp/product/B07RQNFL7R/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1)

I am able to get Outlet 2, and 3 from the right side and LED Link to toggle, but I am unable to toggle Relay 1 and the power button (to trigger all LED’s)…

Any pointers?

I’d start with GPIO1 pin and just keep trying light/relay on each pin from there until you figure out what is what. That’s all I did with a notepad to write down what I discovered.

@Kip I did that and it worked

Here’s my working config for the POWRUI AHR-081 for anybody (like me) who found this thread while looking for the pin layout.

51SDONEICZL.AC_SY450

# 3 outlets
switch:
  - platform: gpio
    pin: GPIO14
    name: "Power Strip Relay 1"
    id: relay_1
    
  - platform: gpio
    pin: GPIO12
    name: "Power Strip Relay 2"
    id: relay_2
    
    - platform: gpio
    pin: GPIO13
    name: "Power Strip Relay 3"
    id: relay_3

  # Blue Status LED
  - platform: gpio
    pin: GPIO4
    name: "Power Strip Status LED"
    icon: "mdi:led"
    inverted: yes

# Power button
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO5
      mode: INPUT_PULLUP
    filters:
      - invert:
    name: "Power Strip Button"
    on_press:
      then:
        - switch.toggle: relay_1

I leave the blue LED off, but you can easily add an on_turn_on toggle to the relay to enable it.

@Kip Thanks for the config!

I didn’t see that it ever got posted to https://esphome-configs.io so I went ahead and put a PR in for it:

Hey! I just bought the serial basic from sparkfun and wanted to know, are the GPIO pins on the power strip needing male or female to connect? Also, how did you get the power strip to turn on without mains power plugged in? Everything I’ve read says you’re not supposed to do that. One last question, which power supply did you use on your breakout board? Did you just use a computer usb to usb connection to power the breakout board?

Kip,
I purchased the same but I can’t get Tuya-Convert to work. Can you give any advice? I followed the youtube procedure but flashing never happens.

Unfortunately, the device is probably now running tuya’s updated software that currently blocks tuya-convert from working. I’ve run into this problem on a number of new devices I’ve bought that according to reviews used to work with tuya-convert. If you feel comfortable opening the device up, you may be able to flash esphome on it using uART. I’ve had success doing that on a number of devices, haven’t tried it on any power strips yet though.

1 Like

I see it here on the list of devices which are affected by the updated authentication method: