MagicHome with IR working using ESPHome

Picking up where @Luuk_Neele left off with these devices here.

I got the ESPHome config figured out for supporting the remote control.
You just need to define a remote_receiver. ESPHome can pick up the IR commands perfectly when configured for nec commands. From there it’s a matter of tediously defining a binary_sensor for each button and the action you want to take.

Here’s a fully working config that mimics the remote behaviour from the factory.

  name: mh_ledstrip3
  platform: ESP8266
  board: esp8285

wifi:
  ssid: !secret ssid
  password: !secret ssid_pass
  manual_ip:
    static_ip: !secret ip_mh_ledstrip3
    gateway: !secret gateway
    subnet: !secret subnet

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: !secret api_pass

ota:
  password: !secret ota_pass
  
light:
  - platform: rgb
    name: mh_ledstrip3
    id: mh_ledstrip3
    red: pwm_r
    green: pwm_g
    blue: pwm_b
    restore_mode: ALWAYS_ON

output:
  - platform: esp8266_pwm
    pin: GPIO12
    frequency: 1000 Hz
    id: pwm_g

  - platform: esp8266_pwm
    pin: GPIO5
    frequency: 1000 Hz
    id: pwm_r

  - platform: esp8266_pwm
    pin: GPIO13
    frequency: 1000 Hz
    id: pwm_b
  
remote_receiver:
  pin:
    number: GPIO4
    inverted: true
  dump: nec
  
binary_sensor:
  - platform: remote_receiver
    id: "on"
    nec:
      address: 0x00FF
      command: 0xB04F
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
  - platform: remote_receiver
    id: "off"
    nec:
      address: 0x00FF
      command: 0xF807
    on_press:
      then:
        - light.turn_off:
            id: mh_ledstrip3
  - platform: remote_receiver
    id: brightness_up
    nec:
      address: 0x00FF
      command: 0x906F
    on_press:
      then:
        - light.dim_relative:
            id: mh_ledstrip3
            relative_brightness: 20%
  - platform: remote_receiver
    id: brightness_down
    nec:
      address: 0x00FF
      command: 0xB847
    on_press:
      then:
        - light.dim_relative:
            id: mh_ledstrip3
            relative_brightness: -20%
  - platform: remote_receiver
    id: red
    nec:
      address: 0x00FF
      command: 0x9867
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 0
            blue: 0
  - platform: remote_receiver
    id: green
    nec:
      address: 0x00FF
      command: 0xD827
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 0
            green: 100%
            blue: 0
  - platform: remote_receiver
    id: blue
    nec:
      address: 0x00FF
      command: 0x8877
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 0
            green: 0
            blue: 100%
  - platform: remote_receiver
    id: white
    nec:
      address: 0x00FF
      command: 0xA857
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 100%
            blue: 100%
  - platform: remote_receiver
    id: R2
    nec:
      address: 0x00FF
      command: 0xE817
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 35%
            blue: 14%
  - platform: remote_receiver
    id: R3
    nec:
      address: 0x00FF
      command: 0x02FD
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 57%
            blue: 14%
  - platform: remote_receiver
    id: R4
    nec:
      address: 0x00FF
      command: 0x50AF
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 78%
            blue: 28%
  - platform: remote_receiver
    id: R5
    nec:
      address: 0x00FF
      command: 0x38C7
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 100%
            blue: 0%
  #Greens
  - platform: remote_receiver
    id: G2
    nec:
      address: 0x00FF
      command: 0x48B7
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 28%
            green: 100%
            blue: 28%
  - platform: remote_receiver
    id: G3
    nec:
      address: 0x00FF
      command: 0x32CD
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 28%
            green: 100%
            blue: 64%
  - platform: remote_receiver
    id: G4
    nec:
      address: 0x00FF
      command: 0x7887
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 28%
            green: 64%
            blue: 100%
  - platform: remote_receiver
    id: G5
    nec:
      address: 0x00FF
      command: 0x28D7
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 14%
            green: 35%
            blue: 100%
  #Blues
  - platform: remote_receiver
    id: B2
    nec:
      address: 0x00FF
      command: 0x6897
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 14%
            green: 14%
            blue: 100%
  - platform: remote_receiver
    id: B3
    nec:
      address: 0x00FF
      command: 0x20DF
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 46%
            green: 28%
            blue: 100%
  - platform: remote_receiver
    id: B4
    nec:
      address: 0x00FF
      command: 0x708F
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 81%
            green: 28%
            blue: 100%
  - platform: remote_receiver
    id: B5
    nec:
      address: 0x00FF
      command: 0xF00F
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 14%
            blue: 78%

This works perfectly with home assistant. Using the remote instantly updates HA with the right state, and the remote works locally on the device so even if HA is off, it still changes the colors.

Note: this config is setup so that the individual buttons don’t show up in HA as sensors. If you want them to give each one a name property instead of just an id.

I assume this can be extended to handle RGBW and RGBWW devices as well.

12 Likes

Hmmm do you think this will work with the RF version ?

I don’t have one to try out but looking here I don’t see why not.

The remote_receiver component lets you receive and decode any remote signal, these can for example be infrared remotes or 433MHz signals.

If it doesn’t just work, switch dump:nec to dump:all and watch the logs to see which type of interpretation produces clean data.

Brillant , though i just flashed my device and blue/red seen to have gone.IM not sure why as nothing changed on my setup GPIO wise

Maybe the pinout is different on the RF version? Does your previous config work if you flash it again? Maybe the GPIO config is just different.

I didnt change the GPIO config and after multiple updating I have Blue and Green back just red has gone awol. Im going to try reflashing via the laptop as OTA seems to be failing now depsite it sayng complete

FYI for anyone that wants to use the Flash/Strobe/Fade/Smooth buttons on the IR remote, here are the NEC command codes for those:

  • Flash: 0xB24D
  • Strobe: 0x00FF
  • Fade: 0x58A7
  • Smooth: 0x30CF

You can link those buttons to ESPHome’s built-in effects (https://esphome.io/components/light/index.html#light-effects) or define your own. Example

light:
  - platform: rgbw
    effects:
      - random:
...

and then

binary_sensor:
  - platform: remote_receiver
      id: smooth
      nec:
        address: 0x00FF
        command: 0x30CF
      on_press:
        then:
          - light.turn_on:
              id: rgbw_01
              effect: random
1 Like

Didn’t realize I missed those. Thanks for figuring those out!

Has there been anymore work with this or does it live in a repo somewhere? I have a RGBW version and would love to be able to control the white channel. https://esphome-configs.io/ would also be a perfect place to upload a fully working config.

That’s the full config in the original post. The remote trigger sections can be used to trigger any light controller so making it support rbgw would just be a matter of using regular rgbw properties.

Did you used some kind of color or gamma correction ?
I used your config , but the color and brightness is quite off .

Thanks.

For anyone who wants my full config which takes both OP @kareem613’s config mixed with @wrkn’s remote Effect Buttons and some of my augmentations.

Mainly, I put some logic that allows you to stop an effect if one of the following buttons is pressed: currently running effect button, on, off, any other colour including white.

Also, let me know if there are effects any of you have created that are better than the ones I’m using.

I put a bunch of comments to explain certain parts but it’s pretty straight forward. Hopefully this helps someone out there. Thanks @kareem613 & @wrkn for the help! I used a janky LimitlessLED/MiLight RF Hub for the longest time and hated how unreliable it was. Couldn’t believe I could get an ESP based LED controller for $14 CAD.

substitutions:
  friendly_name: 'Server Rack Led Lights'   # displayed in HA.. Whatever name you'd like

esphome:
  name: server_rack_led_lights # Change this to suit your lights
  platform: ESP8266
  board: esp01_1m # This worked for me even though OP @kareem613 uses 'esp8285' here

ota:
# I was having problems with Broken Pipe timeouts. This helped.
  num_attempts: 3 

wifi:
  ssid: "Your_SSID"
  password: "SSID_Password"

  # Optional manual IP
  manual_ip:
    static_ip: 192.168.xxx.xxx
    gateway: 192.168.xxx.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Server Rack Led Lights" # Whatever name you'd like
    password: "Fallback_SSID_Password"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

# MagicHome with IR - Arilux LC03 (ZJ-WFMN-A V1.1) Light
light:
  - platform: rgb
    name: ${friendly_name}
    id: mh_ledstrip3
    red: pwm_r
    green: pwm_g
    blue: pwm_b
    restore_mode: ALWAYS_ON
    # Effects
    effects:
      - flicker: # The 40% 20% seems to look exactly the same as the default 95% 1.5%. So I kept it. Let me know if there's something that looks better than this "LED strip with a broken PSU" effect.
          name: Flash
          alpha: 40%
          intensity: 20%
      - strobe:
          name: Strobe
      - random:
          name: Fade
          transition_length: 5s
          update_interval: 5s
      - random:
          name: Smooth
          transition_length: 1s
          update_interval: 1s

# GPIO Colour Channels
output:
  - platform: esp8266_pwm
    pin: GPIO12
    frequency: 1000 Hz
    id: pwm_g

  - platform: esp8266_pwm
    pin: GPIO5
    frequency: 1000 Hz
    id: pwm_r

  - platform: esp8266_pwm
    pin: GPIO13
    frequency: 1000 Hz
    id: pwm_b

# GPIO IR Channel
remote_receiver:
  pin:
    number: GPIO4
    inverted: true
  dump: nec
  
# IR Remote Binary Sensors
binary_sensor:

# On, Off, Brightness Buttons 
  - platform: remote_receiver
    id: "on"
    nec:
      address: 0x00FF
      command: 0xB04F
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            effect: none
  - platform: remote_receiver
    id: "off"
    nec:
      address: 0x00FF
      command: 0xF807
    on_press:
      then:
        - light.turn_off:
            id: mh_ledstrip3
  - platform: remote_receiver
    id: brightness_up
    nec:
      address: 0x00FF
      command: 0x906F
    on_press:
      then:
        - light.dim_relative:
            id: mh_ledstrip3
            relative_brightness: 20%
  - platform: remote_receiver
    id: brightness_down
    nec:
      address: 0x00FF
      command: 0xB847
    on_press:
      then:
        - light.dim_relative:
            id: mh_ledstrip3
            relative_brightness: -20%

# Main Colours
  - platform: remote_receiver
    id: red
    nec:
      address: 0x00FF
      command: 0x9867
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 0
            blue: 0
            effect: none
  - platform: remote_receiver
    id: green
    nec:
      address: 0x00FF
      command: 0xD827
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 0
            green: 100%
            blue: 0
            effect: none
  - platform: remote_receiver
    id: blue
    nec:
      address: 0x00FF
      command: 0x8877
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 0
            green: 0
            blue: 100%
            effect: none
  - platform: remote_receiver
    id: white
    nec:
      address: 0x00FF
      command: 0xA857
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 100%
            blue: 100%
            effect: none

# Reds
  - platform: remote_receiver
    id: R2
    nec:
      address: 0x00FF
      command: 0xE817
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 35%
            blue: 14%
            effect: none
  - platform: remote_receiver
    id: R3
    nec:
      address: 0x00FF
      command: 0x02FD
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 57%
            blue: 14%
            effect: none
  - platform: remote_receiver
    id: R4
    nec:
      address: 0x00FF
      command: 0x50AF
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 78%
            blue: 28%
            effect: none
  - platform: remote_receiver
    id: R5
    nec:
      address: 0x00FF
      command: 0x38C7
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 100%
            blue: 0%
            effect: none

# Greens
  - platform: remote_receiver
    id: G2
    nec:
      address: 0x00FF
      command: 0x48B7
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 28%
            green: 100%
            blue: 28%
            effect: none
  - platform: remote_receiver
    id: G3
    nec:
      address: 0x00FF
      command: 0x32CD
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 28%
            green: 100%
            blue: 64%
            effect: none
  - platform: remote_receiver
    id: G4
    nec:
      address: 0x00FF
      command: 0x7887
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 28%
            green: 64%
            blue: 100%
            effect: none
  - platform: remote_receiver
    id: G5
    nec:
      address: 0x00FF
      command: 0x28D7
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 14%
            green: 35%
            blue: 100%
            effect: none

# Blues
  - platform: remote_receiver
    id: B2
    nec:
      address: 0x00FF
      command: 0x6897
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 14%
            green: 14%
            blue: 100%
            effect: none
  - platform: remote_receiver
    id: B3
    nec:
      address: 0x00FF
      command: 0x20DF
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 46%
            green: 28%
            blue: 100%
            effect: none
  - platform: remote_receiver
    id: B4
    nec:
      address: 0x00FF
      command: 0x708F
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 81%
            green: 28%
            blue: 100%
            effect: none
  - platform: remote_receiver
    id: B5
    nec:
      address: 0x00FF
      command: 0xF00F
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 14%
            blue: 78%
            effect: none

# Effect Buttons

# "Flash" Button - Flicker Effect
  - platform: remote_receiver
    id: flash
    nec:
      address: 0x00FF
      command: 0xB24D
    on_press:
      then:
        - if:
            condition:
              lambda: 'return (id(mh_ledstrip3).get_effect_name() == "Flash");'
            then:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: None
            else:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: flash


# "Strobe" Button - Strobe Effect
  - platform: remote_receiver
    id: strobe
    nec:
      address: 0x00FF
      command: 0x00FF
    on_press:
      then:
        - if:
            condition:
              lambda: 'return (id(mh_ledstrip3).get_effect_name() == "Strobe");'
            then:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: None
            else:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: strobe


# "Fade" Button - Slow Random Effect
  - platform: remote_receiver
    id: fade
    nec:
      address: 0x00FF
      command: 0x58A7
    on_press:
      then:
        - if:
            condition:
              lambda: 'return (id(mh_ledstrip3).get_effect_name() == "Fade");'
            then:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: None
            else:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: fade


# "Smooth" Button - Fast Random Effect
  - platform: remote_receiver
    id: smooth
    nec:
      address: 0x00FF
      command: 0x30CF
    on_press:
      then:
        - if:
            condition:
              lambda: 'return (id(mh_ledstrip3).get_effect_name() == "Smooth");'
            then:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: None
            else:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: smooth
1 Like

In case anyone else is trying to do this and finds the same issue as me, I was using a magichome ESP8266 device with IR, as above. All worked great, except for the IR.

I found that most of the NEC codes had nibble order reversed or other changes to the patterns, and all of the addresses were 0xFF00 rather than 0x00FF.

Fortunately this was really easy to debug thanks to the log output - all that was needed was to press each button and type the codes in. Modified file below in case it is useful to someone else:

substitutions:
  friendly_name: 'Server Rack Led Lights'   # displayed in HA.. Whatever name you'd like

esphome:
  name: server_rack_led_lights # Change this to suit your lights
  platform: ESP8266
  board: esp01_1m # This worked for me even though OP @kareem613 uses 'esp8285' here

ota:
# I was having problems with Broken Pipe timeouts. This helped.
  num_attempts: 3 

wifi:
  ssid: "Your_SSID"
  password: "SSID_Password"

  # Optional manual IP
  manual_ip:
    static_ip: 192.168.xxx.xxx
    gateway: 192.168.xxx.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Server Rack Led Lights" # Whatever name you'd like
    password: "Fallback_SSID_Password"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

# MagicHome with IR - Arilux LC03 (ZJ-WFMN-A V1.1) Light
light:
  - platform: rgb
    name: ${friendly_name}
    id: mh_ledstrip3
    red: pwm_r
    green: pwm_g
    blue: pwm_b
    restore_mode: ALWAYS_ON
    # Effects
    effects:
      - flicker: # The 40% 20% seems to look exactly the same as the default 95% 1.5%. So I kept it. Let me know if there's something that looks better than this "LED strip with a broken PSU" effect.
          name: Flash
          alpha: 40%
          intensity: 20%
      - strobe:
          name: Strobe
      - random:
          name: Fade
          transition_length: 5s
          update_interval: 5s
      - random:
          name: Smooth
          transition_length: 1s
          update_interval: 1s

# GPIO Colour Channels
output:
  - platform: esp8266_pwm
    pin: GPIO12
    frequency: 1000 Hz
    id: pwm_g

  - platform: esp8266_pwm
    pin: GPIO5
    frequency: 1000 Hz
    id: pwm_r

  - platform: esp8266_pwm
    pin: GPIO13
    frequency: 1000 Hz
    id: pwm_b

# GPIO IR Channel
remote_receiver:
  pin:
    number: GPIO4
    inverted: true
  dump: nec
  
# IR Remote Binary Sensors
binary_sensor:

# On, Off, Brightness Buttons 
  - platform: remote_receiver
    id: "on"
    nec:
      address: 0xFF00
      command: 0xF20D
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            effect: none
  - platform: remote_receiver
    id: "off"
    nec:
      address: 0xFF00
      command: 0xE01F
    on_press:
      then:
        - light.turn_off:
            id: mh_ledstrip3
  - platform: remote_receiver
    id: brightness_up
    nec:
      address: 0xFF00
      command: 0xF609
    on_press:
      then:
        - light.dim_relative:
            id: mh_ledstrip3
            relative_brightness: 20%
  - platform: remote_receiver
    id: brightness_down
    nec:
      address: 0xFF00
      command: 0xE21D
    on_press:
      then:
        - light.dim_relative:
            id: mh_ledstrip3
            relative_brightness: -20%

# Main Colours
  - platform: remote_receiver
    id: red
    nec:
      address: 0xFF00
      command: 0xE619
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 0
            blue: 0
            effect: none
  - platform: remote_receiver
    id: green
    nec:
      address: 0xFF00
      command: 0xE41B
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 0
            green: 100%
            blue: 0
            effect: none
  - platform: remote_receiver
    id: blue
    nec:
      address: 0xFF00
      command: 0xEE11
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 0
            green: 0
            blue: 100%
            effect: none
  - platform: remote_receiver
    id: white
    nec:
      address: 0xFF00
      command: 0xEA15
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 100%
            blue: 100%
            effect: none

# Reds
  - platform: remote_receiver
    id: R2
    nec:
      address: 0xFF00
      command: 0xE817
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 35%
            blue: 14%
            effect: none
  - platform: remote_receiver
    id: R3
    nec:
      address: 0xFF00
      command: 0xBF40
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 57%
            blue: 14%
            effect: none
  - platform: remote_receiver
    id: R4
    nec:
      address: 0xFF00
      command: 0xF50A
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 78%
            blue: 28%
            effect: none
  - platform: remote_receiver
    id: R5
    nec:
      address: 0xFF00
      command: 0xE31C
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 100%
            blue: 0%
            effect: none

# Greens
  - platform: remote_receiver
    id: G2
    nec:
      address: 0xFF00
      command: 0xED12
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 28%
            green: 100%
            blue: 28%
            effect: none
  - platform: remote_receiver
    id: G3
    nec:
      address: 0xFF00
      command: 0xB34C
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 28%
            green: 100%
            blue: 64%
            effect: none
  - platform: remote_receiver
    id: G4
    nec:
      address: 0xFF00
      command: 0xE11E
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 28%
            green: 64%
            blue: 100%
            effect: none
  - platform: remote_receiver
    id: G5
    nec:
      address: 0xFF00
      command: 0xEB14
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 14%
            green: 35%
            blue: 100%
            effect: none

# Blues
  - platform: remote_receiver
    id: B2
    nec:
      address: 0xFF00
      command: 0xE916
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 14%
            green: 14%
            blue: 100%
            effect: none
  - platform: remote_receiver
    id: B3
    nec:
      address: 0xFF00
      command: 0xFB04
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 46%
            green: 28%
            blue: 100%
            effect: none
  - platform: remote_receiver
    id: B4
    nec:
      address: 0xFF00
      command: 0xF10E
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 81%
            green: 28%
            blue: 100%
            effect: none
  - platform: remote_receiver
    id: B5
    nec:
      address: 0xFF00
      command: 0xF00F
    on_press:
      then:
        - light.turn_on:
            id: mh_ledstrip3
            red: 100%
            green: 14%
            blue: 78%
            effect: none

# Effect Buttons

# "Flash" Button - Flicker Effect
  - platform: remote_receiver
    id: flash
    nec:
      address: 0xFF00
      command: 0xB24D
    on_press:
      then:
        - if:
            condition:
              lambda: 'return (id(mh_ledstrip3).get_effect_name() == "Flash");'
            then:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: None
            else:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: flash


# "Strobe" Button - Strobe Effect
  - platform: remote_receiver
    id: strobe
    nec:
      address: 0xFF00
      command: 0xFF00
    on_press:
      then:
        - if:
            condition:
              lambda: 'return (id(mh_ledstrip3).get_effect_name() == "Strobe");'
            then:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: None
            else:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: strobe


# "Fade" Button - Slow Random Effect
  - platform: remote_receiver
    id: fade
    nec:
      address: 0xFF00
      command: 0xE51A
    on_press:
      then:
        - if:
            condition:
              lambda: 'return (id(mh_ledstrip3).get_effect_name() == "Fade");'
            then:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: None
            else:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: fade


# "Smooth" Button - Fast Random Effect
  - platform: remote_receiver
    id: smooth
    nec:
      address: 0xFF00
      command: 0xF30C
    on_press:
      then:
        - if:
            condition:
              lambda: 'return (id(mh_ledstrip3).get_effect_name() == "Smooth");'
            then:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: None
            else:
              - light.turn_on:
                   id: mh_ledstrip3
                   effect: smooth