I am trying to configure a fan that calls presets using API calls.
I’ve tried several templates, but i just can’t wrap my head around it.
What I have got so far:
fan:
- platform: template
fans:
afzuiging:
friendly_name: "Afzuiging"
unique_id: "afzuiging"
turn_on:
service: rest_command.afzuiging_high
turn_off:
service: rest_command.afzuiging_auto
These rest command are the api call, for example:
rest_command:
afzuiging_high:
url: "http://nrg-itho-fc00.local/api.html?rfcommand=high"
I have several presets on my fan. Low, Medium, High and Auto.
I have an mqtt topic where the percentage of the current speed is shown.
state_topic: "itho/ithostatus" with this for the speed: value_json['Absolute speed of the fan (%)']
I can also get the current percentage with an API call, if that makes any difference. That would be located at http://nrg-itho-fc00.local/api.html?get=ithostatus. Which response is a json.
Is there somebody that can help me with setting up this fan and presets based on percentages from that mqtt topic? If you need more info, let me know!
Thanks in advance!