Get Emporia Vue Data

Flow that connects to your Emporia Data and makes it usable in Node-red. Sample dashboard included.

[{"id":"43b8bde0366d525c","type":"tab","label":"Emporia Vue Data","disabled":false,"info":"","env":[]},{"id":"6f59c846e439332a","type":"http request","z":"43b8bde0366d525c","name":"Customer Devices","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://api.emporiaenergy.com/customers/devices","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":710,"y":300,"wires":[["1330af67e9fa98f5"]]},{"id":"85ead931af4354c8","type":"debug","z":"43b8bde0366d525c","name":"Debug","active":false,"tosidebar":true,"console":"false","tostatus":false,"complete":"payload","x":1090,"y":220,"wires":[]},{"id":"7eb71cadcc8d2683","type":"function","z":"43b8bde0366d525c","name":"Setup Header","func":"// Sample code to set headers with tokens\nvar accessToken = flow.get('accessToken'); // Replace with your token variable names\nvar idToken = flow.get('idToken');\nvar refreshToken = flow.get('refreshToken');\n\n// Set headers for the HTTP request\nmsg.headers = {\n    'authtoken': idToken,\n};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":300,"wires":[["6f59c846e439332a"]]},{"id":"cb5fc0c16bd5377c","type":"inject","z":"43b8bde0366d525c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":320,"wires":[["7eb71cadcc8d2683"]]},{"id":"37a5ef3fbd4a0b87","type":"inject","z":"43b8bde0366d525c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"","payloadType":"date","x":130,"y":180,"wires":[["d05aee749997b452"]]},{"id":"e9fa3438c033deed","type":"function","z":"43b8bde0366d525c","name":"Set Tokens as Flow Variables","func":"flow.set(\"idToken\", msg.payload.idToken.jwtToken);\nflow.set(\"accessToken\", msg.payload.accessToken);\nflow.set(\"refreshToken\", msg.payload.refreshToken.token);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":160,"wires":[[]]},{"id":"1330af67e9fa98f5","type":"json","z":"43b8bde0366d525c","name":"","property":"payload","action":"","pretty":false,"x":950,"y":300,"wires":[["85ead931af4354c8","85d8bc4196afe2c1"]]},{"id":"45d04d33e4b9ae3f","type":"http request","z":"43b8bde0366d525c","name":"Customer Email","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://api.emporiaenergy.com/customers?email=you%40email.com","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":700,"y":440,"wires":[["8a092edcfc492f5a"]]},{"id":"225443ca11992e10","type":"function","z":"43b8bde0366d525c","name":"Setup Header","func":"// Sample code to set headers with tokens\nvar accessToken = flow.get('accessToken'); // Replace with your token variable names\nvar idToken = flow.get('idToken');\nvar refreshToken = flow.get('refreshToken');\n\n// Set headers for the HTTP request\nmsg.headers = {\n    'authtoken': idToken,\n};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":440,"wires":[["45d04d33e4b9ae3f"]]},{"id":"d0ade771ad53d834","type":"inject","z":"43b8bde0366d525c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":440,"wires":[["225443ca11992e10"]]},{"id":"8a092edcfc492f5a","type":"json","z":"43b8bde0366d525c","name":"","property":"payload","action":"","pretty":false,"x":950,"y":440,"wires":[["b1dec1baf3e17276"]]},{"id":"30865242910ba324","type":"http request","z":"43b8bde0366d525c","name":"Location Properties","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://api.emporiaenergy.com/devices/{{{deviceGid}}}/locationProperties","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":710,"y":580,"wires":[["0a11be759dae7aa7"]]},{"id":"936f68b1cd09df81","type":"function","z":"43b8bde0366d525c","name":"Setup Header","func":"// Sample code to set headers with tokens\nvar accessToken = flow.get('accessToken'); // Replace with your token variable names\nvar idToken = flow.get('idToken');\nvar refreshToken = flow.get('refreshToken');\n\n// Set headers for the HTTP request\nmsg.headers = {\n    'authtoken': idToken,\n};\nmsg.deviceGid = flow.get('deviceGid');\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":580,"wires":[["30865242910ba324"]]},{"id":"7bc149a2f3b3d731","type":"inject","z":"43b8bde0366d525c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":580,"wires":[["936f68b1cd09df81"]]},{"id":"0a11be759dae7aa7","type":"json","z":"43b8bde0366d525c","name":"","property":"payload","action":"","pretty":false,"x":950,"y":580,"wires":[["b90ee50d81e969ff"]]},{"id":"85d8bc4196afe2c1","type":"function","z":"43b8bde0366d525c","name":"Set deviceGid as Flow Variable","func":"flow.set('deviceGid',msg.payload.devices[0].deviceGid);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1190,"y":300,"wires":[[]]},{"id":"7308ee2e640442d1","type":"http request","z":"43b8bde0366d525c","name":"Device Usage","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://api.emporiaenergy.com/AppAPI?apiMethod=getDeviceListUsages&deviceGids={{{deviceGid}}}&instant={{{timestamp}}}&scale={{{scale}}}&energyUnit={{{units}}}","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":760,"y":700,"wires":[["e40ceeb04ea4dcaa"]]},{"id":"0704af1b736d8129","type":"function","z":"43b8bde0366d525c","name":"Setup Header","func":"// Sample code to set headers with tokens\nvar accessToken = flow.get('accessToken'); // Replace with your token variable names\nvar idToken = flow.get('idToken');\nvar refreshToken = flow.get('refreshToken');\n\nvar inputTimestamp = msg.payload; // Replace this with your timestamp\n\n// Convert the timestamp to a Date object\nvar date = new Date(inputTimestamp);\n\n// Get the components of the date and time\nvar year = date.getUTCFullYear();\nvar month = (date.getUTCMonth() + 1).toString().padStart(2, '0');\nvar day = date.getUTCDate().toString().padStart(2, '0');\nvar hours = date.getUTCHours().toString().padStart(2, '0');\nvar minutes = date.getUTCMinutes().toString().padStart(2, '0');\nvar seconds = date.getUTCSeconds().toString().padStart(2, '0');\nvar milliseconds = date.getUTCMilliseconds().toString().padStart(3, '0');\n\n// Create the formatted date string\nvar formattedDate = `${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${milliseconds}Z`;\n\n// Set the formatted date as the output\nmsg.payload = formattedDate;\n\n// Set headers for the HTTP request\nmsg.headers = {\n    'authtoken': idToken,\n};\nmsg.deviceGid = flow.get('deviceGid');\nmsg.scale = '1S';\nmsg.units = 'AmpHours';\nmsg.timestamp = msg.payload;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":700,"wires":[["7308ee2e640442d1"]]},{"id":"9c4919eb2614b83b","type":"inject","z":"43b8bde0366d525c","name":"","props":[{"p":"payload"}],"repeat":"30","crontab":"","once":true,"onceDelay":"5","topic":"","payload":"","payloadType":"date","x":150,"y":700,"wires":[["1df7f264148a0c1f"]]},{"id":"e40ceeb04ea4dcaa","type":"json","z":"43b8bde0366d525c","name":"","property":"payload","action":"","pretty":false,"x":910,"y":700,"wires":[["3764cee5a827d414"]]},{"id":"38baf4377d16df74","type":"function","z":"43b8bde0366d525c","name":"Split Out Channel Usages","func":"msg.payload = msg.payload.deviceListUsages.devices[0].channelUsages;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1210,"y":700,"wires":[["4a8f6eb1b43f8091","eb51fd949b7e5709","4c34cebd5fbf4ddb"]]},{"id":"4a8f6eb1b43f8091","type":"debug","z":"43b8bde0366d525c","name":"debug 30","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1440,"y":600,"wires":[]},{"id":"eb51fd949b7e5709","type":"ui_template","z":"43b8bde0366d525c","group":"086c5be964fa8f6c","name":"","order":2,"width":"10","height":"12","format":"<style>\n    /* Apply horizontal padding to both header and data cells */\n    th, td {\n        padding-left: 10px; /* Adjust the value as needed for left padding */\n        padding-right: 10px; /* Adjust the value as needed for right padding */\n        text-align: center; /* Keeps text centered, modify as needed */\n    }\n\n    /* Specific adjustments for the Description column, if different padding is desired */\n    td:nth-child(2), th:nth-child(2) { /* Targets the second column (Description) */\n        padding-left: 20px; /* Example: adding more left padding */\n        padding-right: 20px; /* Example: adding more right padding */\n        text-align: left; /* Aligns text to the left for description, adjust as needed */\n    }\n</style>\n\n<table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th style=\"text-align: center;\">Channel</th>\n            <th>Description</th>\n            <th style=\"text-align: center;\">Percentage</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr ng-repeat=\"item in msg.payload\">\n            <td style=\"text-align: center;\">{{item.channelNum}}</td>\n            <td>{{item.name}}</td>\n            <td style=\"text-align: center;\">{{item.percentage | number:2}}%</td>\n        </tr>\n    </tbody>\n</table>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1440,"y":640,"wires":[[]]},{"id":"3764cee5a827d414","type":"switch","z":"43b8bde0366d525c","name":"","property":"payload.message","propertyType":"msg","rules":[{"t":"eq","v":"The incoming token has expired","vt":"str"},{"t":"neq","v":"The incoming token has expired","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":700,"wires":[["ec928520c992b4f4"],["38baf4377d16df74"]]},{"id":"ec928520c992b4f4","type":"link out","z":"43b8bde0366d525c","name":"Re-Auth","mode":"link","links":["a0fdb3073fe55d11"],"x":1125,"y":660,"wires":[]},{"id":"a0fdb3073fe55d11","type":"link in","z":"43b8bde0366d525c","name":"link in 1","links":["ec928520c992b4f4"],"x":165,"y":220,"wires":[["d05aee749997b452"]]},{"id":"d05aee749997b452","type":"cognito-user-login","z":"43b8bde0366d525c","name":"Cognito Login","target":"payload","userpoolid":"us-east-2_ghlOXVLi1","userpoolidType":"str","clientid":"EnterYourClientID","clientidType":"str","x":480,"y":180,"wires":[["e9fa3438c033deed","7eb71cadcc8d2683"],[]]},{"id":"e21e629ed7d59346","type":"status","z":"43b8bde0366d525c","name":"","scope":["d05aee749997b452"],"x":320,"y":120,"wires":[["1bfbc421cc378b0e"]]},{"id":"1bfbc421cc378b0e","type":"function","z":"43b8bde0366d525c","name":"set connection status","func":"if (msg.status.text === \"authenticated\"){\n    flow.set('connected',true)\n}\nelse {\n    flow.set('connected',false)\n}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":120,"wires":[[]]},{"id":"1df7f264148a0c1f","type":"function","z":"43b8bde0366d525c","name":"Check Connection","func":"connected = flow.get('connected');\nif (connected === true){\nreturn msg;\n}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":700,"wires":[["0704af1b736d8129"]]},{"id":"b1dec1baf3e17276","type":"debug","z":"43b8bde0366d525c","name":"Debug","active":false,"tosidebar":true,"console":"false","tostatus":false,"complete":"payload","x":1090,"y":440,"wires":[]},{"id":"b90ee50d81e969ff","type":"debug","z":"43b8bde0366d525c","name":"Debug","active":false,"tosidebar":true,"console":"false","tostatus":false,"complete":"payload","x":1090,"y":580,"wires":[]},{"id":"4c34cebd5fbf4ddb","type":"function","z":"43b8bde0366d525c","name":"Add \"inUse\"","func":"// Input: msg.payload should contain the array of objects\nvar devices = msg.payload;\n\n// Retrieve the existing deviceStatus from flow (if it exists)\nvar deviceStatus = flow.get('deviceStatus') || {};\n\n// Update each device object with the \"inUse\" variable and track the last poll status\ndevices.forEach(function(device) {\n    // Set the inUse status based on device usage\n    var currentInUse = device.usage > 0;\n\n    // Check if the device already has an entry in deviceStatus\n    if (!deviceStatus[device.name]) {\n        // If it's the first time the device appears, initialize it with inUse and useLastPoll\n        deviceStatus[device.name] = {};\n    }\n\n    // Only update the necessary properties\n    deviceStatus[device.name].inUse = currentInUse;\n\n    // Set useLastPoll if inUse has changed, or keep the existing useLastPoll\n    if (deviceStatus[device.name].inUse !== currentInUse) {\n        deviceStatus[device.name].useLastPoll = deviceStatus[device.name].inUse;\n    }\n});\n\n// Save the updated deviceStatus back to flow\nflow.set('deviceStatus', deviceStatus);\n\n// Output: Updated payload with \"inUse\" and \"useLastPoll\" variables\nmsg.payload = devices;\nreturn msg;\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1450,"y":700,"wires":[["629f98a0c0ad5c1a"]]},{"id":"629f98a0c0ad5c1a","type":"function","z":"43b8bde0366d525c","name":"On Off timestamps","func":"// Initialize the 'deviceStatus' flow variable if it doesn't exist\nvar deviceStatus = flow.get('deviceStatus') || {};\n\n// Current timestamp\nvar currentTimestamp = new Date().toISOString();\n\n// Loop through all devices in the deviceStatus object\nfor (var deviceName in deviceStatus) {\n    var device = deviceStatus[deviceName];\n\n    // Initialize missing properties with default values if they don't exist\n    if (device.lastUsed === undefined) {\n        device.lastUsed = 0; // Default to 0 if lastUsed doesn't exist\n    }\n\n    if (device.useLastPoll === undefined) {\n        device.useLastPoll = device.inUse || false; // Set to the current inUse status if not initialized\n    }\n\n    // First Scenario: Initialize turnOn_timestamp and turnOff_timestamp if they are undefined or null\n    if (device.turnOn_timestamp == null && device.turnOff_timestamp == null) {\n        if (device.inUse === true) {\n            device.turnOn_timestamp = currentTimestamp; // Set turnOn_timestamp if inUse is true\n            device.turnOff_timestamp = null; // Ensure turnOff_timestamp is null\n        } else if (device.inUse === false) {\n            device.turnOff_timestamp = currentTimestamp; // Set turnOff_timestamp if inUse is false\n            device.turnOn_timestamp = null; // Ensure turnOn_timestamp is null\n        }\n    } else {\n        // Second Scenario: If timestamps already exist, check for state transitions\n        if (device.inUse !== device.useLastPoll) {\n            \n            if (device.inUse === true) {\n                // Transitioning from off to on (inUse was false, now true)\n                if (device.turnOn_timestamp == null) {  // Only update if it's still null\n                    device.turnOn_timestamp = currentTimestamp; // Set turnOn_timestamp if it was null\n                }\n                device.turnOff_timestamp = null; // Ensure turnOff_timestamp is null\n            } else if (device.inUse === false) {\n                // Transitioning from on to off (inUse was true, now false)\n                if (device.turnOff_timestamp == null) { // Only update if it's still null\n                    device.turnOff_timestamp = currentTimestamp; // Set turnOff_timestamp if it was null\n                }\n                device.turnOn_timestamp = null; // Ensure turnOn_timestamp is null\n            }\n            // Update useLastPoll to the current inUse status\n            device.useLastPoll = device.inUse;\n        }\n    }\n\n    // If the device is in use, calculate the currentRuntime (time since turnOn_timestamp)\n    if (device.inUse && device.turnOn_timestamp) {\n        var turnOnTime = new Date(device.turnOn_timestamp).getTime();\n        var currentTime = new Date(currentTimestamp).getTime();\n        var currentRuntimeMs = currentTime - turnOnTime;\n        device.currentRuntime = Math.floor(currentRuntimeMs / 1000); // Current runtime in seconds\n    }\n\n    // If the device is not in use, calculate the lastUsed (time since turnOff_timestamp)\n    if (!device.inUse && device.turnOff_timestamp) {\n        var turnOffTime = new Date(device.turnOff_timestamp).getTime();\n        var lastUsedTime = new Date(currentTimestamp).getTime();\n        var lastUsedMs = lastUsedTime - turnOffTime;\n        device.lastUsed = Math.floor(lastUsedMs / 1000); // Last used time in seconds\n    }\n}\n\n// Set the updated 'deviceStatus' flow variable with the updated object\nflow.set('deviceStatus', deviceStatus);\n\n// Return the original message (msg.payload)\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1710,"y":700,"wires":[[]]},{"id":"388039fe94be31f9","type":"inject","z":"43b8bde0366d525c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1460,"y":760,"wires":[["629f98a0c0ad5c1a"]]},{"id":"1f33883e4577b6f6","type":"inject","z":"43b8bde0366d525c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":"5","topic":"","payload":"","payloadType":"date","x":250,"y":1220,"wires":[["bda03cae0543b193"]]},{"id":"bda03cae0543b193","type":"change","z":"43b8bde0366d525c","name":"devices","rules":[{"t":"set","p":"payload","pt":"msg","to":"deviceStatus","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":1220,"wires":[["9201f03f1a611241","8b096c4151545303","f5bd4082c55668f7","914131cc4b6d3284","41e5423a1a3d3b08","42e25f172d0d3913","7f65d016aabb6e50","7b98b189cb390e79"]]},{"id":"9201f03f1a611241","type":"change","z":"43b8bde0366d525c","name":"Dryer","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Dryer","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1220,"wires":[["f3730dce3e8b0549"]]},{"id":"f5bd4082c55668f7","type":"change","z":"43b8bde0366d525c","name":"Water Heater","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[\"Water Heater\"]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":1300,"wires":[["99c734311b1d1490"]]},{"id":"f3730dce3e8b0549","type":"change","z":"43b8bde0366d525c","name":"value 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inUse","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":1220,"wires":[["37f48bc05f47d26f"]]},{"id":"37f48bc05f47d26f","type":"ui-led","z":"43b8bde0366d525c","name":"Dryer led","group":"769a934fd6bb5bf9","order":14,"width":"1","height":"1","label":"","labelPlacement":"right","labelAlignment":"center","states":[{"value":"false","valueType":"bool","color":"#6b6b6b"},{"value":"true","valueType":"bool","color":"#00ff00"}],"allowColorForValueInMessage":false,"shape":"circle","showBorder":true,"showGlow":true,"x":960,"y":1260,"wires":[]},{"id":"c29d3b2810ada220","type":"ui-text","z":"43b8bde0366d525c","group":"769a934fd6bb5bf9","order":15,"width":"2","height":"1","name":"","label":"Dryer","format":"{{msg.payload}}","layout":"row-left","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":950,"y":1220,"wires":[]},{"id":"8b096c4151545303","type":"debug","z":"43b8bde0366d525c","name":"debug 6","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":600,"y":1180,"wires":[]},{"id":"914131cc4b6d3284","type":"change","z":"43b8bde0366d525c","name":"Water Pump","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[\"Water Pump\"]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":1380,"wires":[["50a64ff58061e3b7"]]},{"id":"41e5423a1a3d3b08","type":"change","z":"43b8bde0366d525c","name":"Fridge","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[\"Fridge\"]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1460,"wires":[["19e70f04b50da9e7"]]},{"id":"7f65d016aabb6e50","type":"change","z":"43b8bde0366d525c","name":"Dishwasher","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[\"Dishwasher\"]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":1620,"wires":[["09c2996028971996"]]},{"id":"7b98b189cb390e79","type":"change","z":"43b8bde0366d525c","name":"Sewer","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[\"Sewer\"]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1700,"wires":[["4219b328a45dc9e1"]]},{"id":"42e25f172d0d3913","type":"change","z":"43b8bde0366d525c","name":"Freezer","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[\"Freezer\"]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":1540,"wires":[["e034afbef769e4d1"]]},{"id":"99c734311b1d1490","type":"change","z":"43b8bde0366d525c","name":"value 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inUse","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":1300,"wires":[["81b767de360951cb"]]},{"id":"81b767de360951cb","type":"ui-led","z":"43b8bde0366d525c","name":"Water Heater led","group":"769a934fd6bb5bf9","order":12,"width":"1","height":"1","label":"","labelPlacement":"right","labelAlignment":"center","states":[{"value":"false","valueType":"bool","color":"#6b6b6b"},{"value":"true","valueType":"bool","color":"#00ff00"}],"allowColorForValueInMessage":false,"shape":"circle","showBorder":true,"showGlow":true,"x":990,"y":1340,"wires":[]},{"id":"891a6e2703373459","type":"ui-text","z":"43b8bde0366d525c","group":"769a934fd6bb5bf9","order":13,"width":"2","height":"1","name":"","label":"Water Heater","format":"{{msg.payload}}","layout":"row-left","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":970,"y":1300,"wires":[]},{"id":"50a64ff58061e3b7","type":"change","z":"43b8bde0366d525c","name":"value 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inUse","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":1380,"wires":[["c71f90d600e4812f"]]},{"id":"c71f90d600e4812f","type":"ui-led","z":"43b8bde0366d525c","name":"Water Pump led","group":"769a934fd6bb5bf9","order":10,"width":"1","height":"1","label":"","labelPlacement":"right","labelAlignment":"center","states":[{"value":"false","valueType":"bool","color":"#6b6b6b"},{"value":"true","valueType":"bool","color":"#00ff00"}],"allowColorForValueInMessage":false,"shape":"circle","showBorder":true,"showGlow":true,"x":980,"y":1420,"wires":[]},{"id":"da96394fc467e084","type":"ui-text","z":"43b8bde0366d525c","group":"769a934fd6bb5bf9","order":11,"width":"2","height":"1","name":"","label":"Water Pump","format":"{{msg.payload}}","layout":"row-left","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":970,"y":1380,"wires":[]},{"id":"19e70f04b50da9e7","type":"change","z":"43b8bde0366d525c","name":"value 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inUse","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":1460,"wires":[["426d1323670c018b"]]},{"id":"426d1323670c018b","type":"ui-led","z":"43b8bde0366d525c","name":"Fridge led","group":"769a934fd6bb5bf9","order":8,"width":"1","height":"1","label":"","labelPlacement":"right","labelAlignment":"center","states":[{"value":"false","valueType":"bool","color":"#6b6b6b"},{"value":"true","valueType":"bool","color":"#00ff00"}],"allowColorForValueInMessage":false,"shape":"circle","showBorder":true,"showGlow":true,"x":960,"y":1500,"wires":[]},{"id":"725402a9b8efe7bd","type":"ui-text","z":"43b8bde0366d525c","group":"769a934fd6bb5bf9","order":9,"width":"2","height":"1","name":"","label":"Fridge","format":"{{msg.payload}}","layout":"row-left","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":950,"y":1460,"wires":[]},{"id":"e034afbef769e4d1","type":"change","z":"43b8bde0366d525c","name":"value 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inUse","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":1540,"wires":[["ac0a2742a7e7dd2c"]]},{"id":"ac0a2742a7e7dd2c","type":"ui-led","z":"43b8bde0366d525c","name":"Freezer led","group":"769a934fd6bb5bf9","order":6,"width":"1","height":"1","label":"","labelPlacement":"right","labelAlignment":"center","states":[{"value":"false","valueType":"bool","color":"#6b6b6b"},{"value":"true","valueType":"bool","color":"#00ff00"}],"allowColorForValueInMessage":false,"shape":"circle","showBorder":true,"showGlow":true,"x":970,"y":1580,"wires":[]},{"id":"4f44aabd3c738529","type":"ui-text","z":"43b8bde0366d525c","group":"769a934fd6bb5bf9","order":7,"width":"2","height":"1","name":"","label":"Freezer","format":"{{msg.payload}}","layout":"row-left","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":960,"y":1540,"wires":[]},{"id":"09c2996028971996","type":"change","z":"43b8bde0366d525c","name":"value 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inUse","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":1620,"wires":[["f14133d6d27264cd"]]},{"id":"f14133d6d27264cd","type":"ui-led","z":"43b8bde0366d525c","name":"Dishwasher led","group":"769a934fd6bb5bf9","order":4,"width":"1","height":"1","label":"","labelPlacement":"right","labelAlignment":"center","states":[{"value":"false","valueType":"bool","color":"#6b6b6b"},{"value":"true","valueType":"bool","color":"#00ff00"}],"allowColorForValueInMessage":false,"shape":"circle","showBorder":true,"showGlow":true,"x":980,"y":1660,"wires":[]},{"id":"52b21c0cdbaa5897","type":"ui-text","z":"43b8bde0366d525c","group":"769a934fd6bb5bf9","order":5,"width":"2","height":"1","name":"","label":"Dishwasher","format":"{{msg.payload}}","layout":"row-left","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":970,"y":1620,"wires":[]},{"id":"4219b328a45dc9e1","type":"change","z":"43b8bde0366d525c","name":"value 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inUse","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":1700,"wires":[["acf1c4927c05e254"]]},{"id":"acf1c4927c05e254","type":"ui-led","z":"43b8bde0366d525c","name":"Septic Pump led","group":"769a934fd6bb5bf9","order":2,"width":"1","height":"1","label":"","labelPlacement":"right","labelAlignment":"center","states":[{"value":"false","valueType":"bool","color":"#6b6b6b"},{"value":"true","valueType":"bool","color":"#00ff00"}],"allowColorForValueInMessage":false,"shape":"circle","showBorder":true,"showGlow":true,"x":980,"y":1740,"wires":[]},{"id":"c2a7910bed24f331","type":"ui-text","z":"43b8bde0366d525c","group":"769a934fd6bb5bf9","order":3,"width":"2","height":"1","name":"","label":"Septic Pump","format":"{{msg.payload}}","layout":"row-left","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":970,"y":1700,"wires":[]},{"id":"086c5be964fa8f6c","type":"ui_group","name":"Panel","tab":"9197d998c1e76a14","order":1,"disp":false,"width":"10","collapse":false,"className":""},{"id":"769a934fd6bb5bf9","type":"ui-group","name":"Circuits","page":"b971c25226fd6f6f","width":"3","height":1,"order":1,"showTitle":true,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"9197d998c1e76a14","type":"ui_tab","name":"Electric","icon":"dashboard","disabled":false,"hidden":false},{"id":"b971c25226fd6f6f","type":"ui-page","name":"IO","ui":"b233e5341b51d7f5","path":"/IO","icon":"home","layout":"grid","theme":"3dc7516ac224a492","breakpoints":[{"name":"Default","px":"0","cols":"3"},{"name":"Tablet","px":"576","cols":"6"},{"name":"Small Desktop","px":"768","cols":"9"},{"name":"Desktop","px":"1024","cols":"12"}],"order":3,"className":"","visible":"true","disabled":"false"},{"id":"b233e5341b51d7f5","type":"ui-base","name":"My Dashboard","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"showPageTitle":true,"navigationStyle":"default","titleBarStyle":"default","showReconnectNotification":true,"notificationDisplayTime":1,"showDisconnectNotification":true},{"id":"3dc7516ac224a492","type":"ui-theme","name":"Default Theme","colors":{"surface":"#5c5c5c","primary":"#0094ce","bgPage":"#000000","groupBg":"#282828","groupOutline":"#282828"},"sizes":{"density":"default","pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

Flow Info

Created 4 months, 3 weeks ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x15)
  • debug (x5)
  • function (x11)
  • http request (x4)
  • inject (x7)
  • json (x4)
  • link in (x1)
  • link out (x1)
  • status (x1)
  • switch (x1)
Other

Tags

  • Emporia
  • Energy
  • Data
  • Vue
  • Monitor
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option