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.
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";