"Push-on Button" Domoticz shows "On/Off" in Dashticz

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
tarmacalastair
Posts: 95
Joined: Wednesday 30 October 2019 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Great Britain
Contact:

"Push-on Button" Domoticz shows "On/Off" in Dashticz

Post by tarmacalastair »

Hi,

I've created a couple of switches in Domoticz to restart a PC or service by running a bash script. For this type of scenario, once you've clicked the button the script is executed and "On" or "Off" are not appropriate.

When I first created these I used an On/Off switch until I realised that there is a Push-On Button option in Domoticz which does not display On or Off on the dashboard. Unfortunately when I create a block in Dashticz to show this button, Dashticz shows the status as On or Off. (I've tried creating switches with sliders and dimmers and they seem to be OK in Dashticz.)

To get around this I thought I could just hide the state of the block but looking at the block parameters there seems to be:
  • hide_data True or false
  • last_update True or false
but nothing to hide the state. I would like to see the last update time but not the state of the switch. It seems that hide_data hides everything and then setting last_update to true has no effect.

Is this possible to do somehow?

Thanks
Attachments
Domoticz push-switch.png
Domoticz push-switch.png (13.34 KiB) Viewed 1044 times
Dashticz push-switch.png
Dashticz push-switch.png (8.35 KiB) Viewed 1044 times
Running Domoticz and Dashticz beta on Raspberry Pi OS 32 bit - has anyone had success with 64 bit?

Desktop access from Ubuntu Linux
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: "Push-on Button" Domoticz shows "On/Off" in Dashticz

Post by Lokonli »

tarmacalastair wrote: Monday 18 November 2019 16:29 Hi,

I've created a couple of switches in Domoticz to restart a PC or service by running a bash script. For this type of scenario, once you've clicked the button the script is executed and "On" or "Off" are not appropriate.

When I first created these I used an On/Off switch until I realised that there is a Push-On Button option in Domoticz which does not display On or Off on the dashboard. Unfortunately when I create a block in Dashticz to show this button, Dashticz shows the status as On or Off. (I've tried creating switches with sliders and dimmers and they seem to be OK in Dashticz.)

To get around this I thought I could just hide the state of the block but looking at the block parameters there seems to be:
  • hide_data True or false
  • last_update True or false
but nothing to hide the state. I would like to see the last update time but not the state of the switch. It seems that hide_data hides everything and then setting last_update to true has no effect.

Is this possible to do somehow?

Thanks
Indeed hide_data will also hide last update.

What you can do is show the last update info (set hide_data to false and last_update to true), and then hide the data via CSS. Add the following to custom/custom.css:

Code: Select all

.block_107 .state {
    display: none
}
(Replace 107 with your Domoticz device id)
tarmacalastair
Posts: 95
Joined: Wednesday 30 October 2019 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Great Britain
Contact:

Re: "Push-on Button" Domoticz shows "On/Off" in Dashticz

Post by tarmacalastair »

Thanks, that's great for hiding the state. Unfortunately though, it leaves a blank line where the state would have been. This means that if I try to reduce the height of the block via custom.css:

Code: Select all

.block_107 {
height: 40px !important;                /* default height=75px */
}
then the last_update field spills over below the block (and the icon hangs below the block border).

Any suggestions for this please so that I can see the last_update field where the state would have been? I can then play around with the padding-top css setting to get everything to fit.

Is it worth considering a hide_state parameter for a future release or would that idea still leave a blank line?

Thanks again.
Attachments
shorter-block-with-overspilling-lastupdate.png
shorter-block-with-overspilling-lastupdate.png (8.09 KiB) Viewed 1018 times
block-with-state-removed.png
block-with-state-removed.png (8.27 KiB) Viewed 1018 times
Running Domoticz and Dashticz beta on Raspberry Pi OS 32 bit - has anyone had success with 64 bit?

Desktop access from Ubuntu Linux
tarmacalastair
Posts: 95
Joined: Wednesday 30 October 2019 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Great Britain
Contact:

Re: "Push-on Button" Domoticz shows "On/Off" in Dashticz

Post by tarmacalastair »

This screenshot (showing the last_update beneath the block) is a bit clearer:
shorter-block-with-overspilling-lastupdate-2.png
shorter-block-with-overspilling-lastupdate-2.png (14.85 KiB) Viewed 1009 times
Running Domoticz and Dashticz beta on Raspberry Pi OS 32 bit - has anyone had success with 64 bit?

Desktop access from Ubuntu Linux
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: "Push-on Button" Domoticz shows "On/Off" in Dashticz

Post by Lokonli »

tarmacalastair wrote: Tuesday 19 November 2019 9:55 Thanks, that's great for hiding the state. Unfortunately though, it leaves a blank line where the state would have been. This means that if I try to reduce the height of the block via custom.css:

Code: Select all

.block_107 {
height: 40px !important;                /* default height=75px */
}
then the last_update field spills over below the block (and the icon hangs below the block border).

Any suggestions for this please so that I can see the last_update field where the state would have been? I can then play around with the padding-top css setting to get everything to fit.

Is it worth considering a hide_state parameter for a future release or would that idea still leave a blank line?

Thanks again.
The hide_state parameter would be a good idea. In fact the consistency for all Domoticz blocks can be improved, but I'm a bit afraid for changing the code. It's not very structured at the moment.

IN the mean time, you can remove the empty line by adding the following to custom/custom.css:

Code: Select all

.block_107 br:nth-child(2) {
    display: none
}
tarmacalastair
Posts: 95
Joined: Wednesday 30 October 2019 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Great Britain
Contact:

Re: "Push-on Button" Domoticz shows "On/Off" in Dashticz

Post by tarmacalastair »

Wow, that's brilliant.
Thanks.
Running Domoticz and Dashticz beta on Raspberry Pi OS 32 bit - has anyone had success with 64 bit?

Desktop access from Ubuntu Linux
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest