Even after all 3 inputs have reported? You’ll get NaN before the 3rd but then they are all saved and you shouldn’t see it again.
I know you’d rather have just 1 report every 3s and I can add that if you want. I preferred it the way it is because I refreshed the sensor that needed a higher reporting rate and left the other alone because it reports “responsibly”.
That’s easy enough to add to what I sent you and I can do it as well.
1 or 3 is not really a big deal, they get filtered buy the batch. The only reason it’s an issue is the VD will only take 1 set command per second, so it takes the first which is not the average. I use the batch/switch to filter out the other. No biggie, not like I personally sit here and it (once finish that is lol)
yep. I get 6 debug logs every time I click it and they say (can’t get them all but they all say NaN)
yeah IDK what is wrong between the example that work and the actually one that gives NaN. All I can think of is it not see the deviceId correct so it is not setting the variably. Again coding is not my wheel house so this is just a guess. Your example works fine.
I’ve lost a ton of skills by not doing any programming for 11 years (some would say I never had them to lose ) but I’ve always been tenacious and I love to give back to folks like you who contribute SO much.
Ha, I tried this a few months ago and abandoned it because it felt wonky. My approach was to monitor the Hubitat Event Socket for temperature updates to the device I want to average and then pass the msg through the Hubitat nodes for those devices, forcing each to output their value. Then average them.
It worked, but i ended up sticking the the Average Apps in Hubitat.
As I mentioned previously, my function code could/should be a good starting point to do it all in a single node. It’ll take a fair amount of logic additions to git 'er done and I have more pressing things to attend to for the foreseeable future. Maybe someone faster than me with JS code will jump in.