Page 1 of 1

P1 dial with actual value, needle going into reverse

Posted: Sunday 11 December 2022 19:56
by willemd
I created two Dashticz dials for my P1 meter, one for the actual nettusage and one for today's nettusage.

After a lot of trial and error I managed to get also the actual value dial working, however, when the value is positive (for example usage without delivery) the needle goes to the right into green instead of left into red.

The default P1 dial shows today's values and in that one, if usage is higher than delivery, the nettusage is negative and goes to the left into red, so the exact opposite direction.

I would like to make behaviour of these dials consistent. I tried scale -1, I tried multiplying the nettusage, reversing the min/max, but nothing works.

Is this possible? How?

A sidenote: if I shows units for the main value in the actual dial is always comes up as KWh, whereas it should be Watt.

Here is my block definition:

Code: Select all

blocks['1_actual'] = {
    idx: 1,
    title:'P1 actual',
    type: 'dial',
    values: [
        {
        label: 'Actual',
        value: 'NettUsage',
        isNeedle: true,
        scale:  -1,
        unit: 'Watt',
        showunit: true
        }
    ],
    min: -3000,
    max: 3000,
    unit: 'Watt',
    showring: true,
    showunit: false,
    shownumber: true,
    width:6
}

blocks['1_today'] = {
    idx: 1,
    title:'P1 today',
    type: 'dial',
    min: -10,
    max: 10,
    showring: true,
    showunit: true,
    shownumber: true,
    width: 6
}


Re: P1 dial with actual value, needle going into reverse

Posted: Sunday 11 December 2022 22:05
by Lokonli
This is a bug:
scale doesn't work on computed device fields like NettUsage.
I'll make a fix for this.

If you can't wait, you can change NettUsage calculation via the deviceHook function.
See https://dashticz.readthedocs.io/en/beta ... evice-hook

Re: P1 dial with actual value, needle going into reverse

Posted: Monday 12 December 2022 8:59
by willemd
O.K. thanks, I'll wait.

I also suggest to look at:
* override of unit of measurement for main value (currently always displays KWh for P1 and KWH dials, even if actuals Watts is displayed)
* display of NettUsage vs. NettCounterToday in dial (if they were the same sign then scaling would not be needed)

Re: P1 dial with actual value, needle going into reverse

Posted: Saturday 17 December 2022 15:49
by Lokonli
In latest version (3.9.7.1) scale: -1 should now also work for computed fields like NettUsage.

Re: P1 dial with actual value, needle going into reverse

Posted: Saturday 17 December 2022 18:55
by willemd
Wow, that's fast. Thanks.

If I followed the automatic install instructions, how do I upgrade to latest beta?
Make a backup of CONFIG.js and then run the install script again?

Re: P1 dial with actual value, needle going into reverse

Posted: Saturday 17 December 2022 20:06
by Lokonli
Just type the following in the Dashticz folder:

Code: Select all

git pull
If you come from the master version type the following first:

Code: Select all

git checkout beta