Arlec Grid Connect Ceiling Fans

If you cant replace the esp module you may want to check out the tuya local custom component. I have it controlling my arlec fan and light without issue.

See my previous post in this thread for some more detail. The local tuya project has advanced a lot since that post as well.

1 Like

@tinglis1 my man! utter champion, followed a few of the links, found some screenshots that @Hawker180 posted on one of your threads, and bingo, with a little bit of HACS and that wonderful local/tuya intergration, that was easy!
Just from the quick muck around with it, I had one of my fans turning the light on and off, dimming and colour changing, and had a fan spinning in summer mode with the 6 speeds.
Haven’t yet looked at adding in the ability to change to winter mode, and also swapping the light colour around; let alone adding in the modes (normal, sleep, breeze).
Is there a list or repo somewhere that has the commands for the fans or switches etc, or is it just hit and hope kinda thing?

1 Like

Winter mode should already be there.
The modes were not working last time I checked. I had plans to add it to the integration along with some string handling for other tuya fans that need some subtle differences in speed commands (number strings for some and integers for others)

Are you talking about the DPS codes or how to use the fan with HA?
The DPS codes should be in one of my previous posts.
The commands in HA are standard fan commands once added. I have mine in homekit and it works perfectly.
There is a lot more info in the GitHub repo for local tuya. Have a look at the pull request for the fan update I did.

This is great! Do you still have any boards available? I’m really keen to fix my fans as I’m getting random disconnects requiring me to flick the circuit breaker to reboot the fans to get them talking to Tuya Local again. Very poor WAF!

@AutoM8r @StrangerJona @s_ockey I’ve also still got a few boards left (from the OP in this thread). DM if you’re interested.

Hello Ryan
@rymo
How do I get in contact with you , Im local here in Australia , new todo this forum

I have 6 fans manufactured by a company called “airborne”

What started me on this goose chase was being able to control the fans via wifi , I was looking into the various options on what to do, then came across this post

Turns out the airborne remotes look identical arlec

I’ve even pulled the receiver apart and they are the same

How can I get in contact with you to purchase some boards

Thanks again Mark

Hi @MTP

That main board is a different variant, looks more like: Arlec Grid Connect Ceiling Fans - #17 by tjhowse I don’t know if @tjhowse ever got theirs working.

Presence of the header is promising, but the unpopulated components next to the 10 pin WiFi module header will be the main issue.

Your variant also has a different chip set with 2 SOIC ICs rather than a single QFN IC on my board. As your board only has one LED connector with no brightness controls on the remote, I guess it is simple on/off control for the LEDs and they have used cheaper, simpler chips for this variant. A simple MCU + a dedicated controller for the fan? My board has 2 dimmable LED channels for warm & cool white so I guess they’ve used a more advanced MCU for my variant with PWM peripherals to drive the LEDs as well as the fan.

It’s also possible that firmware support for the Tuya serial interface is not present on your variant.

Control via 433 / 915 MHz remote may still be possible?

-Ryan

Edit: This prompted me to spend the day figuring out how to control my 433.9MHz-only ceiling fan which was ultimately successful: Support fan direction toggle & add EGLO Noosa RF codes by rmounce · Pull Request #995 · smartHomeHub/SmartIR · GitHub
I’ll see what the RF control of these fans looks like. I’m guessing each remote has a unique ID so it’d be necessary to re-learn all of the codes for each fan. I used an RTL-SDR to receive & decode and am transmitting from an ESP32 w/ ESPHome.

Hello @rymo

Thank you for your thoughts on this
And I’m grateful for your time.

Yes you are correct there is no Dimming

Also I don’t even have lights on these fans, I have downlights in each room

I am currently using a product called BOND to control the fans

The major problem is because it is RF based there is no real time feedback to tell the system the Fan is actually running.

If someone comes into the room and uses the remote to turn the fan on.
Then HA doesn’t know what status the fan is left in.

This becomes more of an issue when you say turn the whole house off. (Because it doesn’t know what fans are on or off)

I could probably just put a HA controlled smart Switch mech on the active that feeds the power to the fan. To kill the power feed. Would probably overcome this issue.

