Advice on delays and processing

hi. I've got node red running monitoring my TV power to an Influx database. thats working fine, but i wanted to take it a step further. My TV keeps being left on but turned off (as in skys off but tv still powered up). I want to check a value periodically and if its been below a certain threshold for 10 minutes then turn the power to the TV off.

{"TotalStartTime":"2018-11-10T23:29:04","Total":694.259,"Yesterday":0,"Today":0.896,"Period":12,"Power":112,"ApparentPower":154,"ReactivePower":106,"Factor":0.73,"Voltage":253,"Current":0.609}

Can you help recommend the best way for me to capture the Power value, and periodically check to make sure its below that? Should i be using a function or other type?

thanks

Andrew

The first thing I'd suggest is use a change node to extract the power value from your JSON

Ah yeah, i have that bit down. I just copied the line that outputs to influx DB but i intend to get the solo variable value. its the next bit :slight_smile:

I've achieved what i wanted in a slightly different way. I queried the InfluxDB for the max power over the last 15 minutes and if it was less than my threshold to set a Payload to OFF and send it to my MQTT Broker.

msg.query="SELECT max(Power) AS MaxPower FROM PowerMonitoring.autogen.SonoffPOW1 WHERE time > now() - 15m";
return msg;
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.