ZigBee Fan Switch | Project Zephyr (Blue Series)

@Eric_Inovelli Is there any news on zwave version of this fan switch?

2 Likes

Sorry for my ignorance (i did not learn ESP32 platform yet) - these devices should have hardwired connection or WiFi? Any good tutorial you can recommend to get up to speed on ESP32 in HA?

They’re typically WiFi, but you can add ethernet to them if you wish. For HA, you’ll want to be using ESPHome. It’s owned by the HA team and available through the add-on store. If you hop on YouTube there’s a ton of getting started with ESPHome videos.

But in a nutshell…

You start with an ESP32 device (for BLE it must be ESP32 and not ESP8266). I get mine from AliExpress, but amazon should have some as well for faster delivery. If you’re just doing BLE m5stack has a nice one with a case that’s tiny.

Plug the device into your computer with a USB cable.
In ESPHome click New Device and give it a name
Select your device type (ESP32)
Click install.

You now have ESPHome on your ESP32.
Go back into ESPHome
Edit the device you just created
Add this line of code

bluetooth_proxy:

Install again.

That’s it, you now have a BLE proxy that feeds data into Home Assistant. Place a few of these around the house and you can use any supported Bluetooth devices you want.

LOTS of projects you can do with ESPHome. I’ve used it to build garage door controllers with open/close sensors, motion sensor, temp/humidity sensor, ultrasonic sensor to detect if a car is parked there. Automated my propane fireplace switch. Plugs. Bulbs. People automate coffee machines. I added esp32’s to Ikea’s $10 air quality sensors to feed the data into HA. And in relation to the automation I mentioned with the shower… it’s an ESP32 controlling a dry contact relay that triggers my air exchanger. But with a bathroom fan you’d just trigger your Fan Switch instead of the air exchanger.

So be warned… I can’t be held liable when you catch the bug and start automating absolutely everything in your house LOL

1 Like

Too late for warning :slight_smile: I caught that bug in 2013 with Homeseer. Almost got divorced - my wife is in software (QA and release management), and doesn’t really understand that automation is a process :slight_smile: Recently due to Instaeon fiasco I decided to move to HA (too much risk with small privately hold company Homeseer and I do not want to continue to pay for every new plug-in ). I have ZigBee, Z-wave, RadioRA2 (mainly for blinds), thermostats, many different motion sensors (finally I think I’ll convert everything to mmWave Human Presence Sensors from AliExpress)…

This is what caught my attention. I am planning to use Lunos e2 - ductless heat recovery ventilation - net zero - tiny house - HRV ERV with relays and wanted to integrate with some air quality monitor (I was thinking about Airthings 2930 Wave Plus, which requires BLE, but I saw your post about ESP32 as bluetooth adaptor). Can you please send a link to Ikea air quality sensor with ESP32 interface?

1 Like

Here is the air quality sensor: Ikea Vindriktning

The ESP32 needs to be mini to fit into the case. I use these.

Here are the instructions to build it. I also connected the red wire from the fan to the 3.3v pin on the ESP32 and black to ground so it runs constant.

The ESPHome code.

The official ESPHome Docs.

And the data plugged into a mini-graph-card (I just cooked some bacon LOL). I plan on adding some card-mod code to the card to change the line color based on the reading to match the LED on the air quality sensor, but still working at building out my dashboard.

BONUS: Add the bluetooth_proxy: line of code to it and these will also act as your BLE proxy sensors. You can also add a temp/humidity sensor very easily to really make this unit shine.

1 Like

Awesome, thanks a lot.
My wife is traveling next week, so I think I’ll try it :wink:

If you don’t want to venture down the ESP route there is also a smart version now - if you can find it in stock. VINDSTYRKA Air quality sensor, smart - IKEA CA

2 Likes

For those of us in the States…
Smart Version

Sensor Version

We should probably split off this air quality and ESPHome discussion into another thread since it’s kind of related but mostly off-topic.

We kind of ended up here through bluetooth proxies. The smart version from Ikea would not be able to act as one. But it does include the temp, humidity and has a nice display to it as well.

I did re-do my air quality card from above to make it fit my mushroom-themed dashboard.

Icon colour and state changes dynamically based on the reading I initially had the entire line change colours based on the current state, but decided historical state should still indicate when it was outside of “good” so I decided to use colour thresholds instead. All are based on the US AQI PM2.5 thresholds.

