Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for fan with speeds using Shelly 2.5 #337

Open
MichaelVdheeren opened this issue Dec 13, 2020 · 28 comments
Open

Add support for fan with speeds using Shelly 2.5 #337

MichaelVdheeren opened this issue Dec 13, 2020 · 28 comments
Labels
enhancement New feature or request

Comments

@MichaelVdheeren
Copy link

MichaelVdheeren commented Dec 13, 2020

Can we get a firmware version that allows the Shelly 2.5 to be used as a fan within Homekit with each of the inputs being mapped to a fan speed? No input would mean fan is low, input 1 means fan is medium, input 2 means fan is high. Mapped to the same output of course.

@freddair
Copy link

My bath fan has 2 speeds which correspond to 2 fan inputs / Shelly outputs:

So for me Shelly 2.5 would need to interlock output 1 and 2.

off: both outputs off
low: output 1 on, output 2 off
high: Output 1 off, output 2 on

When both outputs are on, the fan runs very low, but I am not sure if it's safe to use as that's not specified in the manual.

@andyblac
Copy link
Collaborator

why not just set homekit type to fan in homekit settings ?

@freddair
Copy link

That's what I currently do using an Aqara double rocker switch. The problem is that it just appears as 2 separate Fan switches and not as fan speed steps, and it does not allow real interlocking of the outputs. I simulate it with scenes but it's not optimal as relays don't switch simultaneously (one after another).
image

@MichaelVdheeren
Copy link
Author

MichaelVdheeren commented Dec 14, 2020

Correct, just changing from switch to a fan is an icon. This means I get two elements in the Home App and not a single fan with two speeds that I can set. What we would need is what you see below.

image

@rojer
Copy link
Contributor

rojer commented Dec 14, 2020

HAP fan service has speed control as a %, from 0 to 100, but i guess we could have 0-30-60-100 fixed points, something like that.
i am not familiar with fans (i live in ireland, you see, we don't need them here :) ), can you explain what kind of fan are you using? what are the connections?
how common is this type of fan?

@freddair
Copy link

Here's mine, built into the bathroom ceiling to exhaust steamy and/or stinky air ;-)

https://www.vortice.ltd.uk/shop/residential-ventilation/quadro/quadro-micro-100-i-es/

image

@MichaelVdheeren
Copy link
Author

MichaelVdheeren commented Dec 14, 2020

I have exactly the same as above. Very common system in Belgium used for ventilation of the home which is mandatory for newly built homes.

I would suggest using 0 - 50 -100 because you can not turn of most of these ventilators - by default they are always in stand 1. You can change them to mode 2 or mode 3.

@jsiegenthaler
Copy link
Contributor

High speed is obviously 100%
Low speed could be user-configurable, or locked at 50%
The core question would be: how would homekit react to the speed control slider: would it "lock" to 50% when between 25% and 75%, and lock to 0% or 100% when outside of the 25-75% range?
Also, anyone wiring this up must be sure not to wire Live to both terminals at the same time. Some fans are simple and use a series resistor to slow down the speed, then it wouldn't matter. But some fans might have different coils or taps on the coils to change the motor speed. Then it may very much matter how it is switched.

@andyblac
Copy link
Collaborator

andyblac commented Dec 14, 2020

my bathroom fan is a constant presure fan with boost. ie it is contantly on, and when you flip the switch it goes into boost mode. it also has it own onboard moisture sensor that spin up the fan as needed depending on humidity.

https://www.greenwood.co.uk/product/153/unity-cv2gip

@freddair
Copy link

Yeah in Germany it's also mandatory in any bathroom or kitchen at least if it has no window.

@rojer
Copy link
Contributor

rojer commented Dec 14, 2020

The core question would be: how would homekit react to the speed control slider: would it "lock" to 50% when between 25% and 75%, and lock to 0% or 100% when outside of the 25-75% range?

1 to 50 would round up to 50, 51 to 100 round up to 100..
the way it works with homekit is, home controller (aka home app) tell you to set it to something like 41, you go - wure enough, ok, then report "set to 50", and it'll update the display. at least that's the way it works with roller shutter positioning.
it tells you "set foo X", you nod, then say "foo is now Y", and it's fine :)

Also, anyone wiring this up must be sure not to wire Live to both terminals at the same time.

sure, that can be arranged.

should also support simple on/off for singe output deices (i.e.0 and 1-100 rounding up to 100), shelly 2 and to have additional position at 50.

@MichaelVdheeren
Copy link
Author

Maybe this can help: https://github.com/adri/homebridge-itho-cve-eco-rft

@jsiegenthaler
Copy link
Contributor

jsiegenthaler commented Dec 14, 2020 via email

@timoschilling
Copy link
Collaborator

The HAP has a step value setting for that.
So we can say it has step value of 50. Which mean the HomeApp only allows 0%, 50% and 100%, then there is no need to round the value.

Here is an Golang example for that https://github.com/brutella/hc/blob/master/characteristic/rotation_speed.go#L16

@rojer
Copy link
Contributor

rojer commented Dec 15, 2020

step value has to be exactly as specified in the standard, i.e. 1, or controller won't even add the device.

@timoschilling
Copy link
Collaborator

If have tested it with the Simulator and it works.
image
image

@rojer
Copy link
Contributor

rojer commented Dec 15, 2020

i'm pretty sure i've had accessories rejected for incorrect step value before.
but ok, this is worth trying when implementing.
thanks!

@timoschilling
Copy link
Collaborator

Here is how it looks in the HomeApp
Image
Each time the slider jumps up or down, I released the finger at 25% or 75%.

@MichaelVdheeren
Copy link
Author

MichaelVdheeren commented Jan 1, 2021

I managed to create this in homebridge-shelly. Maybe it can help you how the logic works.

MichaelVdheeren/homebridge-shelly#1

step value can be anything. The maxValue should always be 100. If you would instead use 2 and stepvalue of 1 then it would work in the Home App but Siri would return 2% every time you try to set it to 100%. So there is some inconsistency of what Siri returns compared to what the Home App shows. Fixed this by using maxValue of 100 and stepValue of 50.

@freddair
Copy link

freddair commented Apr 3, 2021

Any news on this?

@zsolt-dev
Copy link

I would too love to skip homebridge and have this functionality directly.

My use case is a ventilation system that is controlled with 3 wires:
1 hot wire - low speed
2 hot wires - medium speed
3 hot wires - hi speed

Ventilation should never be turned off, so the first wire will be hardwired and rest of the two would get connected to shelly 2.5.

It is a bummer that I do not speak C++, so I cannot add this myself.

@macintosh-HD
Copy link

Any news on this topic? I live in Germany and also have a fan with two speed settings in my bathroom. I would love to have native support for this!

@rojer
Copy link
Contributor

rojer commented Aug 30, 2022

nothing so far

@woodsbox
Copy link

This would be great to have!

@thirsty-fatman
Copy link

thirsty-fatman commented Oct 10, 2022

I have a similar question about this post but fan setup is slightly different.

I been apprehensive about adoption of AC ceiling fans into HomeKit as our fan is controlled by Shelly 2.5 and two capacitors on two outputs. Details below:

CBB61 1.5uF+2.5uF 3 Wires AC 250V 50/60Hz Capacitor For Ceiling Fan. This fan has 3 wires. One is for 1.5uF (low), one is for 2.5uF (med) and the third wire is load, and goes to the fan. In this case, high would be 4uF (1.5uF + 2.5uF)

Relay 0 controls the 1.5uF output and Relay 1 controls the 2.5uF output.

State Relay0 Relay1
Off Off Off
Low On Off
Med Off On
Hi On On

Right now, the two relays appear for the fan. Relay 1 is called fan low and relay 2 is called fan medium. There is no high relay or switch but when both low and medium relays are on, then fan is running on high speed.

Is there a way that I can have one control appear in HomeKit for both relays called fan with the settings above for low, medium and high in slider? I can estimate percentages for the slider as above, like 0%, 30%, 70% and 100%.

Many thanks in advance for your insight.

Moderators please advise if posted incorrectly (eg. start a new post or cannot be done.)

@thirsty-fatman
Copy link

Is my post relevant in this section or should I move my comment to a new/different thread?

@PhaseAngle
Copy link

PhaseAngle commented Dec 20, 2022

For rotary capacitor fan controllers the high speed applies power direct to the fan not put the capacitors in series.
You need 3 relay outputs.
P0v98
or is your fan controlled by a different method?

@thirsty-fatman
Copy link

Two of the wires are input and one of the wires is output.

Electricity comes from common into the switch.

Two wires go to the capacitor with the two capacitance values. They are both switched hence the two lines in each of the circuits.

The four way rotary knob (switch) controls whether no capacitance (off,) lower rated capacitance (low,) higher rated capacitance (medium) or both capacitances (high) flow into the load (output) and then onto the fan. The fan will then spin the blades at correct speed.

I am not an electrician but based on my limited knowledge in electronics that's how I understand it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests