Hi all, trying to get to know the fan template and use it to control 6-speed DC ceiling fans via RF with a Broadlink RM4 Pro. Using the learn command has been successful and I can get HA to send commands to the fan.
I have a helper toggle (for on/off) and slider (speeds) setup. The first issue I had was that after turning it on the switch would go back to the off state, hence the set value command, however I get the following error when it is switched - “Living Room Fan: Error executing script. Invalid data for call_service at pos 2: expected float for dictionary value @ data[‘value’]” - but if I check the state of the helper it is in the format on or off. So leaves me confused.
Next issue after that is that I’m not entirely sure how to implement the speed control for six speeds of a DC fan using the learned commands. Any pointers or examples would be great to help me.
- platform: template
fans:
living_room_fan:
friendly_name: "Living Room Fan"
unique_id: living_room_fan
value_template: "{{ states('input_boolean.fan_living_room_state') }}"
turn_on:
- service: remote.send_command
data:
device: remote.fan_livingroom
command: "wind speed 1"
delay_secs: 0.5
target:
entity_id: remote.rf_remote_remote
- service: input_number.set_value
target:
entity_id: input_boolean.fan_living_room_state
data:
value: "on"
turn_off:
- service: remote.send_command
data:
device: remote.fan_livingroom
command: "turn off"
delay_secs: 0.5
target:
entity_id: remote.rf_remote_remote
- service: input_number.set_value
target:
entity_id: input_boolean.fan_living_room_state
data:
value: "off"