Hello. I have 20 DS18B20 temperature sensors connected to my Pi.
Every minute the values will be refreshed. Sometimes the value from any sensor does not show the right temperature e.g. 20°C. but 85°C.
For this wrong value I have a switch. All values under 82°C are OK. If the value is other for more than 5 seconds, then there is a message with sensor FAIL.
What I miss: If the sensor is broken and does not continue to send a plausible value, a message should also appear: SensorFAIL. For this, a permanent update of the sensor value would have to be queried. How can I do that?
The temperature sensors are for a battery pack. It is necessary to check the values permanently
and reliable for a safety battery. This is the background for he permanent sensor check.
Here my nodes from one sensor:
[{"id":"e958ebcc85e2d1a6","type":"trigger","z":"c3f1bf5d5aa9131b","name":"","op1":"","op2":"SensorOK","op1type":"nul","op2type":"str","duration":"2","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":760,"y":1940,"wires":[["f8498cbdc4c54a46","2a92649be426b61d"]]},{"id":"2a92649be426b61d","type":"debug","z":"c3f1bf5d5aa9131b","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1010,"y":1900,"wires":[]},{"id":"f8498cbdc4c54a46","type":"trigger","z":"c3f1bf5d5aa9131b","name":"","op1":"","op2":"SensorFAIL","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"SensorOK","bytopic":"all","topic":"topic","outputs":1,"x":800,"y":1880,"wires":[["2a92649be426b61d"]]},{"id":"8ae24cb28683d449","type":"inject","z":"c3f1bf5d5aa9131b","name":"","props":[{"p":"payload"},{"p":"topic","v":"","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":130,"y":1860,"wires":[["c265575fae74d697"]]},{"id":"9159e0cfa6187611","type":"inject","z":"c3f1bf5d5aa9131b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"2","crontab":"","once":true,"onceDelay":"0.1","topic":"","payload":"","payloadType":"date","x":130,"y":1720,"wires":[["9f36c32e060f88df"]]},{"id":"3cd72f99b8d4cb4b","type":"change","z":"c3f1bf5d5aa9131b","name":"Welche Zelle & Wert","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"ZelleTemp1:\"& payload","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":1720,"wires":[["c66ab942bc80c938"]]},{"id":"c265575fae74d697","type":"switch","z":"c3f1bf5d5aa9131b","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"82","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":1720,"wires":[["3cd72f99b8d4cb4b"],["f8498cbdc4c54a46","e958ebcc85e2d1a6"]]},{"id":"b3153aa2f0dda4e4","type":"debug","z":"c3f1bf5d5aa9131b","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":490,"y":1660,"wires":[]},{"id":"c66ab942bc80c938","type":"debug","z":"c3f1bf5d5aa9131b","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1030,"y":1720,"wires":[]},{"id":"9f36c32e060f88df","type":"sensor-ds18b20","z":"c3f1bf5d5aa9131b","d":true,"name":"","topic":"","sensorid":"28-1217b20164ff","timer":"1","repeat":false,"x":330,"y":1720,"wires":[["c265575fae74d697","b3153aa2f0dda4e4"]]},{"id":"9f8e39bdf7494ad3","type":"inject","z":"c3f1bf5d5aa9131b","name":"","props":[{"p":"payload"},{"p":"topic","v":"","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"85","payloadType":"num","x":130,"y":1820,"wires":[["c265575fae74d697"]]},{"id":"21d0eefe2af1069c","type":"comment","z":"c3f1bf5d5aa9131b","name":"Real sensor value","info":"","x":510,"y":1620,"wires":[]},{"id":"8cc5f724a493eb8b","type":"comment","z":"c3f1bf5d5aa9131b","name":"If sensor value more than 5 seconds fail","info":"","x":890,"y":1840,"wires":[]},{"id":"e8eba61633ea14fc","type":"comment","z":"c3f1bf5d5aa9131b","name":"Value up to 80°C","info":"","x":860,"y":1680,"wires":[]},{"id":"36df3c7e318d59d7","type":"comment","z":"c3f1bf5d5aa9131b","name":"Test: Click, click, click.....","info":"","x":150,"y":1780,"wires":[]}]
flows (18).json (3.5 KB)
Thanks for help.