Dancing flame candles (IR Remote light)

I went on a mission te replace my wax candles with something more modern, and I find these dancing flame candles quite convincing. Most of them come with a generic IR remote, so I decided to give it a shot and bought these:
image

I enabled the following features:

After you learn your remote, use the following config to control them:
(make sure your learnt remote commands have a matching name)

input_boolean:
  candles_state:
    name: "Candles State"
input_number:
  candles_brightness:
    name: "Candles Brightness"
    initial: 7
    min: 1
    max: 7
    step: 1
input_select:
  candles_effect:
    name: "Candles Effect"
    options:
      - candle
      - light
    initial: candle
light:
  - platform: template
    lights:
      candles:
        friendly_name: "Candles"
        unique_id: living_room_candles
        value_template: "{{ states('input_boolean.candles_state') }}"
        level_template: "{{ ((states('input_number.candles_brightness')|int)* (255/state_attr('input_number.candles_brightness', 'max'))) | round(0, 'ceil') }}"
        effect_list_template: "{{ state_attr('input_select.candles_effect', 'options') }}"
        effect_template: "{{ states('input_select.candles_effect') }}"
        turn_on:
          - service: remote.send_command
            data:
              num_repeats: 1
              delay_secs: 0.4
              hold_secs: 0
              command: "on"
              device: candles
            target:
              entity_id: remote.broadlink_remote
          - service: input_boolean.turn_on
            target:
              entity_id: input_boolean.candles_state
          - service: input_select.select_option
            data:
              option: "candle"
            target:
              entity_id: input_select.candles_effect
          # Sync the brightness
          - service: remote.send_command
            data:
              num_repeats: "{{ (state_attr('input_number.candles_brightness', 'max') - states('input_number.candles_brightness')| int) | abs }}"
              delay_secs: 0
              hold_secs: 0
              command: "brightness_down"
              device: candles
            target:
              entity_id: remote.broadlink_remote
        turn_off:
          - service: remote.send_command
            data:
              num_repeats: 1
              delay_secs: 0.4
              hold_secs: 0
              command: "off"
              device: candles
            target:
              entity_id: remote.broadlink_remote
          - service: input_boolean.turn_off
            target:
              entity_id: input_boolean.candles_state
        set_level:
          - service: remote.send_command
            data:
              num_repeats: "{{ (((brightness / (255/state_attr('input_number.candles_brightness', 'max'))) | round(0, 'ceil')) - states('input_number.candles_brightness')| int) | abs }}"
              delay_secs: 0
              hold_secs: 0
              command: "{{'brightness_up' if (((brightness / (255/state_attr('input_number.candles_brightness', 'max'))) | round(0, 'ceil')) > states('input_number.candles_brightness')| int) else 'brightness_down'}}"
              device: candles
            target:
              entity_id: remote.broadlink_remote
          - service: input_number.set_value
            data:
              value: "{{ (brightness / (255/state_attr('input_number.candles_brightness', 'max'))) | round(0, 'ceil')  }}"
            target:
              entity_id: input_number.candles_brightness
        set_effect:
          - service: remote.send_command
            data:
              num_repeats: 1
              delay_secs: 0.4
              hold_secs: 0
              command: "{{ effect }}"
              device: candles
            target:
              entity_id: remote.broadlink_remote
          - service: input_select.select_option
            data:
              option: "{{ effect }}"
            target:
              entity_id: input_select.candles_effect

Edit:

  • Sync brightness on startup
  • Use candles_brightness max for brightness calculations
3 Likes

I use a Broadlink IR remote now, but I’m going to switch that out for a AtomS3 Lite ESP32S3
I’ve used a few of these to control air conditioners, and they make amazing little IR blasters and BLE proxies.

I used fifferent approach; as in specific room I put these candles I already had audio fgear controlled by Harmony remote, I learned it the codes and configured additional always on device in the system. Then controlling candles from HA via Rarmony integration.

Can you share the ir dataset code? I lost the remote and I can’t learn it.
Thanks

Sorry, I do not know how to! I used Harmony ability to learn codes by receiving the signal from original remote. I tried to look for any ‘code export’ functionaity in Harmony app, but did not found anything like that :frowning:

Sure! These come from my Broadlink integration, not sure they can be transplanted to another IR device though:

    "candles": {
      "on": "JgBoAAABKpMUEhQRFBEUEhQRFBEUEhQRFDcUNhQ3FDYUNxQ2FDYUNxQRFBIUERQRFBIUERQRFBIUNhQ3EzcUNxM3FDcTNxU2FAAFHQABK0oUAAxeAAErShQADF0AASxJFAAMXgABLUkUAA0F",
      "off": "JgBIAAABKpMUEhQRFBITEhQRFBIUERQSEzcUNxM3FDcTNxI5FDYUNxITFDcTEhITFBIUERQSExIUNhQSFDYUNxQ2FDcUNhQ3FAANBQ==",
      "candle": "JgBQAAABKpMUERQSFBEUERQSExIUERQSEzcUNxM3FDYUNxQ2FDcUNhQRFBIUNhQ3EhMUERQSExIUNhQ3FBEUERQ3FDYUNxM3FAAFHQABK0kUAA0F",
      "light": "JgBQAAABK5MUERQRFBIUERQSExIUERQSFDYUNhQ3FDYUNxQ2FDcUNhQSFDYUNhQ3FBEUEhMSFBEUNxMSFBEUEhM3FDYUNxI4FAAFHAABLEoSAA0F",
      "brightness_down": "JgBQAAABKJUSFBITEhMSFBITEhMSFBITEjkSOBI4EzgSOBI5EjgTOBITEhQSExITEjkSExITExMSOBI5EjgSORITEjkRORI4EgAFHgABK0sSAA0F",
      "brightness_up": "JgBQAAABK5MTEhQRFBITEhQRFBEUEhQRFDcTNxQ2FDcUNhQ3FDYUNxQRFDYUEhQRFDYUEhMSFBEUNxQRFDYUNxQRFDcTNxQ3EwAFHQABKUwSAA0F"
    }

1 Like

I am finding this very interesting. I want to do the same with our holiday candles, about 30 of them from different manufactures. Of course all use different codes it appears. I have a couple unused Harmony remotes, I know they have very broad IR range so will be giving this a try.

I also wonder if the Harmony remote is the best choice for this… I may order a generic one and see it it works.

One thing I did to make life a little easier when turning on/off the candles this last Christmas was to change the little board in all the bigger ones to some I got from purchasing a whole bunch of tea candles which had a very simple remote with on/off, 4/6 hr timer and flicker or steady light buttons. Now at least we can turn them on/off using only one remote. I bought three packs of 12 candles and the remote from one box worked on the other two boxes of them.

But getting them into HA would be the “bomb” as the kids say!

Thanks for the inspiration!

You’re welcome! For IR, imho the best solution for IR is ESPHome in combination with an m5stack module.

Okay, I have somewhat completed my flickering candle project. I used the Broadlink RM4 Pro for large coverage. We have a very open floor plan, not sure what the square footage is and there are candles on three walls and on the landing going to the lower level. I have converted all the candles to the same remote boards taken from some IR tea candles (cheap, 12 for $12). Very simple control setup, On/Off, 6hr and 8hr.

So far and am very pleased with the setup, automations runs and turns on the candles the same as the rest of the evening lights, and off when we go to bed.

I did fool around with ESPHome and the m5stack but the coverage was spotty and is why I went to the RM Pro. I also tried the Logitech remote with the IR blaster but I really did not like the program used to configure the setup. The RM Pro integrated very easily and seamlessly.

My thanks to all who posted their thought’s and suggestions for doing this.

1 Like

Can you please share this ESPHome config when ready? Thank you.

I really did not get this working the way I wanted the IR function to work so abandoned the project. But I did not spend a lot of time on it, my experience with ESPHome is limited and so far not impressed but it.

But, but, this is my take on it…