I want to set up a fan template, which I can control with the following 3 command:
Power (toggle between on and off - named: Fan_Power)
Increase Speed (Named: Fan_Plus)
Decrease speed (Named: Fan_Minus)
In total I have 6 speed levels.
For each command I have a script, emulating the remote and thus send the command to the fan.
Turning the fan to 80% would therefore require runinning Power script (to turn the fan on) and run the script Increase speed four times (to reach 83%).
What part of this isn’t doing what you want? Where are you actually controlling a device? Right now it’s all virtual since it’s toggling helpers, I don’t see where it’s sending commands to an IR device or changing a switch power.
Absolutely correct. I should have made the question clearer: Where and how do I integrate these 3 Scripts? Add 3 automations?
Automation: Run script Fan_Power if the boolean Fan Power changes
For the speed automations (2 and 3) I am a bit lost, as I have no idea how to manage running the script for several times, if the speed percentage changes.
Maybe you need to take a step back first. Will the fan be operated by anything else than HA? If so, letting HA assume it knows if the fan is on or off or at what speed is probably not going to help.
If you are going to control the fan outside HA, the fan template may not be that useful because as far as I can tell from the docs it is not designed to work well if you do not know the actual state. E.g. will you be able to change speeds if HA thinks it is off, will you be able to turn it off if HA already assumes it is off? Especially since you only know how to toggle, you might be doing the opposite from what you intend. Will setting 50% actually result in 50% if the fan was running at a different speed from what HA assumed?
In that case, scripts and simple buttons to trigger the commands may suit you much better. Then HA should just emulate the remote.
And on a sidenote: I prey that manufacturers stop building remote power control based on toggle alone and have a separate on and off button always.
Agree, there is indeed the option to control the fan externally via remote, but I capture these commands quite reliably.
So what I do with the light is, if I receive commands from the remote, I deactivate automations, change state of the light in Home Assistant and reactivate the script. This works good, so this would be second step, if the home assistant fan control runs.
Further: If the Home Assistant control works relible, I may bring my wife to not use the remote to much, instead rely on the automations and or voice control