Skip to content
Chris Jackson edited this page Oct 13, 2013 · 3 revisions

The item config RESTful interface (currently!) used in HABmin is defined below.

  • GET to /rest/config/items will list all the items and their configuration
  • GET to /rest/config/items/name will list the configuration for item name
  • PUT to /rest/config/items/name will update the configuration for item name
  • POST to /rest/config/items/name will create a new item name
  • DELETE to /rest/config/items/name will delete the item name

Below is the format of the data returned for items. This is the raw configuration data from the model - it includes the model, binding strings, groups, label, persistence etc. Note that the label is split into different components (label, format, mapping, unit) so that it can be presented separately in the user interface.

{
    "item": [
        {
            "model": "heatmiser",
            "type": "GroupItem",
            "name": "Heating",
            "groups": "All"
        },
        {
            "model": "heatmiser",
            "type": "SwitchItem",
            "name": "LoungeThermostat_Enable",
            "icon": "heating",
            "binding": "heatmiser",
            "label": "Lounge Heating Enable",
            "units": "",
            "format": "%s",
            "groups": "Heating",
            "bindings": "2:ONOFF",
            "persistence": {
                "service": "rrd4j",
                "group": "Heating",
                "strategies": [
                    "everyChange",
                    "everyMinute",
                    "restoreOnStartup"
                ]
            }
        },
        {
            "model": "owserver",
            "type": "NumberItem",
            "name": "Temperature_Boiler",
            "icon": "temperature",
            "binding": "owserver",
            "label": "Boiler Temperature",
            "units": "°C",
            "format": "%.1f",
            "groups": [
                "Temperature",
                "OneWire"
            ],
            "bindings": "<ow1:F90000012A608428:Temperature:10000",
            "persistence": [
                {
                    "service": "db4o",
                    "group": "Temperature",
                    "strategies": [
                        "everyChange",
                        "everyHour"
                    ]
                },
                {
                    "service": "logging",
                    "group": "Temperature"
                },
                {
                    "service": "rrd4j",
                    "group": "Temperature",
                    "strategies": [
                        "everyMinute",
                        "restoreOnStartup"
                    ]
                },
                {
                    "service": "sql",
                    "group": "Temperature",
                    "strategies": [
                        "everyChange",
                        "everyHour"
                    ]
                }
            ]
        },