[{"id":"1b2ba5cb.e7fb8a","type":"inject","z":"73849f4c.660bb","name":"","topic":"","payload":"get:nodes/2/","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":450,"y":620,"wires":[["ad61b563.b706c8"]]},{"id":"ad61b563.b706c8","type":"link out","z":"73849f4c.660bb","name":"","links":["796c3f24.140a4"],"x":575,"y":620,"wires":[]},{"id":"247ec31e.a9946c","type":"link in","z":"73849f4c.660bb","name":"","links":["bddb3e0.4cb36c"],"x":615,"y":620,"wires":[["874b1d1e.1c9bf"]]},{"id":"874b1d1e.1c9bf","type":"function","z":"73849f4c.660bb","name":"Hole Wert und Text + Icon","func":"var attribute = msg.payload.attribute;\nconst attributes = global.get('homee.attributes');\nvar Wert = attributes.filter(attribute => attribute.id === 32).map(a => a.current_value).reduce((a,c) => a+c);\n\nif (Wert >= 88) {\n var msg = {\"text\":\"Wassermelder Pumpe:\",\"background\":\"green\",\"icon\":\"green\",\"icon2\":\"fa fa-battery-full fa-3x\",\"wert\":Wert,\"unit\":\"%\"};\n return msg;\n}\nif (Wert >= 63 && Wert <= 87) {\n return {\"text\":\"Wassermelder Pumpe:\",\"background\":\"green\",\"icon\":\"green\",\"icon2\":\"fa fa-battery-three-quarters fa-3x\",\"wert\":Wert,\"unit\":\"%\"};\n}\nif (Wert >= 38 && Wert <= 62) {\n return {\"text\":\"Wassermelder Pumpe:\",\"background\":\"green\",\"icon\":\"green\",\"icon2\":\"fa fa-battery-half fa-3x\",\"wert\":Wert,\"unit\":\"%\"};\n}\nif (Wert >= 13 && Wert <= 37) {\n return {\"text\":\"Wassermelder Pumpe:\",\"background\":\"yellow\",\"icon\":\"yellow\",\"icon2\":\"fa fa-battery-quarter fa-3x\",\"wert\":Wert,\"unit\":\"%\"};\n}\nif (Wert <= 12) {\n return {\"text\":\"Wassermelder Pumpe:\",\"background\":\"red\",\"icon\":\"red\",\"icon2\":\"fa fa-battery-empty fa-3x\",\"wert\":Wert,\"unit\":\"%\",};\n}\n","outputs":1,"noerr":0,"x":770,"y":620,"wires":[["2de4294a.c85336"]]},{"id":"2de4294a.c85336","type":"ui_template","z":"73849f4c.660bb","group":"7475c23f.49476c","name":"Wassermelder Pumpe","order":2,"width":"8","height":3,"format":"<md-button \nclass=\"md-raised\" \nstyle=\"background: none\"> \n<div\nstyle=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i \nclass=\"{{msg.icon2}}\" \nstyle=\"color:{{msg.icon}}\">\n</i> \n</div>\n <div md-colors=\"{background: black}\">\n <div md-colors=\"{color: white\">\n <span>{{msg.text}}</span>\n </div>\n</div>\n <div md-colors=\"{background: black}\">\n <div md-colors=\"{color: white\">\n <span>{{msg.wert}}</span>\n <span>{{msg.unit}}</span>\n </div>\n</div>\n<p align=\"left\">\n </p> \n </md-button>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1060,"y":620,"wires":[[]]}]
@alphabravocharly Hier sind die Nodes für die Batterieanzeige. Eintscheiden sind für die der Function-Node und der Dashboard Template-Node. Im Function-Node wird bei mir der Wert vom homee geholt und in die Variable „Wert“ in % geschrieben. Hier muss du einfach deine Quelle wählen. Der Template macht dann halt die Darstellung.