KNX
Available as preview since 1.4.0-beta1
. The API is subject to change.
Available only for Gen3 and Gen2 Pro* devices.
Overview
KNX
integration enables Shelly devices to become part of KNX
installations and expose selected Shelly functionality to KNX automations. KNX enabled Shelly devices allow selected Shelly components to be controlled from the KNX installation and also provide information or control it. In the first release supported are Input
, Light
and Switch
components. Configuration of these components is extended to include KNX specific settings which enable certain KNX functionality and there is a global KNX
component responsible for common configuration and functionality.
KNXIP/Routing is used to connect to KNX installations and existence of KNXIP router connected to the network of a Shelly device network interface is assumed. The router is automatically discovered if present and is required for Shelly KNX functionality to work. KNXIP/Tunneling is not supported.
The management is accomplished through RPC methods within the KNX
namespace:
KNX.GetConfig
to obtain the global component's configurationKNX.SetConfig
to update the global component's configurationKNX.GetStatus
to obtain the global component's statusKNX.GetComponentConfig
to get the KNX specific configuration of selected Shelly component supporting KNX.KNX.SetComponentConfig
to set KNX specific configuration of selected Shelly component supporting KNX.KNX.ListComponents
to list all available for the device components supporting KNX functionality with their KNX confgurations
Methods
KNX.GetConfig
Find more about the global component's config properties in its config section
KNX.SetConfig
Parameters:
Property | Type | Description |
---|---|---|
| object | General KNX configuration |
Find more about the global component's config properties in its config section
KNX.GetStatus
The global KNX component does not have status at the moment.
KNX.GetComponentConfig
Request
Parameters:
Property | Type | Description |
---|---|---|
| string | Key of the related Shelly component. (in format |
Response
This method returns KNX configuration specific for the Shelly component type, Including current KNX revision.
Find more about KNX Input
configuration properties in the corresponding config section
Find more about KNX Input
operation in the corresponding functionality section
Find more about KNX Light
configuration properties in the corresponding config section
Find more about KNX Light
operation in the corresponding functionality section
Find more about KNX Switch
configuration properties in the corresponding config section
Find more about KNX Switch
operation in the corresponding functionality section
KNX.SetComponentConfig
Request
Parameters:
Property | Type | Description |
---|---|---|
| string | Key of the related Shelly component. (in format |
| object | KNX configuration for the related Shelly component specific to its type |
Response
This method will validate and update correpsonding KNX configuration. It will return an error if the supplied config object fails validation or the update fails and a JSON object containing the updated KNX revision on success.
Find more about KNX Input
configuration properties in the corresponding config section
Find more about KNX Input
operation in the corresponding functionality section
Find more about KNX Light
configuration properties in the corresponding config section
Find more about KNX Light
operation in the corresponding functionality section
Find more about KNX Switch
configuration properties in the corresponding config section
Find more about KNX Switch
operation in the corresponding functionality section
KNX.ListComponents
Request
Parameters:
Property | Type | Description |
---|---|---|
| number | Starting index of the element in the paginated repsonse list. Optional, default |
Response
This method will return the current KNX revision and the list of available on the device KNX configurations.
KNX component methods are available when the KNX enable
flag is set in the global configuration.
A global KNX revision is maintained, which is incremented on each change of KNX configuration and is included in the status of the System
component, status change events are also triggered. All KNX component methods include this revision number in the response.
Configuration
Properties:
Property | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
| boolean | Global KNX enable flag, initially | ||||||
| string | KNX individual address applicable to all available KNX components. Defaults to the reserved address | ||||||
| object | KNXIP/Routing properties
|
Status
The global KNX component does not have status at the moment.
Examples
KNX.GetConfig example
- KNX.GetConfig HTTP GET Request
- KNX.GetConfig Curl Request
- KNX.GetConfig Mos Request
http://192.168.33.1/rpc/KNX.GetConfig
curl -X POST -d '{"id":1,"method":"KNX.GetConfig"}' http://${SHELLY}/rpc
mos --port ${PORT} call KNX.GetConfig
Response
- KNX.GetConfig HTTP GET Response
- KNX.GetConfig Curl Response
- KNX.GetConfig Mos Response
{
"enable": true,
"ia": "1.1.9",
"routing": {
"addr": "224.0.23.12:3671"
}
}
{
"id": 1,
"src": "shellypro1pm-ec62608a98a4",
"params": {
"enable": true,
"ia": "1.1.9",
"routing": {
"addr": "224.0.23.12:3671"
}
}
}
{
"enable": true,
"ia": "1.1.9",
"routing": {
"addr": "224.0.23.12:3671"
}
}
KNX.SetConfig example
- KNX.SetConfig HTTP GET Request
- KNX.SetConfig Curl Request
- KNX.SetConfig Mos Request
http://192.168.33.1/rpc/KNX.SetConfig?config={"enable":true}
curl -X POST -d '{"id":1,"method":"KNX.SetConfig","params":{"config":{"enable":true}}}' http://${SHELLY}/rpc
mos --port ${PORT} call KNX.SetConfig '{"config":{"enable":true}}'
Response
- KNX.SetConfig HTTP GET Response
- KNX.SetConfig Curl Response
- KNX.SetConfig Mos Response
{
"restart_required": true
}
{
"id": 1,
"src": "shellypro1pm-ec62608a98a4",
"params": {
"restart_required": true
}
}
{
"restart_required": true
}
KNX.GetStatus example
- KNX.GetStatus HTTP GET Request
- KNX.GetStatus Curl Request
- KNX.GetStatus Mos Request
http://192.168.33.1/rpc/KNX.GetStatus
curl -X POST -d '{"id":1,"method":"KNX.GetStatus"}' http://${SHELLY}/rpc
mos --port ${PORT} call KNX.GetStatus
Response
- KNX.GetStatus HTTP GET Response
- KNX.GetStatus Curl Response
- KNX.GetStatus Mos Response
{}
{
"id": 1,
"src": "shellypro1pm-ec62608a98a4",
"params": {}
}
{}
KNX.GetComponentConfig example
- KNX.GetComponentConfig HTTP GET Request
- KNX.GetComponentConfig Curl Request
- KNX.GetComponentConfig Mos Request
http://192.168.33.1/rpc/KNX.GetComponentConfig?key="switch:0"
curl -X POST -d '{"id":1,"method":"KNX.GetComponentConfig","params":{"key":"switch:0"}}' http://${SHELLY}/rpc
mos --port ${PORT} call KNX.GetComponentConfig '{"key":"switch:0"}'
Response
- KNX.GetComponentConfig HTTP GET Response
- KNX.GetComponentConfig Curl Response
- KNX.GetComponentConfig Mos Response
{
"rev": 36,
"config": {
"key": "switch:0",
"cmd": {
"control": [
"1/1/4"
]
},
"fb": {
"status": [
"1/2/4"
],
"apower": [
"1/6/10"
],
"current": [
"1/6/11"
],
"voltage": [
"1/6/12"
],
"ret_energy": [
"1/6/13"
],
"aenergy": [
"1/6/14"
]
}
}
}
{
"id": 1,
"src": "shellypro1pm-ec62608a98a4",
"params": {
"rev": 36,
"config": {
"key": "switch:0",
"cmd": {
"control": [
"1/1/4"
]
},
"fb": {
"status": [
"1/2/4"
],
"apower": [
"1/6/10"
],
"current": [
"1/6/11"
],
"voltage": [
"1/6/12"
],
"ret_energy": [
"1/6/13"
],
"aenergy": [
"1/6/14"
]
}
}
}
}
{
"rev": 36,
"config": {
"key": "switch:0",
"cmd": {
"control": [
"1/1/4"
]
},
"fb": {
"status": [
"1/2/4"
],
"apower": [
"1/6/10"
],
"current": [
"1/6/11"
],
"voltage": [
"1/6/12"
],
"ret_energy": [
"1/6/13"
],
"aenergy": [
"1/6/14"
]
}
}
}
KNX.SetComponentConfig example
- KNX.SetComponentConfig HTTP GET Request
- KNX.SetComponentConfig Curl Request
- KNX.SetComponentConfig Mos Request
http://192.168.33.1/rpc/KNX.SetComponentConfig?key="switch:0"&config={}
curl -X POST -d '{"id":1,"method":"KNX.SetComponentConfig","params":{"key":"switch:0","config":{}}}' http://${SHELLY}/rpc
mos --port ${PORT} call KNX.SetComponentConfig '{"key":"switch:0","config":{}}'
Response
- KNX.GetComponentConfig HTTP GET Response
- KNX.GetComponentConfig Curl Response
- KNX.GetComponentConfig Mos Response
{
"rev": 13,
"restart_required": false
}
{
"id": 1,
"src": "shellypro1pm-ec62608a98a4",
"params": {
"rev": 13,
"restart_required": false
}
}
{
"rev": 13,
"restart_required": false
}
KNX.ListComponents example
- KNX.ListComponents HTTP GET Request
- KNX.ListComponents Curl Request
- KNX.ListComponents Mos Request
http://192.168.33.1/rpc/KNX.ListComponents?
curl -X POST -d '{"id":1,"method":"KNX.ListComponents","params":{}}' http://${SHELLY}/rpc
mos --port ${PORT} call KNX.ListComponents '{}'
Response
- KNX.GetComponentConfig HTTP GET Response
- KNX.GetComponentConfig Curl Response
- KNX.GetComponentConfig Mos Response
{
"rev": 11,
"offset": 0,
"total": 3,
"components": [
{
"key": "input:0",
"mode": "btn_single_dim",
"sw_toggle": {
"fb_status": null
},
"btn_dual_dim": {
"fb_state": null,
"fb_dim": null,
"dir": "down",
"step": 1
},
"btn_single_dim": {
"fb_state": null,
"fb_dim": null,
"cmd_state": null,
"step": 1
},
"btn_normal": {
"command": "toggle",
"fb_state": null,
"cmd_state": null
},
"btn_extended": {
"cmd_state": null,
"single_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
},
"double_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
},
"triple_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
},
"long_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
}
}
},
{
"key": "input:1",
"mode": "btn_normal",
"sw_toggle": {
"fb_status": null
},
"btn_dual_dim": {
"fb_state": null,
"fb_dim": null,
"dir": "down",
"step": 1
},
"btn_single_dim": {
"fb_state": null,
"fb_dim": null,
"cmd_state": null,
"step": 1
},
"btn_normal": {
"command": "on",
"fb_state": [
"1/1/6"
],
"cmd_state": null
},
"btn_extended": {
"cmd_state": null,
"single_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
},
"double_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
},
"triple_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
},
"long_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
}
}
},
{
"key": "switch:0",
"cmd": {
"control": [
"1/1/0"
]
},
"fb": {
"status": [
"1/2/0"
]
}
}
]
}
{
"id": 1,
"src": "shellypro1pm-ec62608a98a4",
"params": {
"rev": 11,
"offset": 0,
"total": 3,
"components": [
{
"key": "input:0",
"mode": "btn_single_dim",
"sw_toggle": {
"fb_status": null
},
"btn_dual_dim": {
"fb_state": null,
"fb_dim": null,
"dir": "down",
"step": 1
},
"btn_single_dim": {
"fb_state": null,
"fb_dim": null,
"cmd_state": null,
"step": 1
},
"btn_normal": {
"command": "toggle",
"fb_state": null,
"cmd_state": null
},
"btn_extended": {
"cmd_state": null,
"single_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
},
"double_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
},
"triple_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
},
"long_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
}
}
},
{
"key": "input:1",
"mode": "btn_normal",
"sw_toggle": {
"fb_status": null
},
"btn_dual_dim": {
"fb_state": null,
"fb_dim": null,
"dir": "down",
"step": 1
},
"btn_single_dim": {
"fb_state": null,
"fb_dim": null,
"cmd_state": null,
"step": 1
},
"btn_normal": {
"command": "on",
"fb_state": [
"1/1/6"
],
"cmd_state": null
},
"btn_extended": {
"cmd_state": null,
"single_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
},
"double_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
},
"triple_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
},
"long_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
}
}
},
{
"key": "switch:0",
"cmd": {
"control": [
"1/1/0"
]
},
"fb": {
"status": [
"1/2/0"
]
}
}
]
}
}
{
"rev": 11,
"offset": 0,
"total": 3,
"components": [
{
"key": "input:0",
"mode": "btn_single_dim",
"sw_toggle": {
"fb_status": null
},
"btn_dual_dim": {
"fb_state": null,
"fb_dim": null,
"dir": "down",
"step": 1
},
"btn_single_dim": {
"fb_state": null,
"fb_dim": null,
"cmd_state": null,
"step": 1
},
"btn_normal": {
"command": "toggle",
"fb_state": null,
"cmd_state": null
},
"btn_extended": {
"cmd_state": null,
"single_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
},
"double_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
},
"triple_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
},
"long_push": {
"fb": null,
"type": "command",
"command": "none",
"percent": 0,
"ratio": 0,
"scene": 0
}
}
},
{
"key": "input:1",
"mode": "btn_normal",
"sw_toggle": {
"fb_status": null
},
"btn_dual_dim": {
"fb_state": null,
"fb_dim": null,
"dir": "down",
"step": 1
},
"btn_single_dim": {
"fb_state": null,
"fb_dim": null,
"cmd_state": null,
"step": 1
},
"btn_normal": {
"command": "on",
"fb_state": [
"1/1/6"
],
"cmd_state": null
},
"btn_extended": {
"cmd_state": null,
"single_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
},
"double_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
},
"triple_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
},
"long_push": {
"fb": null,
"type": "command",
"command": "toggle",
"percent": 0,
"ratio": 0,
"scene": 0
}
}
},
{
"key": "switch:0",
"cmd": {
"control": [
"1/1/0"
]
},
"fb": {
"status": [
"1/2/0"
]
}
}
]
}