XCRhom.tech RGB Bulbs

Table of Contents

I bought some more ESPHome RGB bulbs from AliExpress (hey, the US is unpredictable right now in terms of tariffs so I’m avoiding purchasing from them until this “trade war” has gone away). They came in as XCRHom.tech RGB bulbs (great name, definitely not a typo) and they have a less than useful website for well, anything https://xcrhom.tech/

There’s no details on what the actual config should be, the pinouts or anything like that.

First Programming attempt

I found these bulbs didn’t like connecting to my usual “IOT” network, which I suspect was due to the preinstalled firmware and the fact I use the same SSID for 2.4 and 5GHz (maybe I should change that at some point), so I used my IOS(hit) network which is just 2.4GHz. And that worked fine. From there I could hit them with a config file.

Since they seemed very similar to my existing Athom bulbs, I used that config file, but it didn’t work that great

  • On/Off  ✅
  • Setting to White  ❌ The bulb went Blue
  • Setting to Red ❌ The bulb went White
  • Setting to Blue❌ The bulb went Green
  • Setting to Green ❌ The bulb went Red

So this was less then awesome, but pretty easy to reorder the inputs

Space issues

The next issue I encountered was lack of space on reflashing, this was because it couldn’t store the new firmware to update to when it was running the previously programmed firmware. This wasn’t an issue with the first flash as the “staged” basic firmware takes up very little space.

Since the athom bulbs came with a preprogrammed NTP config, which I didn’t really need, I just deleted that from the configuration file and it bought the size down enough to program without any issues

Configuration files

As with my previous configurations, I use a combination of files.

xcrhom-rgb-1.yaml

(repeat this file for each bulb just changing the file name and number)

substitutions:
  number: "1"
  friendly_name: "XCRhome RGBCW Bulb ${number}"
  # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
  room: ""
  # Description as appears in ESPHome & top of webserver page
  device_description: "xcrhom 7w rgbcw light bulb"
  # Restore the light (GPO switch) upon reboot to state:
  light_restore_mode: RESTORE_DEFAULT_ON
  # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
  wifi_fast_connect: "false"
  # Enable or disable the use of IPv6 networking on the device
  ipv6_enable: "false"
  color_interlock: "true"

<<: !include common/xcrhom-rgbct.yaml

xcrhom-rgb.yaml

# Put these in the parent file
# substitutions:
#   number:
#   friendly_name: "XCRHom RGBCW Bulb ${number}"
#   # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
#   room: ""
#   # Description as appears in ESPHome & top of webserver page
#   device_description: "XCR 7w rgbcw light bulb"
#   # Restore the light (GPO switch) upon reboot to state:
#   light_restore_mode: RESTORE_DEFAULT_ON
#   # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
#   dns_domain: ".local"
#   # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
#   wifi_fast_connect: "false"
#   # Enable or disable the use of IPv6 networking on the device
#   ipv6_enable: "false"
#   color_interlock: "true"

packages:
  restore_light_state: !include restore_light_state.yaml
  common: !include common.yaml

esphome:
  name: "xcrhome-rgbcw-bulb-${number}"
  # Default friendly name
  friendly_name: "${friendly_name}"
  comment: "${device_description}"
  area: "${room}"
  name_add_mac_suffix: false
  min_version: 2024.6.0

esp8266:
  board: esp8285
  restore_from_flash: true

preferences:
  flash_write_interval: 1min

binary_sensor:
  - platform: status
    name: "Status"
    entity_category: diagnostic

sensor:
  - platform: uptime
    name: "Uptime Sensor"
    id: uptime_sensor
    entity_category: diagnostic
    internal: true

  - platform: wifi_signal
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

button:
  - platform: restart
    name: "Restart"
    entity_category: config

  - platform: safe_mode
    name: "Safe Mode"
    internal: false
    entity_category: config

output:
  - platform: esp8266_pwm
    id: white_output
    pin: GPIO4
    min_power: 0.000499
    max_power: 1
  - platform: esp8266_pwm
    id: red_output
    pin: GPIO12
    min_power: 0.000499
    max_power: 1
  - platform: esp8266_pwm
    id: green_output
    pin: GPIO14
    min_power: 0.000499
    max_power: 1
  - platform: esp8266_pwm
    id: warm_white_output
    pin: GPIO13
    min_power: 0.000499
    max_power: 0.9
  - platform: esp8266_pwm
    id: blue_output
    pin: GPIO5
    min_power: 0.000499
    max_power: 0.9

light:
  - platform: rgbww
    id: rgbww_light
    name: "RGBCW_Bulb"
    restore_mode: ${light_restore_mode}
    red: red_output
    green: green_output
    blue: blue_output
    warm_white: warm_white_output
    cold_white: white_output
    cold_white_color_temperature: 6000 K
    warm_white_color_temperature: 3000 K
    color_interlock: ${color_interlock}

text_sensor:
  - platform: wifi_info
    ip_address:
      name: "IP Address"
      entity_category: diagnostic
    ssid:
      name: "Connected SSID"
      entity_category: diagnostic
    mac_address:
      name: "Mac Address"
      entity_category: diagnostic

  #  Creates a sensor showing when the device was last restarted
  - platform: template
    name: "Last Restart"
    id: device_last_restart
    icon: mdi:clock
    entity_category: diagnostic

common.yaml

substitutions:
  wifi_fast_connect: "false"

# Common configuration to setup defaults
logger:

web_server:

captive_portal:

mdns:

api:

ota:
  platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
  power_save_mode: none
  # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID
  fast_connect: "${wifi_fast_connect}"

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *