This is a question of how to properly construct an InfluxDB query which is out of scope of NR. If there are no experts here I will submit to the InfluxDB forum instead. I generally find this forum awesome and figured I'd try here first.
I have a weather station (Acurite 5in1) sending data wirelessly to a RPi with USB SDR attached. That RPi uses rtl_433 to decode the radio traffic and send the raw data via MQTT. I use NR to convert the raw sensor values to usable data and store that in InfluxDB v1.8. All of that seems to be working as expected without issue.
Next, I want to submit a selection of the weather data to pwsweather.com so I can utilize my local rain data for a smart sprinkler. I have a flow that does what I need to parse the data and build the URL which gets submitted to PWS at 10 minute intervals. I have confirmed with PWS that they are seeing the incoming data but there is no rain info other than "rainin=0" for every submission. I just found that the reason appears to be a bad query, but I don't know why.
Influxdb rain incremental data:
select * from "rtl_433/Acurite-5n1/A/rain_increment_in" ORDER BY time DESC LIMIT 10 name: rtl_433/Acurite-5n1/A/rain_increment_in time value ---- ----- 2021-08-17T09:29:00.735789174Z 0.00999999999999801 2021-08-17T07:57:48.778641909Z 0.00999999999999801 2021-08-08T11:25:35.380248655Z 0.010000000000005116 2021-08-08T11:18:59.57464481Z 0.00999999999999801 2021-08-08T11:09:23.431049542Z 0.00999999999999801 2021-08-08T10:47:47.354700108Z 0.010000000000005116 2021-08-08T09:01:35.735475143Z 0.00999999999999801 2021-08-07T14:35:45.499019773Z 0.00999999999999801 2021-08-07T14:22:33.327031983Z 0.00999999999999801 2021-08-07T14:14:45.155771589Z 0.010000000000005116
You can see there are 2 rain events this morning at 9:29Z and 7:57Z. And my query in the flow is:
select sum(*) from "rtl_433/Acurite-5n1/A/rain_increment_in" GROUP BY time(10m) ORDER BY time DESC LIMIT 1
But this doesn't seem to return anything. Since there hasn't been rain since 2am, I'm modifying the query to get some data.
select sum(*) from "rtl_433/Acurite-5n1/A/rain_increment_in" GROUP BY time(10m) ORDER BY time DESC LIMIT 1 name: rtl_433/Acurite-5n1/A/rain_increment_in time sum_value ---- --------- 2021-08-17T16:10:00Z
select sum(*) from "rtl_433/Acurite-5n1/A/rain_increment_in" GROUP BY time(14h) ORDER BY time DESC LIMIT 1 name: rtl_433/Acurite-5n1/A/rain_increment_in time sum_value ---- --------- 2021-08-17T06:00:00Z 0.01999999999999602
Anything less than 14h returns no data. But, it supposedly rained at 2:29am local time, so I don't know why it's not returning data when I ask for less than 14h? It should return data if I use 8 hours since 2:29am to 9:17am is around 7 hours.
Any suggestions? If this is too detailed in the InfluxDB world I'll understand and try asking over there. Thanks in advance!