{
    "clients": {
        "_id": "clients",
        "type": "channel",
        "common": {},
        "native": {
            "object_id": "clients"
        },
        "logic": {
            "has_key": "_self",
            "has": {
                "clients.client": {
                    "type": "device",
                    "common": {},
                    "native": {
                        "object_id": "clients.client"
                    },
                    "logic": {
                        "_id": {
                            "ifNotNull": [
                                {
                                    "var": "ip"
                                },
                                {
                                    "cleanupForUseAsId": [
                                        {
                                            "var": "mac"
                                        }
                                    ]
                                },
                                null
                            ]
                        },
                        "common": {
                            "name": {
                                "or": [
                                    {
                                        "var": "name"
                                    },
                                    {
                                        "var": "hostname"
                                    },
                                    {
                                        "var": "ip"
                                    },
                                    {
                                        "var": "mac"
                                    }
                                ]
                            }
                        },
                        "has_key": "_self",
                        "has": {
                            "clients.client.ap_mac": {
                                "type": "state",
                                "common": {
                                    "name": "Access Point MAC address",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.ap_mac"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "ap_mac"
                                            },
                                            "ap_mac",
                                            null
                                        ]
                                    },
                                    "value": "ap_mac"
                                }
                            },
                            "clients.client.bssid": {
                                "type": "state",
                                "common": {
                                    "name": "BSSID",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.bssid"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "bssid"
                                            },
                                            "bssid",
                                            null
                                        ]
                                    },
                                    "value": "bssid"
                                }
                            },
                            "clients.client.channel": {
                                "type": "state",
                                "common": {
                                    "name": "Channel",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.channel"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "channel"
                                            },
                                            "channel",
                                            null
                                        ]
                                    },
                                    "value": "channel"
                                }
                            },
                            "clients.client.essid": {
                                "type": "state",
                                "common": {
                                    "name": "ESSID",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.essid"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "essid"
                                            },
                                            "essid",
                                            null
                                        ]
                                    },
                                    "value": "essid"
                                }
                            },
                            "clients.client.first_seen": {
                                "_id": "first_seen",
                                "type": "state",
                                "common": {
                                    "name": "First seen",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.first_seen"
                                },
                                "logic": {
                                    "value": {
                                        "secondsToDateTime": [
                                            {
                                                "var": "first_seen"
                                            }
                                        ]
                                    }
                                }
                            },
                            "clients.client.hostname": {
                                "_id": "hostname",
                                "type": "state",
                                "common": {
                                    "name": "Hostname",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.hostname"
                                },
                                "logic": {
                                    "value": "hostname"
                                }
                            },
                            "clients.client.ip": {
                                "_id": "ip",
                                "type": "state",
                                "common": {
                                    "name": "IP address",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.ip"
                                },
                                "logic": {
                                    "value": "ip"
                                }
                            },
                            "clients.client.is_guest": {
                                "_id": "is_guest",
                                "type": "state",
                                "common": {
                                    "name": "Is guest",
                                    "type": "boolean",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.is_guest"
                                },
                                "logic": {
                                    "value": "is_guest"
                                }
                            },
                            "clients.client.is_guest_by_uap": {
                                "type": "state",
                                "common": {
                                    "name": "Is guest by UAP",
                                    "type": "boolean",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.is_guest_by_uap"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "_is_guest_by_uap"
                                            },
                                            "is_guest_by_uap",
                                            null
                                        ]
                                    },
                                    "value": "_is_guest_by_uap"
                                }
                            },
                            "clients.client.is_guest_by_ugw": {
                                "type": "state",
                                "common": {
                                    "name": "Is guest by UGW",
                                    "type": "boolean",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.is_guest_by_ugw"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "_is_guest_by_ugw"
                                            },
                                            "is_guest_by_ugw",
                                            null
                                        ]
                                    },
                                    "value": "_is_guest_by_ugw"
                                }
                            },
                            "clients.client.is_guest_by_usw": {
                                "type": "state",
                                "common": {
                                    "name": "Is guest by USW",
                                    "type": "boolean",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.is_guest_by_usw"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "_is_guest_by_usw"
                                            },
                                            "is_guest_by_usw",
                                            null
                                        ]
                                    },
                                    "value": "_is_guest_by_usw"
                                }
                            },
                            "clients.client.is_online": {
                                "_id": "is_online",
                                "type": "state",
                                "common": {
                                    "name": "Is online",
                                    "type": "boolean",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": "",
                                    "def": true
                                },
                                "native": {
                                    "object_id": "clients.client.is_online"
                                },
                                "logic": {}
                            },
                            "clients.client.is_wired": {
                                "_id": "is_wired",
                                "type": "state",
                                "common": {
                                    "name": "Is wired",
                                    "type": "boolean",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.is_wired"
                                },
                                "logic": {
                                    "value": "is_wired"
                                }
                            },
                            "clients.client.last_seen": {
                                "_id": "last_seen",
                                "type": "state",
                                "common": {
                                    "name": "Last seen",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.last_seen"
                                },
                                "logic": {
                                    "value": {
                                        "secondsToDateTime": [
                                            {
                                                "var": "last_seen"
                                            }
                                        ]
                                    }
                                }
                            },
                            "clients.client.last_seen_by_uap": {
                                "type": "state",
                                "common": {
                                    "name": "Last seen by UAP",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.last_seen_by_uap"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "_last_seen_by_uap"
                                            },
                                            "last_seen_by_uap",
                                            null
                                        ]
                                    },
                                    "value": {
                                        "secondsToDateTime": [
                                            {
                                                "var": "_last_seen_by_uap"
                                            }
                                        ]
                                    }
                                }
                            },
                            "clients.client.last_seen_by_ugw": {
                                "type": "state",
                                "common": {
                                    "name": "Last seen by UGW",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.last_seen_by_ugw"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "_last_seen_by_ugw"
                                            },
                                            "last_seen_by_ugw",
                                            null
                                        ]
                                    },
                                    "value": {
                                        "secondsToDateTime": [
                                            {
                                                "var": "_last_seen_by_ugw"
                                            }
                                        ]
                                    }
                                }
                            },
                            "clients.client.last_seen_by_usw": {
                                "type": "state",
                                "common": {
                                    "name": "Last seen by USW",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.last_seen_by_usw"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "_last_seen_by_usw"
                                            },
                                            "last_seen_by_usw",
                                            null
                                        ]
                                    },
                                    "value": {
                                        "secondsToDateTime": [
                                            {
                                                "var": "_last_seen_by_usw"
                                            }
                                        ]
                                    }
                                }
                            },
                            "clients.client.mac": {
                                "_id": "mac",
                                "type": "state",
                                "common": {
                                    "name": "MAC address",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.mac"
                                },
                                "logic": {
                                    "value": "mac"
                                }
                            },
                            "clients.client.name": {
                                "_id": "name",
                                "type": "state",
                                "common": {
                                    "name": "Name",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.name"
                                },
                                "logic": {
                                    "value": "name"
                                }
                            },
                            "clients.client.network": {
                                "_id": "network",
                                "type": "state",
                                "common": {
                                    "name": "Network",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.network"
                                },
                                "logic": {
                                    "value": "network"
                                }
                            },
                            "clients.client.note": {
                                "type": "state",
                                "common": {
                                    "name": "Note",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.note"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "note"
                                            },
                                            "note",
                                            null
                                        ]
                                    },
                                    "value": "note"
                                }
                            },
                            "clients.client.noted": {
                                "_id": "noted",
                                "type": "state",
                                "common": {
                                    "name": "Noted",
                                    "type": "boolean",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.noted"
                                },
                                "logic": {
                                    "value": "noted"
                                }
                            },
                            "clients.client.rssi": {
                                "type": "state",
                                "common": {
                                    "name": "RSSI",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "dBm",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.rssi"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "rssi"
                                            },
                                            "rssi",
                                            null
                                        ]
                                    },
                                    "value": "rssi"
                                }
                            },
                            "clients.client.rx_bytes": {
                                "type": "state",
                                "common": {
                                    "name": "RX",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "Byte",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.rx_bytes"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "rx_bytes"
                                            },
                                            "rx_bytes",
                                            null
                                        ]
                                    },
                                    "value": "rx_bytes"
                                }
                            },
                            "clients.client.satisfaction": {
                                "_id": "satisfaction",
                                "type": "state",
                                "common": {
                                    "name": "Satisfaction",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "%",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.satisfaction"
                                },
                                "logic": {
                                    "value": "satisfaction"
                                }
                            },
                            "clients.client.signal": {
                                "type": "state",
                                "common": {
                                    "name": "Signal",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "dBm",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.signal"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "signal"
                                            },
                                            "signal",
                                            null
                                        ]
                                    },
                                    "value": "signal"
                                }
                            },
                            "clients.client.sw_mac": {
                                "type": "state",
                                "common": {
                                    "name": "Switch MAC address",
                                    "type": "string",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.sw_mac"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "sw_mac"
                                            },
                                            "sw_mac",
                                            null
                                        ]
                                    },
                                    "value": "sw_mac"
                                }
                            },
                            "clients.client.sw_port": {
                                "type": "state",
                                "common": {
                                    "name": "Switch port",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.sw_port"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "sw_port"
                                            },
                                            "sw_port",
                                            null
                                        ]
                                    },
                                    "value": "sw_port"
                                }
                            },
                            "clients.client.tx_bytes": {
                                "type": "state",
                                "common": {
                                    "name": "TX",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "Byte",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.tx_bytes"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "tx_bytes"
                                            },
                                            "tx_bytes",
                                            null
                                        ]
                                    },
                                    "value": "tx_bytes"
                                }
                            },
                            "clients.client.uptime": {
                                "_id": "uptime",
                                "type": "state",
                                "common": {
                                    "name": "Uptime",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "s",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.uptime"
                                },
                                "logic": {
                                    "value": "uptime"
                                }
                            },
                            "clients.client.uptime_by_uap": {
                                "type": "state",
                                "common": {
                                    "name": "Uptime by UAP",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "s",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.uptime_by_uap"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "_uptime_by_uap"
                                            },
                                            "uptime_by_uap",
                                            null
                                        ]
                                    },
                                    "value": "_uptime_by_uap"
                                }
                            },
                            "clients.client.uptime_by_ugw": {
                                "type": "state",
                                "common": {
                                    "name": "Uptime by UGW",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "s",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.uptime_by_ugw"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "_uptime_by_ugw"
                                            },
                                            "uptime_by_ugw",
                                            null
                                        ]
                                    },
                                    "value": "_uptime_by_ugw"
                                }
                            },
                            "clients.client.uptime_by_usw": {
                                "type": "state",
                                "common": {
                                    "name": "Uptime by USW",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "s",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.uptime_by_usw"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "_uptime_by_usw"
                                            },
                                            "uptime_by_usw",
                                            null
                                        ]
                                    },
                                    "value": "_uptime_by_usw"
                                }
                            },
                            "clients.client.wired-rx_bytes": {
                                "type": "state",
                                "common": {
                                    "name": "Wired RX",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "Byte",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.wired-rx_bytes"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "wired-rx_bytes"
                                            },
                                            "wired-rx_bytes",
                                            null
                                        ]
                                    },
                                    "value": "wired-rx_bytes"
                                }
                            },
                            "clients.client.wired-tx_bytes": {
                                "type": "state",
                                "common": {
                                    "name": "Wired TX",
                                    "type": "number",
                                    "role": "state",
                                    "read": true,
                                    "write": false,
                                    "unit": "Byte",
                                    "desc": ""
                                },
                                "native": {
                                    "object_id": "clients.client.wired-tx_bytes"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "wired-tx_bytes"
                                            },
                                            "wired-tx_bytes",
                                            null
                                        ]
                                    },
                                    "value": "wired-tx_bytes"
                                }
                            },
                            "clients.client.reconnect": {
                                "type": "state",
                                "common": {
                                    "name": "reconnect",
                                    "type": "boolean",
                                    "role": "button",
                                    "read": false,
                                    "write": true,
                                    "desc": "",
                                    "def": false
                                },
                                "native": {
                                    "object_id": "clients.client.reconnect"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "essid"
                                            },
                                            "reconnect",
                                            null
                                        ]
                                    }
                                }
                            },
                            "clients.client.blocked": {
                                "type": "state",
                                "common": {
                                    "name": "client block / unblock",
                                    "type": "boolean",
                                    "role": "state",
                                    "read": true,
                                    "write": true,
                                    "desc": "",
                                    "def": false
                                },
                                "native": {
                                    "object_id": "clients.client.blocked"
                                },
                                "logic": {
                                    "_id": {
                                        "ifNotNull": [
                                            {
                                                "var": "essid"
                                            },
                                            "blocked",
                                            null
                                        ]
                                    }
                                }
                            }                            
                        }
                    }
                }
            }
        }
    }
}