Page 1 of 1
"Push-on Button" Domoticz shows "On/Off" in Dashticz
Posted: Monday 18 November 2019 16:29
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
Re: "Push-on Button" Domoticz shows "On/Off" in Dashticz
Posted: Monday 18 November 2019 19:08
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)
Re: "Push-on Button" Domoticz shows "On/Off" in Dashticz
Posted: Tuesday 19 November 2019 9:55
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.
Re: "Push-on Button" Domoticz shows "On/Off" in Dashticz
Posted: Tuesday 19 November 2019 14:12
by tarmacalastair
This screenshot (showing the last_update beneath the block) is a bit clearer:

- shorter-block-with-overspilling-lastupdate-2.png (14.85 KiB) Viewed 1014 times
Re: "Push-on Button" Domoticz shows "On/Off" in Dashticz
Posted: Tuesday 19 November 2019 16:28
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
}
Re: "Push-on Button" Domoticz shows "On/Off" in Dashticz
Posted: Tuesday 19 November 2019 16:45
by tarmacalastair
Wow, that's brilliant.
Thanks.