Dashticz: show current power kWh?

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
renerene
Posts: 316
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Dashticz: show current power kWh?

Post by renerene »

How to create a large text fiels showing current power consumption / delivery?

Two problems, one nicetohave:
1) code below show 8 devices, I'm only interested in the first one (current/actual)

Code: Select all

blocks['kWh'] = {
  idx: 427,                   //The Domoticz device id
  title: 'kWh',       //The title of the block as shown in the dial.
  width: 6,                   //The width of the block relative to the column width
}

2) making the font bigger in CSS does not adjust the background, the big font floats over the small background rectangle
custom.css:

Code: Select all

.block_kWh {
   font-size:120px !important;
}
3) an alarm clock font would be nice
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz: show current power kWh?

Post by EdwinK »

Try with idx: '427_1' to get only the first device.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
renerene
Posts: 316
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Dashticz: show current power kWh?

Post by renerene »

EdwinK wrote: Monday 05 February 2024 14:27 Try with idx: '427_1' to get only the first device.
No, that does not work. Here is the result:
Image
User avatar
HansieNL
Posts: 957
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz: show current power kWh?

Post by HansieNL »

Can you post your blockcode. Did you exactly use the idx: '427_1' ?
Blah blah blah
renerene
Posts: 316
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Dashticz: show current power kWh?

Post by renerene »

HansieNL wrote: Monday 05 February 2024 19:08 Can you post your blockcode. Did you exactly use the idx: '427_1' ?
this was my code;

Code: Select all

blocks['kWh'] = {
  idx: 427_1,                   //The Domoticz device id
  title: 'kWh',       //The title of the block as shown in the dial.
  width: 6,                   //The width of the block relative to the column width
}
but after changing to code below, it works. Thanks!

Code: Select all

blocks['kWh'] = {
  idx: '427_1',                   //The Domoticz device id
  title: 'kWh',       //The title of the block as shown in the dial.
  width: 6,                   //The width of the block relative to the column width
}
Image

only issue left is ugly layout. Text is placed to low, background rectangle does not resize with font size
Lokonli
Posts: 2260
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz: show current power kWh?

Post by Lokonli »

By default the height of each Domoticz device block is fixed at a certain value (85 pixels to be precise)

You can make the height adjust to the content by using the following in custom.css:

Code: Select all

 .block_kWh {
    font-size: 120px;
    height: unset!important
 }
renerene
Posts: 316
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Dashticz: show current power kWh?

Post by renerene »

You can make the height adjust to the content by using the following in custom.css:
thanks!

Got it working now:

Code: Select all

.block_kWh {
   font-size:80px !important;
   height: unset!important
 }
}

Code: Select all

blocks['kWh'] = {
  idx: '427_1',                   //The Domoticz device id
  title: 'kWh',       //The title of the block as shown in the dial.
  width: 6,                   //The width of the block relative to the column width
  hide_title: true,
  unit: ' Watt',
}
Image
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests