Skip to content

Instantly share code, notes, and snippets.

@nitej
Created September 11, 2017 21:28
Show Gist options
  • Save nitej/0b4853112043b51f6de7eab139a53e16 to your computer and use it in GitHub Desktop.
Save nitej/0b4853112043b51f6de7eab139a53e16 to your computer and use it in GitHub Desktop.
Seville IR Encoding
The IR encoding for the Seville fans follows the structure of the NEC style with some differences. The preamble, 0/1 bits, and the ending pulse are the same. However, it uses 64-bit long codes and about half of the bits are fixed. The typical command looks like this:
pre 0001 0000 0010 0000 0011 0000 0100 0000 0101 0000 0000 0000 0110 0000 0111 0000 post
where this command sets the fan to off with low speed, no oscillation, 0 hrs on the timer, and normal wind. Grouping as nibbles, this command becomes
0x1020304050006070
where this integer is send MSB first. By capturing all possible signals, it can be seen that the general command is:
0x1a2b3c4d5e000607p
where:
a: fan on(1)/off(0) state
b: number of hours on timer times 2 (i.e. 0.5 hrs is 1, 1 hr is 2)
c: osc on(1)/off(0) state
d: speed - low(0), med(1), high(2), eco(3)
e: wind - normal(0), windy(1), sleep(2)
p: parity nibble
while previous authors have similar relationships for the first half of the command (a-d), most ir decoders ignore the last 32 bits and miss the e and p parts of the code.
The parity nibble is calculated by xor with all other nibbles from the command (as it turns out, the parity of the non changing nibbles is always 0, so it is only necessary to do the xor on a-e. Commands with these conventions are accepted by the fan.
@robbiet480
Copy link

For anyone that finds this in the future looking for a built solution to controlling Seville Fans, I've implemented the protocol in my project, Seville-MQTT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment