assign variable for the data read from channel

2 views (last 30 days)
Hello every one, first of all sorry about my English. I'm doing a project on water consumption and billing system.I got data from flow sensor sent it to thingspeak channel and it worked correctly. I have some trouble in the billing part. I need to assign a variable for the read data by thingspeak channel from a start time to end time.Because water consumption is always calculated within a time period.And it has to be done periodically.I have set time control it worked correctly. But I don't know how to set start time and end time.I need my program to run automatically without setting a specific data and time.Ex: It should run everyday at a specific time(ex:9.00pm) so that i can get water consumption and bill for that day.To do that I need to sustract the water consumption used today from the total value of water used flow through the flow meter.Please help me with this.

Accepted Answer

Christopher Stapels
Christopher Stapels on 7 Nov 2019
If you have a time control set for a specific time, that should take care of the running at a specific time. You could probably read one day worth of entries at once for your calculation. If you want to read a specific date range, see the thingSpeakRead documentation and look up the daterange name value pair. If you show the code you have so far, or share some data from your channel, we may be able to help better.

More Answers (0)

Communities

More Answers in the  ThingSpeak Community

Categories

Find more on Prepare and Analyze Data in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!