Anyone can help me out with the FAN template to control my type-D ventilation? I have a smart plug to turn then vent on and of, and a “shelly 2PM” to set the fan to MID and HI.
Off : smart plug turned OFF
low : smart plug ON, S1 & S2 shelly OFF.
mid: smart plug ON, S1 ON& S2 shelly OFF.
hi: smart plug ON, S1 & S2 shelly ON.
So I created a template with :
And this works :
BUT, when I check the entity and I want it to set to Low, Mid, High inside the GUI, the actual value is still ‘Off’ :
When I can change this value, I’m able to set the shelly with Node-Red, So at this moment I just need the above control, but the output needs to match the button I check.
You have no entry for set_preset_mode or preset_mode_template keys to tell the fan entity what the current state is or what to do to change it.
I would probably create a script to call to set presets as you will need to control both plug and shelly to get the right combination. Your preset_mode_template key can the be a template the evaluates the preset based on states of plug and shelly.
So I can set the position from HA.
For it to be 100% correct, I read out the power from the ventilation, and according to that, I show the speed of the ventilator., so I can compare it with the switch.
Created a Node-Red flow to set the ventilator speed according to the humidity in some rooms.
switch.niko_ventilatie > smart plug to turn on and of complete ventilation.
switch.shelly_ventilatie > simulates 3 way switch
switch.shelly_ventilatie_switch_0 & switch.shelly_ventilatie_switch_1 = OFF > preset 1
switch.shelly_ventilatie_switch_0 = ON > preset 2
switch.shelly_ventilatie_switch_1 = ON > preset 3
Unfortunately this does not work. All examples i can find seem to use an external script to set the preset mode but i would like to contain all logic in the configuration fan template.
Ideally the fan reports its speed back. Currently i use a seperate sensor for that: