- Code: Select all
#! /usr/bin/env python
tedMeter = indigo.devices[1097796114]
tedTotalUsed = tedMeter.energyAccumTotal
indigo.variable.updateValue(587587693, value=str(tedTotalUsed))
However, now I also want to display the cost per day, also in Grafana. The problem is I need to read from my cost variable (also updated every 2 seconds), and the energy.AccumTotal only works on devices, not variables. I need to use my Indigo calculated cost variable, because it is derived from the usage * rate (I have several Indigo schedules to manage this), and the rate changes multiple times a day. Unfortunately TED doesn't natively support the complicated TOU plan I have with SDGE.
Hoping someone can point me in the right direction on how to query one variable and write it to another variable, but accumulation style, and then reset it at midnight. I'm guessing this would require a Python script, but not really sure the best way to do this. Or if there is a better way to do this, I am open.
Thanks,
Chris