Dashticz V2 - Tips, Tricks & Customization

From Domoticz
Jump to: navigation, search

Multiple Newsfeeds

You can define multiple newsfeed in the Blocks section of the CONFIG.js.
The first newsfeed is the defined in Custom Parameters: var _NEWS_RSSFEED = 'http://www.nu.nl/rss/algemeen';
The next newsfeed(s) have to look like this

blocks['news_2'] = {}
blocks['news_2']['feed'] = 'http://feeds.feedburner.com/tweakers/nieuws';

You can use it by putting it into a Column statement

columns[1]['blocks'] = ['news_2'];


Informatie.jpgREMARK: In some cases the Newsfeed wouldn't load and you get NO results. You have to put https://crossorigin.me/ before the newsfeed-url, like:

blocks['news_2'] = {}
blocks['news_2']['feed'] = 'https://crossorigin.me/http://feeds.feedburner.com/tweakers/nieuws';




Using Frames in a block

You can use frames in a block. You have to add the following code into the CONFIG.js file.

var frames = {}
frames.weather = {refreshiframe:10000,height:500,frameurl:"http://iltasanomat.weatherproof.fi/tutka.php?map=Etel%C3%A4-Suomi",width:12}

You can use it by putting it into a Column statement

columns[1]['blocks'] = [frames.weather];


Informatie.jpgREMARK: Too many frames can cause the Dashboard to load slow!!



Adjusting brightness Raspberry touchscreen

Dashticz allows the original touchscreen brightness to be changed when entering the standby mode. Pre-requirements: Enable the running of CGI script in apache:
http://httpd.apache.org/docs/2.2/howto/cgi.html

Install the Raspberry brightness API:
https://github.com/linusg/rpi-backlight

Create a CGI script with the folowing code:

#!/usr/bin/python
print "Content-type:text/html\r\n\r\n"
 
import sys, getopt
import rpi_backlight as bl
import cgi
import cgitb; cgitb.enable() # Optional; for debugging onl
 
fs = cgi.FieldStorage()
for key in fs.keys():
	if key == 'brightness':
		arg = (fs[key].value)
brightness = int(float(arg))
 
#get state currently not working in API
currentstate = bl.get_power()
#print 'Current state = ', currentstate, '\n'
 
 
if brightness == 0:
	print 'turn screen off\n'
	bl.set_power(False)
elif brightness <= 10:
	print 'no valid brightness <11-255> off = 0'
	sys.exit()
else:	
	print 'Set brightness to ', brightness
	bl.set_brightness(brightness)
	if currentstate == False:
		print 'Turn on screen, '
		bl.set_power(True)

Save the screen as screen_brightness.cgi in the CGI-Bin directory.

Enter the URL into the Dashticz variale with a valid value: 11-255 or 0 for off.
Usage:

http://127.0.0.1/cgi-bin/screen_brightness.cgi?brightness=<BRIGHTNESS LEVEL>




Graphs

For items which have logging and data within Domoticz, it is possible to show the graph in Dashticz v2.0.
Just click on the icon of the device and a graph appear.



Switch Title & Value

Some like to switch the Title and the Value in a statusblock. This can be done with 'switch'

  1. blocks[5] = {} //CPU
  2. blocks[5]['width'] = 6;
  3. blocks[5]['icon'] = 'fa-line-chart';
  4. blocks[5]['switch'] = true;


The result:
Switch.jpg



Custom Station Clock

This is an 'old fashioned' station clock. http://www.3quarks.com/en/StationClock

var _HIDE_SECONDS_IN_STATIONCLOCK = false;
var _CLOCK_BOSS			  = 'RedBoss';
Parameter Description
var _HIDE_SECONDS_IN_STATIONCLOCK false; shows second hand if variable _HIDE_SECONDS_IN_CLOCK is set to true
var _CLOCK_BOSS 'RedBoss'; shows hands red axis cover

Add the next code into the blocks part:

  1. columns[1]['blocks'] = ['stationclock']

The result:

Stationclock.jpg



Multiple Dashboards

It is possible to use multiple dashboards.
If you want to use a slightly different version of Dashticz on another device, you can open index2.html on that device.

  • Copy the custom folder to custom_2 folder
    • It uses the custom.css,custom.js and config.js from custom_2-folder.
  • Copy the index.html to index2.html
  • Edit the index2.html and change the line var dashtype=1; to var dashtype=2;
  • Call the URL /<dashtics v2 folder>/index2.html


Want to have a third one (for example your mobile device) ? Just repeat these steps for custom_3 and var dashtype=3;



Dv2-home.png Dv2-custom.png
Dashticz V2.0 Main Page Custom JS