Page 1 of 1

How to reset a Utility Widget ?

Posted: Wednesday 06 October 2021 10:20
by pipiche
I have a Electricity counter and I would like to reset all the history. How can I do that ?

Re: How to reset a Utility Widget ?

Posted: Wednesday 06 October 2021 10:28
by waltervl
I don't think there is an API call for this.
Delete the device and make a new one?
Else you would have to manipulate the SQLite database and delete the idx related entries in meter_calendar table.

Re: How to reset a Utility Widget ?

Posted: Wednesday 06 October 2021 11:17
by pipiche
Thanks @waltervl, I was more looking to an API or even to do it straight from the User Interface, as we can do for other logs.
Removing the device is not a possibility as this is created by a plugin.

Is COMPUTE Usage (meter) is supported on Python Framework Plugin

Posted: Wednesday 06 October 2021 17:08
by pipiche
In fact I'll describe more my problem an may be someone can help me. Any thing I'm doing Wrong ?

I'm using the Electricity (instant and counter) via a Python Framework Plugin. As I don't have any data for Usage, I'm updating the device with the instant power and putting 0 for the usage

basically when updating via the plugin

Code: Select all

nValue=0 and sValue="power;0" 

power is usually expressed in a float type

My main issue is that the Usage remains to 0

Here after are the log. We see the Instant Power, but nothing happen for the Usage !
Screenshot 2021-10-06 at 17.06.47.png
Screenshot 2021-10-06 at 17.06.47.png (265.95 KiB) Viewed 622 times
I've checked the device and it is defined as COMPUTE as you can see in the hereafter screenshoot
Screenshot 2021-10-06 at 17.07.57.png
Screenshot 2021-10-06 at 17.07.57.png (119.32 KiB) Viewed 622 times

Re: How to reset a Utility Widget ?

Posted: Thursday 07 October 2021 17:09
by waltervl
This could be a python plugin framework issue not updating the device the same way as an http API call would do. What happens if you use an http API call instead to test?

Re: How to reset a Utility Widget ?

Posted: Thursday 07 October 2021 18:18
by pipiche
API call indeed works. Thanks @waltervl