Page 1 of 1

2 states in 1 button

Posted: Sunday 31 October 2021 21:57
by darrepac
Hi,

I am just starting to jump into dashticz.
About power consumption button, in standard Domoticz UI you can see 2 information in 1 button: current power consumption and total energy consumed for the day:
2021-10-31 21_56_00-Domoticz.png
2021-10-31 21_56_00-Domoticz.png (5.78 KiB) Viewed 367 times

In dashticz, am I obliged to have 2 buttons or is there a way to also put the 2 information into one?

2021-10-31 21_55_38-magicmirrorpi - TightVNC Viewer.png
2021-10-31 21_55_38-magicmirrorpi - TightVNC Viewer.png (37.7 KiB) Viewed 367 times

Re: 2 states in 1 button

Posted: Monday 01 November 2021 20:46
by Lokonli
darrepac wrote: Sunday 31 October 2021 21:57 Hi,

I am just starting to jump into dashticz.
About power consumption button, in standard Domoticz UI you can see 2 information in 1 button: current power consumption and total energy consumed for the day:
2021-10-31 21_56_00-Domoticz.png


In dashticz, am I obliged to have 2 buttons or is there a way to also put the 2 information into one?


2021-10-31 21_55_38-magicmirrorpi - TightVNC Viewer.png
Yes, you can combine it. Assuming your device is a P1 smart meter, you can try the following block definition:

Code: Select all

blocks['customblock'] = {
  idx: '43_1',
  title:"Actual: <Usage>",
  value: "Today: <NettCounterToday> kWh",
  format:true,
  decimals: 1
}
Instead of 43 use the Domoticz device ID of your own device.

For as well the title field as the value field of a Domoticz block you can indicate to fill in the value of a Domoticz device parameter by using the '<' and '>' symbol.

For a smart meter device you can use the following device parameters:
Usage (=Actual power entering your house)
UsageDeliv (=Actual power leaving your house)
NettUsage (=Usage - UsageDeliv)

CounterToday (=Energy entered your house today)
CounterDelivToday (=Energy left your house today)
NettCounterToday (=CounterToday - CounterDelivToday)

Counter (=Total counter of energy that entered your house)
CounterDeliv (=Total counter of energy that left your house)
NettCounter (=Counter - CounterDeliv)

All parameter names are case sensitive.

For more fancy computations you can create your custom getStatus function in custom.js
See: https://dashticz.readthedocs.io/en/mast ... -idx-block

or: create a dial. See:https://dashticz.readthedocs.io/en/mast ... mart-meter

Re: 2 states in 1 button

Posted: Monday 01 November 2021 21:02
by darrepac
Wow sounds interestings! Many thanks!

Re: 2 states in 1 button

Posted: Monday 01 November 2021 21:32
by darrepac
Note: putting values in title is a nice hack but...you do not have any more the original title in your button. But a nice hack still...

For what concern Dial, I have some issues that I will put in the Dial thread.

Re: 2 states in 1 button

Posted: Monday 01 November 2021 22:10
by Lokonli
darrepac wrote:Note: putting values in title is a nice hack but...you do not have any more the original title in your button. But a nice hack still...

For what concern Dial, I have some issues that I will put in the Dial thread.
You can put any text in the title, including the Domoticz device Name field

Verstuurd vanaf mijn AC2003 met Tapatalk