Page 1 of 1
function getBlock_233(device,idx)
Posted: Saturday 15 July 2017 20:51
by mhodom
Hello everybody,
Is there a way to define a selector, i have a dummy device(heater) with 5 levels, i saw the possibility to switch:
$('.block_'+idx).attr('onclick','switchDevice(this)');
but how to keep my selector using the function getBlock()
or how to have to icons (on,off) without getblock();
Thank you very much for your participation and your help
Script to change the RPI Touch Screen brightness
Posted: Sunday 30 July 2017 19:19
by Kolkos
Recently I've purchased a secondary (actually my third) Raspberry with the official Raspberry Touch Screen. On this RPI I've installed a simple LAMP server and installed Dashticz.
Let me start with saying 'Kudo's for this interface mate!'
One thing that bothers me with the Touch Screen is the brightness, by default it is far to bright and without an keyboard is pretty hard to change the brightness.
I couldn't find a way to change the brightness from within Dashticz, so I decided to write my own script.
Basically what I've done is to add a Dummy Dimmer to Domoticz and use the value of this Dimmer to change the brightness of the Touch Screen with this value. Therefore I needed a script to 'listen' to Domoticz. After that I could add this Dimmer to Dashticz.
An detailed instruction on how to install and use the script can be found here:
https://github.com/kolkos/rpi_backlight
Please let me know if I missed something or if you experiencing any problems.
Cheers!
- Anton
Re: Script to change the RPI Touch Screen brightness
Posted: Sunday 30 July 2017 20:44
by robgeerts
Thanks for the compliments and thanks for sharing!
Although this has nothing to do with Dashticz, it may help others using the Raspberry Touch Screen.
Re: Script to change the RPI Touch Screen brightness
Posted: Sunday 30 July 2017 22:19
by Blueone
It canalso be done with dashticz, I wrote an how-to in the wiki a couple of months ago.
Re: Dashticz - Custom scripts
Posted: Wednesday 12 December 2018 22:46
by dre68
Annyone out there who can help me out creating a custom block from a selector switch?
I have a selector which displays the current scene. I'd like to have a block based on that selector which shows a title like 'active scene' and the name of the current active scene (which is the decoded name of the selected value).
I don't want to see the current value as a selector, just plain text.
btw just started with Dasticz and already hooked, excellent configurable dashboard Rob Geeets kudos!
Re: Dashticz - Custom scripts
Posted: Wednesday 12 December 2018 22:51
by dre68
Is it possible by custom.js to create a block to display the stream of an IP cam only in case another switch is 'on' (the switch which toggles the cam on or off)
this to prevent dashticz to continuously trying to connect to a stream which is currently off?
Re: Dashticz - Custom scripts
Posted: Saturday 15 December 2018 13:39
by dre68
dre68 wrote: ↑Wednesday 12 December 2018 22:46
Annyone out there who can help me out creating a custom block from a selector switch?
I have a selector which displays the current scene. I'd like to have a block based on that selector which shows a title like 'active scene' and the name of the current active scene (which is the decoded name of the selected value).
I don't want to see the current value as a selector, just plain text.
btw just started with Dasticz and already hooked, excellent configurable dashboard Rob Geeets kudos!
OK meanwhile I figured this one it out, for the interested:
Code: Select all
function getBlock_475(device,idx){ //change _xxx to the idx of your device!
var html='';
var names;
if (levelNamesEncoded === true) names = window.atob(device['LevelNames']).split('|');
else names = device['LevelNames'].split('|');
html += '<div class="col-xs-6 col-data">';
html += '<strong class="title">Active Scene</strong><br />';
for (a in names) {
if (parseFloat(a) > 0 || (a == 0 && (typeof(device['LevelOffHidden']) == 'undefined' || device['LevelOffHidden'] === false))) {
var s = '';
if ((a * 10) == parseFloat(device['Level']))
html += '<strong class="title">' + s + names[a] +'</strong><br />';
}
}
html += '</div>';
return html;
}