I'm currently using Domatiga to read the values from my smart meter through the P1 gate. From the energy meter I get an update every 10 seconds about the current load. The gas meter does an update to the energy meter every hour. In Domotiga I only have the total usage since the meter was placed.
I wondered if it is possible to extract the last known total from the current total and doing so calculate the usage in the last hour. Is there a Value - OldValue type of calibration possible?
Calculating difference to old value
Moderator: RDNZL
-
- Starting Member
- Posts: 27
- Joined: Tue Dec 29, 2009 11:56 am
- Contact:
Calculating difference to old value
running Domoticz
Re: Calculating difference to old value
I have the exact same problem. I've been talking to Ron about it as well.. Best solution would be to make the RDD poller only poll every hour.. It's on his todo list AFAIK, but if you (or anyone else here) can come up with a working solution in the mean while I would be glad to hear it..pietervanharen wrote:I'm currently using Domatiga to read the values from my smart meter through the P1 gate. From the energy meter I get an update every 10 seconds about the current load. The gas meter does an update to the energy meter every hour. In Domotiga I only have the total usage since the meter was placed.
I wondered if it is possible to extract the last known total from the current total and doing so calculate the usage in the last hour. Is there a Value - OldValue type of calibration possible?
Kind Regards,
Greg.
Greg.
-
- Starting Member
- Posts: 27
- Joined: Tue Dec 29, 2009 11:56 am
- Contact:
Re: Calculating difference to old value
Would be great if this could be solved directly in DomotiGa. Since I don't use the RDD charts very much, but post all values to cosm (pachube) I can work around it for now by polling the datafeed with the gas total and comparing it with the most recent value that was less than the current and post the difference in an other datafeed. But it's wat we call in Dutch very "houtje touwtje"
running Domoticz
Re: Calculating difference to old value
Can you explain how you do this "houtje touwtje" trick? I would like to use it as well.. Tried cosm in it's pachube era once but did not fall in love right awaypietervanharen wrote:Would be great if this could be solved directly in DomotiGa. Since I don't use the RDD charts very much, but post all values to cosm (pachube) I can work around it for now by polling the datafeed with the gas total and comparing it with the most recent value that was less than the current and post the difference in an other datafeed. But it's wat we call in Dutch very "houtje touwtje"
Kind Regards,
Greg.
Greg.
Re: Calculating difference to old value
Would be great if we where able to calculate total usage of devices that we want, put it in domotiga database and ouput to json
Create a module whereby we can copy/past specific values on a specific time to the database. The database will be a collection of different value that we can create by our self.
example:
write value off P1 on 00:01 to database table "total usage" completed with date, time, value, deviceID
write value off P1 on 00:01, each next hour to database table "total usage" completed with date, time, value, deviceID
write value off DeviceID 43, 56, 23 ,46 on 00:01 to database table "living room" completed with date, time, value, deviceID
Create a module where we can do some mathematics on the created value's, so that we have calculations per hour, day, week, month, year. also put into a database table
json output. so that we can use these value's or calculation in cosm or other iot
power usage monday 24-12-2012 = 5 kWh
power usage tuesday 25-12-2012 = 4,3 kWh
Create a module whereby we can copy/past specific values on a specific time to the database. The database will be a collection of different value that we can create by our self.
example:
write value off P1 on 00:01 to database table "total usage" completed with date, time, value, deviceID
write value off P1 on 00:01, each next hour to database table "total usage" completed with date, time, value, deviceID
write value off DeviceID 43, 56, 23 ,46 on 00:01 to database table "living room" completed with date, time, value, deviceID
Create a module where we can do some mathematics on the created value's, so that we have calculations per hour, day, week, month, year. also put into a database table
json output. so that we can use these value's or calculation in cosm or other iot
power usage monday 24-12-2012 = 5 kWh
power usage tuesday 25-12-2012 = 4,3 kWh
-
- Starting Member
- Posts: 27
- Joined: Tue Dec 29, 2009 11:56 am
- Contact:
Re: Calculating difference to old value
I've made a trigger on each new value of the stream with the gas total. That trigger calls a php script that checks the most recent value of the gas value via json (api documentation) and compares is with the second most recent value. If the most recent value is the same or lower then the second most recent, I post a zero to the datastream which shows the gas usage per hour, otherwise I post the difference to the same datastream.sj3fk3 wrote:Can you explain how you do this "houtje touwtje" trick? I would like to use it as well.. Tried cosm in it's pachube era once but did not fall in love right away
After that I set the poll time of domotiga to cosm for the gas total to once an hour.
Please be ware of the time zones of your server and those of cosm. You can set a timezone in the call to the API.
running Domoticz