# ELRO AB440R remote control.

# Remote switch to turn on or off power sockets.
# The remote control has 8 buttons to control 4 sockets (on and off button)
# and 5 dip switches to dial in a unique local channel (0-31)
#
# User manual: https://www.libble.eu/elro-ab440-series/online-manual-313854/
#
# Payload format:
#
#     1C1C1C1C1C 1B1B1B1B 10 1S1S 10000000
#
#     CCCCC: 5 bit channel number (reversed)
#     BBBB:  1000 = button A
#            0100 = button B
#            0010 = button C
#            0001 = button D
#     SS:    10 = ON
#            01 = OFF
#
# Test:
#     rtl_433 -c conf/elro_ab440r.conf -y '{25}bbabae8'
#

decoder {
    name=ELRO-AB440R,
    modulation=OOK_PWM,
    short=330,
    long=970,
    gap=1200,
    reset=9000,
    bits=25,
    symbol_zero={2}8,
    symbol_one={2}c,
    get=@0:{5}:channel,
    get=@5:{4}:button:[8:A 4:B 2:C 1:D],
    get=@10:{2}:toggle:[2:ON 1:OFF],
    unique
}