My question to you would be.
Regarding your project using the esp chips.

Do you get feedback on the status of fan, for example If someone comes and uses an external remote to control the fan. Does the “ON” status get updated on to the HA,

Im in two minds on what todo. Maybe not worth the headache if your right about the board not being populated.

Thanks again,

Yes with my fans any changes made with the RF remote update the state in Home Assistant.

Re: turning off all fans in the house. The “power” button in the middle of the speeds 1-6 always turns my Arlec fans off rather than toggling the power state. I still haven’t decoded my Arlec RF remotes, but I believe they’re stateless & just send a code corresponding to each button.

If Bond and/or Home Assistant believe that the fan is already off & are not sending the message in that case, a crude workaround may be a script that sets fan speed to 1, waits 100ms, then turns the fan off.

Hello @rymo

Ok thank you so much makes sense, this is what I was hoping for.

I like your idea about the script I hadn’t thought of this. Might be a very simple work around for now.

Thank you again for your help much appreciated.

I will let you know how I get on,

Hi @rymo
This is a great project, thankyou for doing it! Do you have any PCB’s left? Would love to grab one if so.

Hi folks, I have these (specifically the DCF4002WHA) working 100% as desired using Tasmota, but avoiding Tasmota autodiscovery (as the support for the MCU is poor), and also leaning heavily on raw TuyaMCU commands. This setup works in real-time and any settings applied via the remote control for the fan are reflected immediately in HomeAssistant. Fan speeds work perfectly, brightness works perfectly, and colour temps work perfectly.

The Console commands for TuyaMCU only need to enable the light and fan power. The rest is done using raw TuyaMCU commands in the MQTT config within HA.

Backlog TuyaMCU 11,1; TuyaMCU 12,9

DO NOT use the console command “TuyaMCU 21,10”. As of Tasmota 12.4.0.5 it crashes the MCU and the entire unit will not work after a power cycle. If you ever accidentally enter this command it must be zeroed out with the console command “TuyaMCU 21,0” and power cycling the device.

You must also enable Option 66 via the Tasmota console and “SetOption66 1”.
The Tasmota template is:

{"NAME":"Arlec DCF4002WHA","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54}

The following MQTT code works for these devices, noting you need to change your topic and device name to suit your device.

fan:
    name: "Theatre Fan"
    unique_id: "Theatre Fan"
    state_topic: "tele/tasmota_C23047/RESULT"
    state_value_template: "{{ 'ON' if '1' in value_json.TuyaReceived and value_json.TuyaReceived['1'].DpIdData == '01' else 'OFF' if '1' in value_json.TuyaReceived and value_json.TuyaReceived['1'].DpIdData == '00' }}"
    command_topic: "cmnd/tasmota_C23047/POWER1"
    payload_on: 'ON'
    payload_off: 'OFF'
    percentage_command_topic: "cmnd/tasmota_C23047/TuyaSend4"
    percentage_command_template: "{{ {1: '3,0', 2: '3,1', 3: '3,2', 4: '3,3', 5: '3,4', 6: '3,5'}[value] | default('1') }}"
    percentage_state_topic: "tele/tasmota_C23047/RESULT"
    percentage_value_template: "{{ (value_json.TuyaReceived['3'].DpIdData | int) + 1 if '3' in value_json.TuyaReceived }}"
    speed_range_min: 1
    speed_range_max: 6
    preset_modes:
      - "Summer"
      - "Winter"
    preset_mode_command_topic: "cmnd/tasmota_C23047/TuyaSend4"
    preset_mode_command_template: >
      {% if value == 'Winter' %}4,1
      {% elif value == 'Summer' %}4,0
      {% endif %}    
    preset_mode_state_topic: "tele/tasmota_C23047/RESULT"
    preset_mode_value_template: >
      {%- if '4' in value_json.TuyaReceived %}
        {%- if value_json.TuyaReceived['4'].DpIdData | int == 1 %}Winter
        {%- elif value_json.TuyaReceived['4'].DpIdData | int == 0 %}Summer
        {%- endif %}
      {%- endif %}
  light:
    name: "Theatre Light"
    unique_id: "Theatre Light"
    state_topic: "stat/tasmota_C23047/POWER2"
    command_topic: "cmnd/tasmota_C23047/POWER2"
    payload_on: 'ON'
    payload_off: 'OFF'
    brightness_command_topic: "cmnd/tasmota_C23047/TuyaSend2"
    brightness_command_template: "{{ '10,' ~ (((value | int) // 2) * 2) }}"
    brightness_state_topic: "tele/tasmota_C23047/RESULT"
    brightness_scale: 100
    brightness_value_template: "{{ (value_json.TuyaReceived['10'].DpIdData | int(base=16)) if '10' in value_json.TuyaReceived else None }}"
    color_temp_command_topic: "cmnd/tasmota_C23047/TuyaSend2"
    color_temp_command_template: "{{ '11,' ~ ((value - 154) * 100 / (370 - 154)) | round }}"
    color_temp_state_topic: "tele/tasmota_C23047/RESULT"
    color_temp_value_template: "{{ (154 + (value_json.TuyaReceived['11'].DpIdData | int(base=16)) * (370 - 154) / 100) | round if '11' in value_json.TuyaReceived else None }}"
    min_mireds: 154
    max_mireds: 370

A summary of the code is that it uses raw TuyaSend commands to make changes, and reviews the Tasmota MQTT Tele commands which - via the use of Option 66 for TuyaMCU - includes the raw status of all the dpIds and parses those for the value it is looking for.

image

1 Like

I’ve just done my second DCF4002WHA using the code I posted above and confirmed it works on this second device. For this unit, I used a TYWE2S based on the ESP8285 and the only difference was that I did not need to wire up the EN pin as I believe the TYWE2S board has this hardwired to VCC.

1 Like

Replying to a question from @Kaldek here for everyone’s benefit:

Hi mate, I just completed getting these ceiling fans working perfectly via Tasmota but didn’t notice your post until I was done. I didn’t do any work on the TX pin for managing the 5v from the MCU and mine seems to be stable. I’m using the Tuya TYWE3S module.

Thoughts on why this might be the case? I did solder my module onto the pins on the existing daughterboard, as I assumed the capacitors were put there for power filtering.

IIRC, I was originally testing with an ESP-01 module without any protection. It started to misbehave after a while. I identified the 5V IO, blamed the instability on this and added the series diode. No issues since.

The TYWE3S datasheet specifically says V_IH=VCC which is nominal 3.3V max 3.6V:

But then the original WR4 module has the same parameters:

Possibilities that come to mind:

  • My initial measurements were bad and there’s no 5V IO. Diode resolving instability was a coincidence.
  • Arlec didn’t read the WR4 datasheet, are driving its GPIO beyond spec and getting away with it. WR4/RTL8710BN more tolerant than ESP8266.

I recently cooked a Lolin ESP32-S2 Mini by trying to control a roller door with open drain output from the ESP. I can’t recall if the roller door was pulling that input up to 5V or 12V, but now I’m extra paranoid about exposing my ESPs to >3.6V under any circumstances.

It may now be possible to flash the LibreTiny port of ESPHome directly onto the original WR4 module which uses a RTL8710BN.

https://docs.libretiny.eu/docs/projects/esphome/

How easy is it to remove the control module from these fans if they’re already up on the ceiling?

1 Like

i migth have to pull my deck fan down tomorrow in the daylight, and see whats under the hood, and potentially see if i can flash it as per your comment above.

So just confirming if I just want to use HA for the ceiling fan speeds and making some timers etc, i wont need to do any flashes? It will just connect to HA? Im still a noob to all this

I’ve had success flashing ESPHome to the WR4 inside an arlec “Smart Madrid” DCF4002WHA ceiling fan. I’ve written up some rough notes and screenshots here: projects:arlec_smart_fans:overview [Travis' Wiki]

1 Like

That worked really well thanks Travis. You got RX and TX the wrong way round
on your USB-TTL serial adaptor wiring diagram, but I will let you off. Great work on your write up/documentation on this and the rest of your projects - much appreciated.

Hi team, sorry to hijack your thread, I have a similar control board without wifi and would like to add a manual rotary switch to control it. Is this possible?