I don’t know if it will work with your fan, but I use the following with my 8 speed Honeywell tower-style fan.
Send Command Script
alias: Living Room Fan - Send Command
fields:
command:
name: Command
description: The command you want to send to the fan
example: "on"
required: true
selector:
select:
options:
- label: "Off"
value: "off"
- label: "On"
value: "on"
- label: Increase Speed
value: speedUp
- label: Decrease Speed
value: speedDown
- label: Oscillate
value: oscillate
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ repeats > 0 }}"
sequence:
- alias: Send IR Command 'count' times
repeat:
count: "{{ repeats }}"
sequence:
- delay: 1
- service: esphome.ble_router_1_send_raw_command
data:
command: "{{ code }}"
- delay: 4
default:
- service: esphome.ble_router_1_send_raw_command
data:
command: "{{ code }}"
mode: single
variables:
repeats: |
{{ iif(command == "speedDown", 7, 0) }}
commands:
power: >-
[433, -1254, 1278, -407, 439, -1252, 433, -8112, 1277, -408, 1279, -409,
435, -1255, 1276, -409, 1279, -408, 436, -1255, 432, -1255, 433, -1256,
433, -1254, 1277, -409, 435, -1255, 433, -8111, 1277, -408, 1279, -409,
435, -1255, 1277, -409, 433, -1254, 1278, -407, 439, -1252, 433, -8112,
1277, -408, 1279, -409, 435, -1255, 1276, -409, 1279, -408, 436, -1255,
432, -1255, 433, -1256, 433, -1254, 1277, -409, 435, -1255, 433, -8111,
1277, -408, 1279, -409, 435, -1255, 1277, -409]
speed: >-
[435, -8111, 1278, -407, 1280, -412, 433, -1253, 1277, -410, 1279,
-407,1280, -408, 436, -1256, 432, -1253, 435, -1256, 1276, -408,
1280,-408, 435, -8118, 1273, -408, 1279, -409, 436, -1255, 1279, -406,
1280,-408, 1280, -407, 436, -1256, 435, -8111, 1278, -407, 1280, -412,
433, -1253, 1277, -410, 1279, -407,1280, -408, 436, -1256, 432, -1253,
435, -1256, 1276, -408, 1280,-408, 435, -8118, 1273, -408, 1279, -409,
436, -1255, 1279, -406, 1280,-408, 1280, -407, 436, -1256]
oscillate: >-
[1280, -409, 1278, -408, 436, -1253, 436, -1252, 434, -1255, 433, -1254,
1276, -409, 1278, -7268, 1275, -409, 1279, -408, 436, -1271, 1259, -409,
1280, -407, 1280, -410, 433, -1255, 434, -1253, 434, -1254, 434, -1254,
1279, -405, 1280, -7265, 1280, -409, 1278, -408, 436, -1253, 436, -1252,
434, -1255, 433, -1254, 1276, -409, 1278, -7268, 1275, -409, 1279, -408,
436, -1271, 1259, -409, 1280, -407, 1280, -410, 433, -1255, 434, -1253,
434, -1254, 434, -1254, 1279, -405, 1280, -7265]
code: >
{% if command in ["speedDown","speedUp"]%} {% set command = "speed" %} {%
elif command in ["on","off"]%} {% set command = "power" %} {% endif %} {{
commands.get(command) }}