Dashticz - Custom scripts

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
mhodom
Posts: 6
Joined: Tuesday 11 July 2017 15:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

function getBlock_233(device,idx)

Post 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
Kolkos
Posts: 1
Joined: Sunday 30 July 2017 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Script to change the RPI Touch Screen brightness

Post 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
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Script to change the RPI Touch Screen brightness

Post 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.
Blueone
Posts: 130
Joined: Friday 29 November 2013 11:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script to change the RPI Touch Screen brightness

Post by Blueone »

It canalso be done with dashticz, I wrote an how-to in the wiki a couple of months ago.
User avatar
dre68
Posts: 27
Joined: Friday 30 January 2015 20:18
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Dashticz - Custom scripts

Post 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!
User avatar
dre68
Posts: 27
Joined: Friday 30 January 2015 20:18
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Dashticz - Custom scripts

Post 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?
User avatar
dre68
Posts: 27
Joined: Friday 30 January 2015 20:18
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Dashticz - Custom scripts

Post 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;			
}	
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests