Page 1 of 1

buttons with dial type

Posted: Monday 01 February 2021 23:27
by pvklink
Can buttons have a dial type ?

Re: buttons with dial type

Posted: Tuesday 02 February 2021 8:19
by Lokonli
No, but dials can have button functionality :)

Most blocks are clickable. You can add the 'popup' or 'url' parameter. newwindow and auto_close are recognized as well.

Sometimes the result might be unpredictable, for instance for dials that already contain click functionality, like an on/off-dial, or thermostat.

Currently it's not possible to include a custom image in a dial.
Only for on/off dials you can customize the icon via a block parameter.

Re: buttons with dial type

Posted: Tuesday 02 February 2021 8:24
by pvklink
Ok, i will try that!
A thing that dont work withdial is textOn / Off

blocks[1749] = {title: 'Motion files aanwezig', type: 'dial', textOn: 'aaa', textOff: 'bbbb', width: 4, icon: '', hide_data: false, switch: true} //icon: 'fas fa-hdd' hide_data: true, switch: true,

Re: buttons with dial type

Posted: Tuesday 02 February 2021 8:40
by Lokonli
Most functionality implemented for Domoticz device blocks will not work on dials.

My plan is to change this in a future update. I'll move to a generic architecture:

1) Data collection (select data from 1 or more devices)
2) Data transformation (calculations, decimals, units)
3) Presentation (as a dial, traditional block)
4) Dynamics (click behavior, popupOn/Off, speakOn/Off, url, popup)

So, in principle it should be possible to represent a RGB dimmer as dial, including a button to show the colorpicker popup window.
or combine the information from two devices into one Domoticz block.

Re: buttons with dial type

Posted: Tuesday 02 February 2021 13:06
by pvklink
Can't wait :-)

Re: buttons with dial type

Posted: Wednesday 03 February 2021 9:54
by pvklink
I tried to convert a button to a block

old button
// buttons.webcams = {key:'divcams', width:4, icon: 'fas fa-video', title:'Cam', slide:2}

blocks['but_page2'] = {title: 'Cam', type: 'dial', width: 4, gotoslide: 2}
columns[1] = {blocks: ['but_page2'], width: 3}

I dont get a DIAL button...

when i add a url
blocks['but_page2'] = {title: 'Cam', type: 'dial', width: 4, url: 'https://racingnews365.nl',height: 400}
i do have a working button, bu no dial

So two questions
1. how to make a DIAL type button for page 2
2. how to make a DIAL type button for page https://racingnews365.nl'

Re: buttons with dial type

Posted: Wednesday 03 February 2021 12:08
by Lokonli
pvklink wrote: Wednesday 03 February 2021 9:54 I tried to convert a button to a block

old button
// buttons.webcams = {key:'divcams', width:4, icon: 'fas fa-video', title:'Cam', slide:2}

blocks['but_page2'] = {title: 'Cam', type: 'dial', width: 4, gotoslide: 2}
columns[1] = {blocks: ['but_page2'], width: 3}

I dont get a DIAL button...

when i add a url
blocks['but_page2'] = {title: 'Cam', type: 'dial', width: 4, url: 'https://racingnews365.nl',height: 400}
i do have a working button, bu no dial

So two questions
1. how to make a DIAL type button for page 2
2. how to make a DIAL type button for page https://racingnews365.nl'
Currently dials only work in combination with a Domoticz device.

You could create a dummy scene in Domoticz, and show that as an on/off dial in Dashticz.
Then you can add the 'slide' or 'url' block parameter.

If needed you can change the icon in the on/off dial as well. (no image support)

Re: buttons with dial type

Posted: Wednesday 03 February 2021 12:33
by pvklink
ok! I add a dummy device...
Would be a great feature if you can add dial blocks that dont have an idx.
By adding a dummy device subtype (switch on/off) to the block you should get the same DIAL functionality as with an idx...

To handle functionality via blocks is easy to understand.
A logical name which can have an idx as a property is for me fully logic.
Not the domoticz device as a central point, but a dashticz object that can link to a domoticz device..
The dashticz object name is then also the key to define (css) styles to it...

Re: buttons with dial type

Posted: Wednesday 03 February 2021 13:40
by Lokonli
I agree :)

Re: buttons with dial type

Posted: Wednesday 03 February 2021 13:50
by pvklink
Ok, i made dummy domoticz devices with a dashtics dial type
buttons.jpg
buttons.jpg (77.19 KiB) Viewed 825 times
See my radio and racing news button.
I had two options
1. A domoticz push on type
2. A domoticz switch (on/off)

Ad1. When i choose this type is goes off after pushing, but i also get data in the button and a needle in the ring that i dont need,
Question: can i set these off?

Ad2. (I choose for this option) i get the dial as included in the attachment. I dont want te dial to turn on or off.
Question: Is it possibe to set the on colors the same as the off ?
i now use:
.dt_content .dial {background-color: rgb(119,110,97) }

Can i use the DIAL option also for the log block? because this has no IDX see my attachment ?
If this isnt an option, i will the call the log with the dummy device option (via a http call to domoticz/#/log)

Re: buttons with dial type

Posted: Wednesday 03 February 2021 18:07
by Lokonli
Try a domoticz scene. add:

idx: 's123'

with 123 the domoticz scene number. The scene will stay on.

I see there is a bug: the dial should stay in the 'on' state, but it switches to off. I'll fix that.

For the log, try:

Code: Select all

   blocks['logdial'] = {
       idx: 's123',   //your dummy scene
      type: 'dial',
      popup: 'log'
}

Re: buttons with dial type

Posted: Wednesday 03 February 2021 19:37
by pvklink
log is working !

Re: buttons with dial type

Posted: Wednesday 03 February 2021 19:58
by pvklink
Last item, then i can close the 'dossier' dial for my buttons (and indeed the on-state with s123 does not work as you said...

In my current dashboard it is not visble enough to see if a dial device is on, so there a multiple solutions:

a) by color (preferred)
i can define the outer ring by
.dt_content .dial {background-color: rgb(119,110,97) } /* rgb(119,110,97) dit is buitenring niet de aan/uit ring */

QUESTION:
How do i define the second ring color from a dial type for 1 device that is changed by on/off ? I searched the documentation, but cant find it

b by text
QUESTION:
Another thing is how to change the title or data when a DIAL is on or off
i tried two options and both dont work

a) TextOn blocks[1749] = {title: 'Motion files aanwezig', type: 'dial', TextOn: 'aaa', TextOff: 'bbbb', width: 3}
b) script
function getStatus_1749(idx,value,device)
{if (device.Data == "On") {blocks[1749]['title'] = "XXX"}
else {blocks[1474]['title'] = "YYYY"}}

Current dashboard with dials (en more dials to go)
Naamloos2.jpg
Naamloos2.jpg (185.76 KiB) Viewed 769 times

Re: buttons with dial type

Posted: Friday 05 February 2021 21:13
by pvklink
santest.jpg
santest.jpg (23.75 KiB) Viewed 756 times