Thanks Stef for making that JSON available. There’s a lot of information in that.
I don’t think that Stef’s JSON should be responsible to know the whole structure of every command and their databytes. If you need that, I would wait for our own revision of the protocol manuals and parse that.
Here’s an example of what we have in mind (at this moment):
{
"id": "02-2",
"name": "'Switch relay on' command received",
"modules": [
"VMB4RYLD",
"VMB4RYNO"
],
"type": "Request",
"priority": {
"name": "Highest priority",
"value": 0
},
"addressRequired": "Module address",
"rtr": false,
"databytes": [
{
"description": "Command Type",
"displayAs": "hex",
"options": [
{
"description": "COMMAND_SWITCH_RELAY_ON",
"pattern": "02"
}
]
},
{
"description": "Relay bit number",
"displayAs": "bin",
"options": [
{
"description": "Channel 1",
"pattern": "00000001"
},
{
"description": "Channel 2",
"pattern": "00000010"
},
{
"description": "Channel 3",
"pattern": "00000100"
},
{
"description": "Channel 4",
"pattern": "00001000"
},
{
"description": "Virtual channel 5",
"pattern": "00010000"
}
]
}
]
}
{
"id": "FB-3",
"name": "Transmits the relay status",
"remarks": [
"[DATABYTE6][DATABYTE7][DATABYTE8] contain a 24-bit time in seconds"
],
"modules": [
"VMB4RYLD",
"VMB4RYNO"
],
"type": "Response",
"priority": {
"name": "Lowest priority",
"value": 11
},
"addressRequired": "Module address",
"rtr": false,
"databytes": [
{
"description": "Command Type",
"displayAs": "hex",
"options": [
{
"description": "COMMAND_RELAY_STATUS",
"pattern": "FB"
}
]
},
{
"description": "Relay bit number",
"displayAs": "bin",
"options": [
{
"description": "Channel 1",
"pattern": "00000001"
},
{
"description": "Channel 2",
"pattern": "00000010"
},
{
"description": "Channel 3",
"pattern": "00000100"
},
{
"description": "Channel 4",
"pattern": "00001000"
},
{
"description": "Virtual Channel 5",
"pattern": "00010000"
}
]
},
{
"description": "Disable/inhibit/Forced on setting",
"displayAs": "bin",
"options": [
{
"description": "Channel normal",
"pattern": "xxxxxx00"
},
{
"description": "Channel inhibited",
"pattern": "xxxxxx01"
},
{
"description": "Channel forced on",
"pattern": "xxxxxx10"
},
{
"description": "Channel disabled",
"pattern": "xxxxxx11"
}
]
},
{
"description": "Relay status",
"displayAs": "bin",
"options": [
{
"description": "Relay channel off",
"pattern": "xxxxxx00"
},
{
"description": "Relay channel on",
"pattern": "xxxxxx01"
},
{
"description": "Relay channel interval timer on",
"pattern": "xxxxxx11"
}
]
},
{
"description": "Led status",
"displayAs": "bin",
"options": [
{
"description": "LED off",
"pattern": "00000000"
},
{
"description": "LED on",
"pattern": "10000000"
},
{
"description": "LED slow blinking",
"pattern": "01000000"
},
{
"description": "LED fast blinking",
"pattern": "00100000"
},
{
"description": "LED very fast blinking",
"pattern": "00010000"
}
]
},
{
"description": "high byte of current delay time",
"displayAs": "none"
},
{
"description": "mid byte of current delay time",
"displayAs": "none"
},
{
"description": "low byte of current delay time",
"displayAs": "none"
}
]
}
We have plans to generate a HTML based on this, eventually replacing the PDFs. Please note that the above structure is not final and subject to change.
In this example, you can find the needed packets for VMB4RYLD and VMB4RYNO allowing to turn the relay on. ( That’s a simple example, I know )
For example, to turn relay 1 on:
- Send out one packet with command type: 0x02 (Turn relay on) 0x01 (Relay 1).
- Wait for one packet with command type: 0xFB (Relay status) and check the second databyte to be 1 and check if the first 2 bits of the third databyte to be 01.
I can find what is needed to turn on a relay in Stef’s JSON.
I think we should not define channel types to a channel, since you have a lot of channel types and chances are big that it will be extended with new channel types quite soon.
To give an example, some of our (newer) relay modules support inhibited, forced on, forced off and normal state. If we extend the JSON to support that, I assume you need to make a new channel type.
I think a list of possible “features” (switch relay on, force relay on, inhibit, switch to program 1, switch programs off, …) should be defined per module. An integration, supporting a relay, can look in the feature list if the required features are available and make the mapping.
Food for thought.