Here is the code
type: vertical-stack
cards:
  - type: custom:mushroom-title-card
    title: ''
    subtitle: 'Air Quality:'
  - type: custom:vertical-stack-in-card
    cards:
      - type: grid
        square: false
        columns: 2
        cards:
          - type: custom:mushroom-template-card
            entity: sensor.living_room_air_quality
            icon: mdi:air-filter
            icon_color: >-
              {% set state = states('sensor.living_room_air_quality') | float %}

              {% set levels = [12, 35, 55, 150, 250] %}

              {% set colors = ['green', 'yellow', 'orange', 'red', 'purple',
              'brown'] %}

              {% set COLOR = (state <= levels[0]) and colors[0] or
                             (state <= levels[1]) and colors[1] or
                             (state <= levels[2]) and colors[2] or
                             (state <= levels[3]) and colors[3] or
                             (state <= levels[4]) and colors[4] or
                             colors[5]
              %}

              {{ COLOR }}
            primary: |
              {{ states('sensor.living_room_air_quality') | round(1) }}μg/m³ 
            secondary: >-
              {% set state = states('sensor.living_room_air_quality') | float %}

              {% set levels = [12, 35, 55, 150, 250] %}

              {% set qualities = ['Good', 'Moderate', 'Unhealthy Sensitive Ind',
              'Unhealthy', 'Very Unhealthy', 'Hazardous'] %}

              {% set QUALITY = (state <= levels[0]) and qualities[0] or
                             (state <= levels[1]) and qualities[1] or
                             (state <= levels[2]) and qualities[2] or
                             (state <= levels[3]) and qualities[3] or
                             (state <= levels[4]) and qualities[4] or
                             qualities[5]
              %} 

              {{ QUALITY }}
            card_mod:
              style: |
                :host {
                --icon-size: 38px !important; 
                --card-primary-font-size: 16px !important;
                --card-secondary-font-size: 10px!important;
                }
      - type: custom:mini-graph-card
        entities:
          - entity: sensor.living_room_air_quality
            name: Temperature
        hours_to_show: 24
        points_per_hour: 60
        line_width: 3
        font_size: 50
        animate: true
        color_thresholds_transition: hard
        color_thresholds:
          - value: 0
            color: green
          - value: 12
            color: yellow
          - value: 35
            color: orange
          - value: 55
            color: red
          - value: 150
            color: purple
          - value: 250
            color: brown
        show:
          name: false
          icon: false
          state: false
          legend: false
          fill: fade
1 Like

@MRobi @stu1811
I think it is a good idea to split off this discussion to separate thread
I have tons of questions :slight_smile:

1 Like

Still can add ESPHome integration (can be used for bluetooth proxies ?)

Ughhh @vladimir.korobov why’d you have to show me this? Now I need them! LOL

LOL…I already ordered.
Now, this item
https://www.aliexpress.us/item/3256801435529393.html?spm=a2g0o.order_list.order_list_main.32.4ffb1802YjwwmE&gatewayAdapt=glo2usa4itemAdapt

has very long lead time (about month).

How about these: they look the same:
https://www.amazon.com/ACEIRMC-ESP-WROOM-32-Bluetooth-Development-Compatible/dp/B08PNWB81Z/ref=asc_df_B08PNWB81Z/?tag=hyprod-20&linkCode=df0&hvadid=583518774644&hvpos=&hvnetw=g&hvrand=11337070921199480211&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9031905&hvtargid=pla-1457194314840&th=1

Yup, same ones! The amazon seller likely ordered in bulk on AliExpress and are reselling at a few bucks profit.

OK I will try and get this topic back onto the actual fan switch.

You have a fan switch that can control speed and doesn’t require a NEUTRAL!!! Seriously isn’t this a first?

I wish it was ZWAVE but I just ordered one!!!

Hi Eric!

Is it possible to, either through a hub automation or the switch directly, use the config button to control the load?

The scenario I’m envisioning would be to use the main paddle to control smartbulbs in the fan light fixture via Zigbee binding, and use the config button to toggle through fan speeds. We only have one switch for the whole fixture, with pull chains to control lights/fan speeds. The rest of our 2-1 switches use the main paddle to control lights, so it would be great for consistency. Can this be done with the fan switch?

1 Like

The config button will send scene commands, so you can use config button presses (single, held, 2x, 3x, etc) in an automation to set your fan speed.

To cycle through the speeds, you’d need some IFs based on the current speed. i.e. IF fan speed is low THEN set fan sped to medium, IF fan speed is medium then set fan speed to high, etc.

Although TBH, it makes more sense to control the fan speed via the paddle and then control the lights via multi-taps of the paddle or the config button. The config button has a lower profile than on previous switches, so although it can be pressed, you’ll probably find you prefer paddle presses for sending scenes.

1 Like

Thanks for the advice!

1 Like

Im not sure how you plan to keep bulbs powered on unless you have a 3 wire between the fan and the switch.

2 Likes

Any update on these?

3 Likes