Skip to main content

The COSMO protocol

COSMO and COSMO | 2WAY are simple RF protocols working on the 868 Mhz band using FSK (frequency-shift keying) modulation. For security they use a simple rolling-code scheme and Keeloq symmetric encryption. On actual devices manufactured by Mobilus they are implemented using chips from the Silabs EZRadio line.

The exact implementation is available in cosmo.c

RF details

COSMOCOSMO | 2WAY
Frequency868.0 MHz868.2 MHz
ModulationFSK (50 kHz deviation)FSK (50 kHz deviation)
PreambleRepeated 1010 patternRepeated 1010 pattern
Sync word2DD42DD4
Data rate2.4 kBaud2.4 kBaud
Packet length8 bytes9 bytes

Packet structure

Cosmo

Cosmo | 2WAY

Serial

Serial is a 21-bit value uniquely identifying the remote controller.

Encrypted word plaintext

Before encryption the 32-bit plaintext word is laid out as follows (the same for both variants, except byte 0 which differs for 2-way):

BitsFieldValue
31:24Verification byte 0(serial[7:5] | cmd) << 2 + popcount(extra_payload) (2-way only)
23:16Verification byte 1((serial[7:5] | cmd) >> 6) | (serial[15:8] << 2)
15:0Rolling counter16-bit counter, incremented on every transmission

Command codes

The cmd field is 5 bits wide (values 0–31). Commands are sent from a controller to a blind; feedback codes are sent in the opposite direction. Please note that despite the name, some feedback is also sent by blinds using the older COSMO protocol (although less advanced).

CodeConstantDirectionDescription
0COSMO_BTN_REQUEST_POSITIONCommandIf sent to a blind, it responds with the appropriate feedback command.
1COSMO_BTN_STOPCommandStop movement
2COSMO_BTN_UPCommandMove up
3COSMO_BTN_UP_DOWNCommandReverses motor direction if held.
4COSMO_BTN_DOWNCommandMove down
5COSMO_BTN_STOP_DOWNCommandRevers
6COSMO_BTN_STOP_HOLDCommandPrograms comfort position.
7COSMO_BTN_PROGCommandPair as MASTER remote after factory reset, or enter/exit programming mode (if already paired).
8COSMO_BTN_STOP_UPCommandPairs/unpairs secondary (non-master) remote.
9COSMO_BTN_FEEDBACK_OBSTRUCTIONFeedbackSent if the motor is overloaded.
10COSMO_BTN_FEEDBACK_BOTTOMFeedbackSent if blinds are completely closed.
11COSMO_BTN_FEEDBACK_TOPFeedbackSent if blinds are completely open.
12COSMO_BTN_FEEDBACK_COMFORTFeedbackSent if blinds are at the comfort position.
13COSMO_BTN_FEEDBACK_PARTIALFeedbackSent if blinds are partially open/closed. Extra payload defines the percentage of open/closed.
14COSMO_BTN_FEEDBACK_IN_MOTIONFeedbackSent if blinds are in motion.
16COSMO_BTN_REQUEST_FEEDBACKCommandRequest COSMO_BTN_DETAILED_FEEDBACK from the blinds. Extra payload defines what to ask for.
17COSMO_BTN_TILT_INCREASECommandIncrease tilt angle.
18COSMO_BTN_TILT_DECREASECommandDecrease tilt angle.
19COSMO_BTN_SET_POSITIONCommandSet blinds to a specific position. Extra payload defines the target position.
21COSMO_BTN_DETAILED_FEEDBACKFeedback
23COSMO_BTN_SET_TILTCommandSet tilt angle to a specific value. Extra payload defines the target tilt angle.

COSMO_BTN_REQUEST_FEEDBACK

The extra payload defines what feedback to request. Here are the known values:

ValueDescription
0Request device type 1.
1Request device type 2.
3Read tilt

Device type 1 known values:

  • 1 - blinds with no tilt
  • 0x5 - C-SW
  • 9 - has tilt

Device type 2 known values:

  • 0x12 - C-MR BT
  • 0x0F - C-SW