Logo
Deta Fan Speed Controller with Light Switch
AU
Model reference: 6914HA
Deta Fan Speed Controller with Light

Available from:
Bunnings.com.au
Bunnings.co.nz





Flashed with:
Serial port

GPIO #Component
GPIO00 Button2
GPIO01 None
GPIO02 None
GPIO03 LedLink
GPIO04 Relay3
GPIO05 Button3
GPIO09 None
GPIO10 None
GPIO12 None
GPIO13 Relay2
GPIO14 Relay1
GPIO15 Relay4
GPIO16 Button1
FLAG None

Template

{"NAME":"Deta Fan Speed and Light Controller","GPIO":[18,0,0,157,23,19,0,0,0,22,21,24,17],"FLAG":0,"BASE":18}

Decouple Buttons from Relays

SetOption73 1

Single rule to handle fan speed logic

rule1
ON SYSTEM#Init DO VAR1 3 ENDON
ON BUTTON1#State=10 DO POWER1 Toggle ENDON
ON BUTTON2#State=10 DO POWER2 Toggle ENDON
ON POWER2#State=1 DO POWER3 ON ENDON
ON POWER2#State=1 DO POWER4 ON ENDON
ON POWER2#State=1 DO VAR1 2 ENDON
ON POWER2#State=0 DO POWER3 OFF ENDON
ON POWER2#State=0 DO POWER4 OFF ENDON
ON POWER2#State=0 DO VAR1 3 ENDON
ON BUTTON3#State=10 DO Event SetSpeed=%VAR1% ENDON
ON EVENT#SetSpeed=1 DO POWER3 OFF ENDON
ON EVENT#SetSpeed=1 DO POWER4 OFF ENDON
ON EVENT#SetSpeed=1 DO POWER2 ON ENDON
ON EVENT#SetSpeed=1 DO VAR1 3 ENDON
ON EVENT#SetSpeed=2 DO POWER3 OFF ENDON
ON EVENT#SetSpeed=2 DO POWER4 ON ENDON
ON EVENT#SetSpeed=2 DO POWER2 ON ENDON
ON EVENT#SetSpeed=2 DO VAR1 1 ENDON
ON EVENT#SetSpeed=3 DO POWER3 ON ENDON
ON EVENT#SetSpeed=3 DO POWER4 ON ENDON
ON EVENT#SetSpeed=3 DO POWER2 ON ENDON
ON EVENT#SetSpeed=3 DO VAR1 2 ENDON

Enable rule with Rule1 1

Description: SetOption73 Decouples the buttons and relay The VAR1 can be thought of as “NextSpeed”, if it makes it easier to read the code

Notes:

  • Relay 1 is the main light relay controlled by button1 (the light button)
  • Relay 2 is the main fan relay controlled by the button2 (the fan button)
  • Relay 3 is the secondary fan relay controlled by the bottom3 (the array buttons)
  • Relay 4 is the tertiary fan relay not physically connected to any buttons

Rule Logic

  • Relay 3 and4 will always turn on with Relay 2
  • VAR1 is set to 3 at Initialisation and when the fan is powered off to ensure full power to fan to startup
  • Button 3 will always decrease speed one at a time 3 -> 2 -> 1 -> 3