diff --git a/config/rzl.js b/config/rzl.js index ba5dee6..cc016e9 100644 --- a/config/rzl.js +++ b/config/rzl.js @@ -118,6 +118,34 @@ const config : Config = { command: "/service/openhab/in/pca301_infoscreen/command", defaultValue: "OFF", values: { on: "ON", off: "OFF" } + }, + printer_3d_status: { + state: "/service/ultimaker/state", + command: "", + defaultValue: "unavailable", + values: {}, + parseState: msg => { + switch (msg.toString()) { + case "unreachable": + case "booting": + return "unavailable" + + case "pausing": + case "paused": + case "resuming": + case "wait_cleanup": + case "maintenance": + return "awaiting_interaction" + + case "pre_print": + case "post_print": + case "printing": + return "printing" + + default: + return msg.toString() + } + } } }, utils.esper_topics("afba40", "flyfry"), @@ -405,6 +433,26 @@ const config : Config = { } ] }, + printer_3d: { + name: "Ultimaker 3", + position: [754, 560], + icon: "printer-3d", + iconColor: ({printer_3d_status}) => + ({ + awaiting_interaction: "#b3b300", + printing: "#00ff00", + idle: "#000000", + unavailable: "#888888", + error: "#ff0000" + })[printer_3d_status], + ui: [ + { + type: "link", + link: "http://ultimaker.rzl/", + text: "Open Webinterface" + } + ] + }, partkeepr: { name: "Partkeepr", position: [48, 450],