P1 dial with actual value, needle going into reverse

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
willemd
Posts: 649
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

P1 dial with actual value, needle going into reverse

Post 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
}

Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
willemd
Posts: 649
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

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

Post 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)
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Lokonli »

In latest version (3.9.7.1) scale: -1 should now also work for computed fields like NettUsage.
willemd
Posts: 649
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

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

Post 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?
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest