Guys,
I have a tasmota feeding in multiple temperature values from DS18B20.
In order i am
Converting JSON to JS Object
Splitting into what i am interested in
Switching to retrieve the different values
Now - i want to feed the temperatures into a Smooth node - this node says that is only accepts numbers - BUT does that mean it will extract a number from the object given the path or can it only accept "simple" raw numbers (i.e. i need to split and switch again ?) i have a lot of these to do and the extra steps would make the flows a little ugly(ier) in the end.
I have attached what i have now (in test) - it seems happy to push the result through to the debug node - but it is pushing the whole object through so i am not sure if this is expected behaviour ? i.e. it is happy to take the temperature from within an object and return the smoothed value in the object ?
Can someone confirm if this is right and expected behaviour ?
[{"id":"70eca549.e2f10c","type":"mqtt in","z":"55f03afc.485ad4","name":"SENSOR","topic":"Fridge_Freezer_Monitor/Freezer/Temperature/SENSOR","qos":"0","datatype":"auto","broker":"fc085dcb.1ad05","x":140,"y":420,"wires":[["d6a7c36d.6f5fa"]]},{"id":"d6a7c36d.6f5fa","type":"json","z":"55f03afc.485ad4","name":"","property":"payload","action":"obj","pretty":false,"x":290,"y":420,"wires":[["38a1ed3e.9d0e22"]]},{"id":"38a1ed3e.9d0e22","type":"split","z":"55f03afc.485ad4","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":430,"y":420,"wires":[["fc22a824.4dc048"]]},{"id":"fc22a824.4dc048","type":"switch","z":"55f03afc.485ad4","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"DS18B20-1","vt":"str"},{"t":"eq","v":"DS18B20-2","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":420,"wires":[["28e9e2f3.b8d7de"],["adbb82d2.c38fe","fd98a4fe.67f848"]]},{"id":"adbb82d2.c38fe","type":"debug","z":"55f03afc.485ad4","name":"Fridge/Freezer Temperature","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload.Temperature","targetType":"msg","x":780,"y":480,"wires":[]},{"id":"28e9e2f3.b8d7de","type":"debug","z":"55f03afc.485ad4","name":"Freezer Temperature","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.Temperature","targetType":"msg","x":760,"y":400,"wires":[]},{"id":"fd98a4fe.67f848","type":"smooth","z":"55f03afc.485ad4","name":"Average Fridge temps","property":"payload.Temperature","action":"mean","count":"20","round":"1","mult":"single","x":760,"y":560,"wires":[["2ac99d17.29e522"]]},{"id":"2ac99d17.29e522","type":"debug","z":"55f03afc.485ad4","name":"Fridge/Freezer Temperature after Average","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1080,"y":560,"wires":[]},{"id":"fc085dcb.1ad05","type":"mqtt-broker","z":"","name":"MQTT-On-Dev","broker":"192.168.1.36","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Craig