show managed counter in dashticz

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
jsmit
Posts: 28
Joined: Wednesday 02 November 2016 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version: v2020.2
Location: Nearby Hoorn NL
Contact:

show managed counter in dashticz

Post by jsmit »

Hi,

I have in domoticz an managed couter to show my total delivery of my sun panels.
But i don't no how to show this one in dashticz.
In dashticz it shows on (as an switch).

var p1_zonnepanelen_totaal = 441;

blocks[p1_zonnepanelen_totaal] = {}
blocks[p1_zonnepanelen_totaal]['title'] = 'Totaal';
blocks[p1_zonnepanelen_totaal]['width'] = 4;
blocks[p1_zonnepanelen_totaal]['unit'] = 'kWh'
blocks[p1_zonnepanelen_totaal]['icon'] = 'fas fa-sun';
blocks[p1_zonnepanelen_totaal]['last_update'] = false;

Can anyone point me in the rigth direction?

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

Re: show managed counter in dashticz

Post by Lokonli »

jsmit wrote: Monday 21 December 2020 12:20 Hi,

I have in domoticz an managed couter to show my total delivery of my sun panels.
But i don't no how to show this one in dashticz.
In dashticz it shows on (as an switch).

var p1_zonnepanelen_totaal = 441;

blocks[p1_zonnepanelen_totaal] = {}
blocks[p1_zonnepanelen_totaal]['title'] = 'Totaal';
blocks[p1_zonnepanelen_totaal]['width'] = 4;
blocks[p1_zonnepanelen_totaal]['unit'] = 'kWh'
blocks[p1_zonnepanelen_totaal]['icon'] = 'fas fa-sun';
blocks[p1_zonnepanelen_totaal]['last_update'] = false;

Can anyone point me in the rigth direction?

Jacco
How did you add this block to a column?
Any code in custom.js?

Can you post the output of:

Code: Select all

http://domoticz ip:port/json.htm?type=devices&rid=441
jsmit
Posts: 28
Joined: Wednesday 02 November 2016 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version: v2020.2
Location: Nearby Hoorn NL
Contact:

Re: show managed counter in dashticz

Post by jsmit »

Lokonli,

Thanks for your reply.

I didn't change anything in custom.js

//add custom javascript in here
function afterGetDevices(){

}

function getExtendedBlockTypes(blocktypes){
//blocktypes.Type['Lighting 2'] = { icon: 'fa fa-lightbulb-o', title: '<Name>', value: 'ds' }
return blocktypes;
}


Here is the output:
{
"ActTime" : 1608565734,
"AstrTwilightEnd" : "18:35",
"AstrTwilightStart" : "06:41",
"CivTwilightEnd" : "17:08",
"CivTwilightStart" : "08:08",
"DayLength" : "07:37",
"NautTwilightEnd" : "17:53",
"NautTwilightStart" : "07:23",
"ServerTime" : "2020-12-21 16:48:54",
"SunAtSouth" : "12:38",
"Sunrise" : "08:49",
"Sunset" : "16:27",
"app_version" : "2020.2 (build 12496)",
"result" :
[
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"Counter" : "3.829 kWh",
"CustomImage" : 0,
"Data" : "3.829 kWh",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 20,
"HardwareName" : "Zonnepanelen",
"HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
"HardwareTypeVal" : 15,
"HaveTimeout" : false,
"ID" : "82441",
"LastUpdate" : "2020-12-21 16:48:03",
"Name" : "Zonnepanelen totaal",
"Notifications" : "false",
"PlanID" : "5",
"PlanIDs" :
[
5
],
"Protected" : false,
"ShowNotifications" : false,
"SignalLevel" : "-",
"SubType" : "Managed Counter",
"SwitchTypeVal" : 4,
"Timers" : "false",
"Type" : "General",
"TypeImg" : "counter",
"Unit" : 1,
"Used" : 1,
"ValueQuantity" : "",
"ValueUnits" : "",
"XOffset" : "0",
"YOffset" : "0",
"idx" : "441"
}
],
"status" : "OK",
"title" : "Devices"
}
Lokonli
Posts: 2287
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: show managed counter in dashticz

Post by Lokonli »

You are the first one that is using a Managed Counter.

It's not supported yet by Dashticz: I will add it.
jsmit
Posts: 28
Joined: Wednesday 02 November 2016 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version: v2020.2
Location: Nearby Hoorn NL
Contact:

Re: show managed counter in dashticz

Post by jsmit »

Oke, that's why i can't found it.

I can change the title of the device when i change custom.js
function getStatus_441(block) {
var usage = block.device.Usage;
var device = block.device;
block.title = device['Data']
}
But i want to change the status ofcourse.

Thanks for adding.

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

Re: show managed counter in dashticz

Post by Lokonli »

jsmit wrote: Monday 21 December 2020 17:21 Oke, that's why i can't found it.

I can change the title of the device when i change custom.js
function getStatus_441(block) {
var usage = block.device.Usage;
var device = block.device;
block.title = device['Data']
}
But i want to change the status ofcourse.

Thanks for adding.

Jacco
Managed Counter added to latest beta.

Update with 'git pull'
jsmit
Posts: 28
Joined: Wednesday 02 November 2016 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version: v2020.2
Location: Nearby Hoorn NL
Contact:

Re: show managed counter in dashticz

Post by jsmit »

Lokonli,

Thanks for the quick update.
Works perfect.

Jacco
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest