This is probably a rookie error as this is my first “hack” but after multiple hours of trying to figure it out, I’m in need of assistance. We purchased a really nice ceiling fan that unfortunately operates on 303.9 MHz frequency so the Sonoff Bridge I purchased won’t communicate with it. I used a D1 Mini and hijacked the feed from a spare remote through irrecv and now I’m want to use mqtt.publish through Home Assistant to control the fan. Special thanks to MQTT control of DC fan/light for getting me this far.
#DC Fan Control
input_select:
fan_office:
name: Office fan
icon: mdi:fan
options:
- 'Off'
- One
- Two
- Three
- Four
- Five
- Six
#Automations for Home Assitant
automation:
#DC Fan Controls
- alias: 'Office Fan Set'
trigger:
- platform: state
entity_id: input_select.fan_office
action:
- service: mqtt.publish
data_template:
topic: >-
{% set topics = {'Off':0,326,328,656,328,656,328,656,328,656,328,656,328,656,658,328,656,328,658,328,658,328,328,656,658,328,11510,326,328,656,328,656,328,656,328,656,328,656,328,656,658,328,656,328,658,328,658,328,328,656,658,328,11510,326,328,656,328,656,328,656,328,656,328,656,328,656,658,328,656,328,658,328,658,328,328,656,658,328,11510,326,328,656,328,656,328,656,328,656,328,656,328,656,658,328,656,328,658,328,658,328,328,656,658,328,11510, 'One':0,328,326,656,328,656,326,656,328,656,326,656,328,656,654,328,654,328,656,328,654,328,656,326,656,328,11472,328,326,656,328,656,326,656,328,656,326,656,328,656,654,328,654,328,656,328,654,328,656,326,656,328,11472,328,326,656,328,656,326,656,328,656,326,656,328,656,654,328,654,328,656,328,654,328,656,326,656,328,11472,328,326,656,328,656,326,656,328,656,326,656,328,656,654,328,654,328,656,328,654,328,656,326,656,328,11472, 'Two':0,328,328,656,328,656,328,656,328,656,328,656,328,656,656,328,656,328,328,654,658,328,328,656,656,328,11476,328,328,656,328,656,328,656,328,656,328,656,328,656,656,328,656,328,328,654,658,328,328,656,656,328,11476,328,328,656,328,656,328,656,328,656,328,656,328,656,656,328,656,328,328,654,658,328,328,656,656,328,11476,328,328,656,328,656,328,656,328,656,328,656,328,656,656,328,656,328,328,654,658,328,328,656,656,328,11476, 'Three':0,326,328,654,328,656,328,656,328,656,328,656,328,654,658,328,328,656,656,328,656,328,658,328,656,328,11502,326,328,654,328,656,328,656,328,656,328,656,328,654,658,328,328,656,656,328,656,328,658,328,656,328,11502,326,328,654,328,656,328,656,328,656,328,656,328,654,658,328,328,656,656,328,656,328,658,328,656,328,11502,326,328,654,328,656,328,656,328,656,328,656,328,654,658,328,328,656,656,328,656,328,658,328,656,328,11502, 'Four':0,328,328,656,328,656,328,656,328,656,328,656,328,656,658,328,328,656,328,656,658,328,658,328,658,328,11522,328,328,656,328,656,328,656,328,656,328,656,328,656,658,328,328,656,328,656,658,328,658,328,658,328,11522,328,328,656,328,656,328,656,328,656,328,656,328,656,658,328,328,656,328,656,658,328,658,328,658,328,11522,328,328,656,328,656,328,656,328,656,328,656,328,656,658,328,328,656,328,656,658,328,658,328,658,328,11522, 'Five':0,326,328,656,328,656,328,656,328,656,328,656,328,656,328,656,656,328,656,328,656,328,328,656,656,328,11506,326,328,656,328,656,328,656,328,656,328,656,328,656,328,656,656,328,656,328,656,328,328,656,656,328,11506,326,328,656,328,656,328,656,328,656,328,656,328,656,328,656,656,328,656,328,656,328,328,656,656,328,11506,326,328,656,328,656,328,656,328,656,328,656,328,656,328,656,656,328,656,328,656,328,328,656,656,328,11506 'Six':0,328,328,654,328,656,328,656,328,656,328,656,328,656,328,656,658,328,656,328,658,328,656,328,658,328,11510,328,328,654,328,656,328,656,328,656,328,656,328,656,328,656,658,328,656,328,658,328,656,328,658,328,11510,328,328,654,328,656,328,656,328,656,328,656,328,656,328,656,658,328,656,328,658,328,656,328,658,328,11510,328,328,654,328,656,328,656,328,656,328,656,328,656,328,656,658,328,656,328,658,328,656,328,658,328,11510} %}
cmnd/Office_Fan/irsend{{ topics[trigger.to_state.state] if trigger.to_state.state in topics.keys() else 'unknown' }}
payload: ""
1 post - 1 participant
Read full topic