/** * Copyright 2020-2024 Tony Fleisher * * Unless required by applicable law or agreed to in writing, * this software is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ import groovy.json.JsonOutput definition( name: "Hubitat Z-Wave Mesh Details", namespace: "tfleisher", author: "TonyFleisher", description: "Get Z-Wave Mesh Details", category: "Utility", singleInstance: true, iconUrl: "", iconX2Url: "", oauth: true, importUrl: "https://raw.githubusercontent.com/TonyFleisher/tonyfleisher-hubitat/beta/Apps/mesh-details/mesh-details.groovy" ) /**********************************************************************************************************************************************/ private releaseVer() { return "1.1.34.2" } private appVerDate() { return "2025-01-30" } /**********************************************************************************************************************************************/ preferences { page name: "mainPage" page name: "devicesPage", nextPage: "mainPage" } mappings { path("/appData") { action: [GET: "appDataController"]} path("/deviceDetails") { action: [GET: "deviceDetailsController", POST: "saveDeviceDetailsController"]} path("/events") { action: [POST: "publishEventController"]} path("/meshinfo") { action: [GET: "meshInfo"]} path("/settings.js") { action: [GET: "settingsController"]} path("/settings") { action: [GET: "settingsController", POST: "updateAppSettingsController"]} path("/remoteLog") { action: [POST: "remoteLog"]} } import java.text.SimpleDateFormat import groovy.transform.Field @Field static String uiFramework = "bs5" // Use Boostrap5 framework @Field static String uiMainTableClasses = "table table-striped table-bordered table-hover stripe cell-border hover" @Field static String uiDeviceDetailTableClasses = "table table-bordered" @Field static String uiDevicePropertiesTableClasses = "table table-bordered" @Field static String v = "998md1134" @Field static String statusMessage = "" @Field static String fileSuffix = "-1.1.34" String getMAIN_SCRIPT_LOCATION() { "/local/zwave_mesh_dev-script-controller" + fileSuffix + ".js" + "?v=${v}" } String getUTILS_SCRIPT_LOCATION() {"/local/zwave_mesh_dev-utils-controller" + fileSuffix + ".js" + "?v=${v}" } String getDATATABLES_SCRIPT_LOCATION() {"/local/zwave_mesh_dev-dataTables" + fileSuffix + ".js" + "?v=${v}" } String getMAIN_CSS_LOCATION() { "/local/zwave_mesh_dev" + fileSuffix + ".css" + "?v=${v}" } def mainPage() { dynamicPage (name: "mainPage", title: "", install: true, uninstall: true) { if (resetSettings) { resetAppSettings() } // Don't need hostoverride anymore if (resetHost || hostOverride) { resetHostOverride() } if (!permitDeviceAccess) { app.removeSetting("deviceList") state.hasInitializedDeviceList = false } if (deviceList && !state?.hasInitializedDeviceList) { state.hasInitializedDeviceList = true } if (!settings.nodeBase) { app.updateSetting("nodeBase", "base16") } section("") { label title: "App name" } if (!getAccessToken()) { section("") { paragraph title: "Enable OAuth", "Please enable OAuth for this App (in Apps Code)" } } else { if (app.getInstallationState() == 'COMPLETE') { String meshInfoLink = getAppLink("meshinfo") section("General Configuration") { input "linkStyle", "enum", title: "Link Style", required: true, submitOnChange: true, options: ["embedded":"Same Window", "external":"New Window"], image: "", defaultValue: "embedded" input "deviceLinks", "bool", title: "Enable device links", defaultValue: false, submitOnChange: true input "nodeBase", "enum", title: "Display nodes as hex or base10?", multiple: false, options: ["base16": "base16 (default)", "base10":"base10"], defaultValue: "base16", submitOnChange: true if (settings?.nodeBase == "base16") { input "includeDecNodeId", "bool", title: "Also include base10 nodeId?", defaultValue: false, submitOnChange: true } paragraph "