Dashticz - General Discussions

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Locked
SwordFish
Posts: 278
Joined: Sunday 14 December 2014 12:28
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.11375
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by SwordFish »

wizjos wrote:Personally I don't like the wind-direction as Domoticz returns it... All english texts like 'ENE', 'WSW' etc.
Created a function to change this and give more descriptive texts like 'oost-noordoost' or 'west-zuidwest'.
To achieve this I hacked in to blocks.js...
Created a function TranslateDirection:

Code: Select all

function TranslateDirection(directionstr){
	directionstr='direction_'+directionstr;
	return lang[directionstr];
}
Altered the line:
blocktypes.Type['Wind'] = { icon: 'wi wi-wind-direction', title: lang.wind, value: '<Speed> m/s, <Direction> <DirectionStr>' }
in:

Code: Select all

blocktypes.Type['Wind'] = { icon: 'wi wi-wind-direction', title: lang.wind, value: '<Speed> m/s, <Direction>&deg; ' }
(with a degree sign as well)
and added an extra line (the third) in this piece of code:

Code: Select all

	if(typeof(device['Direction'])!=='undefined' && typeof(device['DirectionStr'])!=='undefined'){
		attr+=' style="-webkit-transform: rotate('+device['Direction']+'deg);-moz-transform: rotate('+device['Direction']+'deg);-ms-transform: rotate('+device['Direction']+'deg);-o-transform: rotate('+device['Direction']+'deg); transform: rotate('+device['Direction']+'deg);"';
		value = value+TranslateDirection(device['DirectionStr']);
	}
And finally added in the language file these lines

Code: Select all

lang['direction_N'] = 'noord'
lang['direction_ENE'] = 'oost-noordoost';
lang['direction_NE'] = 'noordoost'
lang['direction_E'] = 'oost';
lang['direction_ESE'] = 'oost-zuidoost' ;
lang['direction_S'] = 'zuid' ;
lang['direction_WSW'] = 'west-zuidwest' ;
lang['direction_W'] = 'west' ;
lang['direction_WNW'] = 'west-noordwest' ;
All that remains now is a translation from m/s into Bft (Beaufort) :mrgreen:

Regards
Wizjos
Very nice done Image


Verzonden vanaf mijn iPhone met Tapatalk
User avatar
wizjos
Posts: 78
Joined: Monday 07 March 2016 19:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by wizjos »

Improved my own handywork :mrgreen: :
Translation of the wind-direction (as mentioned in prev. post) and Beaufort(Bft) in stead of 'm/s'
Both made configurable...

Created two functions, TranslateDirection and Beaufort in blocks.js:

Code: Select all

function TranslateDirection(directionstr){
	directionstr='direction_'+directionstr;
	return lang[directionstr];
}

function Beaufort(tmp) {
	if (tmp >= 0 && tmp <= 0,2) {
		bft = "0 Bft";
	}
	if (tmp >= 0.3 && tmp <= 1.5) {
		bft = "1 Bft";
	}
	if (tmp >= 1.6 && tmp <= 3.3) {
		bft = "2 Bft";
	}
	if (tmp >= 3.4 && tmp <= 5.4) {
		bft = "3 Bft";
	}
	if (tmp >= 5.5 && tmp <= 7.9) {
		bft = "4 Bft";
	}
	if (tmp >= 8.0 && tmp <= 10.7) {
		bft = "5 Bft";
	}
	if (tmp >= 10.8 && tmp <= 13.8) {
		bft = "6 Bft";
	}
	if (tmp >= 13.9 && tmp <= 17.1) {
		bft = "7 Bft";
	}
	if (tmp >= 17.2 && tmp <= 20.7) {
		bft = "8 Bft";
	}
	if (tmp >= 20.8 && tmp <= 24.4) {
		bft = "9 Bft";
	}
	if (tmp >= 24.5 && tmp <= 28.4) {
		bft = "10 Bft";
	}
	if (tmp >= 28.5 && tmp <= 32.6) {
		bft = "11 Bft";
	}
	if (tmp >= 32.7) {
		bft = "12 Bft";
	}
	return bft
}
Altered the line:
blocktypes.Type['Wind'] = { icon: 'wi wi-wind-direction', title: lang.wind, value: '<Speed> m/s, <Direction> <DirectionStr>' }
in blocks.js to:

Code: Select all

blocktypes.Type['Wind'] = { icon: 'wi wi-wind-direction', title: lang.wind, value: '' }
altered the function getStatusBlock in blocks.js:

Code: Select all

	if(typeof(device['Direction'])!=='undefined' && typeof(device['DirectionStr'])!=='undefined'){
		attr+=' style="-webkit-transform: rotate('+device['Direction']+'deg);-moz-transform: rotate('+device['Direction']+'deg);-ms-transform: rotate('+device['Direction']+'deg);-o-transform: rotate('+device['Direction']+'deg); transform: rotate('+device['Direction']+'deg);"';
		//start alteration
		if (_USE_BEAUFORT ==true){
			value = Beaufort(device['Speed'])+', '; 
		} else {
			value = device['Speed']+' m/s, '; 
		}
		value+=device['Direction']+'&deg ';
		if (_TRANSLATE_SPEED==true){
			value+=TranslateDirection(device['DirectionStr'])
		} else {
			value+=device['DirectionStr'];
		}
		//end alteration
	}
To complete it I added to main.js these lines:

Code: Select all

if(typeof(_USE_BEAUFORT)=='undefined') var _USE_BEAUFORT = false;
if(typeof(_TRANSLATE_SPEED)=='undefined') var _TRANSLATE_SPEED = false;
And finally added in the language file these lines

Code: Select all

lang['direction_N'] = 'noord'
lang['direction_NNE'] = 'noord-noordoost';
lang['direction_NE'] = 'noordoost'
lang['direction_ENE'] = 'oost-noordoost';
lang['direction_E'] = 'oost';
lang['direction_ESE'] = 'oost-zuidoost' ;
lang['direction_SE'] = 'zuidoost' ;
lang['direction_SSE'] = 'zuid-zuidoost' ;
lang['direction_S'] = 'zuid' ;
lang['direction_SSW'] = 'zuid-zuidwest' ;
lang['direction_SW'] = 'zuid-west' ;
lang['direction_WSW'] = 'west-zuidwest' ;
lang['direction_W'] = 'west' ;
lang['direction_WNW'] = 'west-noordwest' ;
lang['direction_NW'] = 'noordwest' ;
lang['direction_NNW'] = 'noord-noordwest' ;
By adding the settings '_USE_BEAUFORT' and '_TRANSLATE_SPEED' in config.js and setting them either true or false I can choose what the output will be

Regards
Wizjos

@robgeerts: Use it if you like ;)
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by EdwinK »

I'll will be waiting for this to be in a next upgrade. ;)
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
gielie
Posts: 290
Joined: Tuesday 12 January 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by gielie »

Is it possible to create a link to a screen. for example i have a small webcam image on screen 1 and a full webcam screen on screen 3. So when i click the small webcam on screen 1 i want to go to screen 3 instead of a popup window of the webcam.

Other question, i have a geotag with my iPhone, it is a on/off switch, is it possible to rename this in Home/away?
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by robgeerts »

wizjos wrote:Improved my own handywork :mrgreen: :
Translation of the wind-direction (as mentioned in prev. post) and Beaufort(Bft) in stead of 'm/s'
Both made configurable...

Created two functions, TranslateDirection and Beaufort in blocks.js:

Code: Select all

function TranslateDirection(directionstr){
	directionstr='direction_'+directionstr;
	return lang[directionstr];
}

function Beaufort(tmp) {
	if (tmp >= 0 && tmp <= 0,2) {
		bft = "0 Bft";
	}
	if (tmp >= 0.3 && tmp <= 1.5) {
		bft = "1 Bft";
	}
	if (tmp >= 1.6 && tmp <= 3.3) {
		bft = "2 Bft";
	}
	if (tmp >= 3.4 && tmp <= 5.4) {
		bft = "3 Bft";
	}
	if (tmp >= 5.5 && tmp <= 7.9) {
		bft = "4 Bft";
	}
	if (tmp >= 8.0 && tmp <= 10.7) {
		bft = "5 Bft";
	}
	if (tmp >= 10.8 && tmp <= 13.8) {
		bft = "6 Bft";
	}
	if (tmp >= 13.9 && tmp <= 17.1) {
		bft = "7 Bft";
	}
	if (tmp >= 17.2 && tmp <= 20.7) {
		bft = "8 Bft";
	}
	if (tmp >= 20.8 && tmp <= 24.4) {
		bft = "9 Bft";
	}
	if (tmp >= 24.5 && tmp <= 28.4) {
		bft = "10 Bft";
	}
	if (tmp >= 28.5 && tmp <= 32.6) {
		bft = "11 Bft";
	}
	if (tmp >= 32.7) {
		bft = "12 Bft";
	}
	return bft
}
Altered the line:
blocktypes.Type['Wind'] = { icon: 'wi wi-wind-direction', title: lang.wind, value: '<Speed> m/s, <Direction> <DirectionStr>' }
in blocks.js to:

Code: Select all

blocktypes.Type['Wind'] = { icon: 'wi wi-wind-direction', title: lang.wind, value: '' }
altered the function getStatusBlock in blocks.js:

Code: Select all

	if(typeof(device['Direction'])!=='undefined' && typeof(device['DirectionStr'])!=='undefined'){
		attr+=' style="-webkit-transform: rotate('+device['Direction']+'deg);-moz-transform: rotate('+device['Direction']+'deg);-ms-transform: rotate('+device['Direction']+'deg);-o-transform: rotate('+device['Direction']+'deg); transform: rotate('+device['Direction']+'deg);"';
		//start alteration
		if (_USE_BEAUFORT ==true){
			value = Beaufort(device['Speed'])+', '; 
		} else {
			value = device['Speed']+' m/s, '; 
		}
		value+=device['Direction']+'&deg ';
		if (_TRANSLATE_SPEED==true){
			value+=TranslateDirection(device['DirectionStr'])
		} else {
			value+=device['DirectionStr'];
		}
		//end alteration
	}
To complete it I added to main.js these lines:

Code: Select all

if(typeof(_USE_BEAUFORT)=='undefined') var _USE_BEAUFORT = false;
if(typeof(_TRANSLATE_SPEED)=='undefined') var _TRANSLATE_SPEED = false;
And finally added in the language file these lines

Code: Select all

lang['direction_N'] = 'noord'
lang['direction_NNE'] = 'noord-noordoost';
lang['direction_NE'] = 'noordoost'
lang['direction_ENE'] = 'oost-noordoost';
lang['direction_E'] = 'oost';
lang['direction_ESE'] = 'oost-zuidoost' ;
lang['direction_SE'] = 'zuidoost' ;
lang['direction_SSE'] = 'zuid-zuidoost' ;
lang['direction_S'] = 'zuid' ;
lang['direction_SSW'] = 'zuid-zuidwest' ;
lang['direction_SW'] = 'zuid-west' ;
lang['direction_WSW'] = 'west-zuidwest' ;
lang['direction_W'] = 'west' ;
lang['direction_WNW'] = 'west-noordwest' ;
lang['direction_NW'] = 'noordwest' ;
lang['direction_NNW'] = 'noord-noordwest' ;
By adding the settings '_USE_BEAUFORT' and '_TRANSLATE_SPEED' in config.js and setting them either true or false I can choose what the output will be

Regards
Wizjos

@robgeerts: Use it if you like ;)
Genius!
I have integrated this in the next version (hopefully tonight on Gitlab!)
User avatar
wizjos
Posts: 78
Joined: Monday 07 March 2016 19:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by wizjos »

robgeerts wrote:Genius!
I have integrated this in the next version (hopefully tonight on Gitlab!)
8-) Thanks!
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by robgeerts »

The update I had planned for tonight will be tomorrow, I have to test some things before pushing to gitlab.
If I update now, I cannot go to bed in the next couple of hours :P
SwordFish
Posts: 278
Joined: Sunday 14 December 2014 12:28
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.11375
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by SwordFish »

We will be there tomorrow


Verzonden vanaf mijn iPhone met Tapatalk
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by EdwinK »

More waiting...

Oh well, guess we have to.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
bierlaagh
Posts: 42
Joined: Friday 14 March 2014 16:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9984
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by bierlaagh »

bierlaagh wrote:Very happy with Dashticz V2.0 Thnx for that!

But now i encounter an issue wich i don't know if it is resolved or not (could not find it searching this topic)

I have a button and a Scene , Botch have IDX2

Code: Select all

blocks[2] = {}
blocks[2]['width'] = 4; 
blocks[2]['title'] = 'onkyo' 
blocks[2]['icon'] = 'fa-volume-up';
in Config.js i already renamed the Scene :

Code: Select all

blocks['s2'] = {}
blocks['s2']['type'] = 'Scene';
blocks['s2']['width'] = 12; 
blocks['s2']['title'] = 'Alles uit' 
blocks['s2']['icon'] = 'fa-power-off';
robgeerts wrote:Ok, fixed in latest version. (Pushing tomorrow, I think, to gitlab!)
still having issues, has the fix been pushed already?

made a new scene (with an IDX that didn't conflict wilt an button IDX)
than the scene button is visible and works , but when i change it back to the scene i would like to use ('S2') where i also have a button with IDX2 the name and scene is not triggered

EDIT

Sometimes reading is very difficult. Update will be tomorrow :D :idea:
Last edited by bierlaagh on Wednesday 19 April 2017 22:50, edited 1 time in total.
1x Raspberry PI 3 With Domoticz V.3.7318
1X RFXtrx433 USB 433.92MHz
1X Synology DS213j Nas
Toon by Eneco including Toon Zon
several KAKU switches and dimmers
Mysensors WIFI Gateway including meters, switches en humidity sensors
Wifi Dimmers (home made)
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by robgeerts »

No not yet, sorry, tomorrow :(
Jonb
Posts: 16
Joined: Thursday 20 April 2017 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: NL
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by Jonb »

robgeerts wrote:No not yet, sorry, tomorrow :(
Thanks for this superb dashboard. I'm already playing and customizing it for 2 weeks now and it's working great. I hope the + / - function on setpoint will be updated in your new update of today?

Herewith a screenshot:
Attachments
screenshot.jpg
screenshot.jpg (148.88 KiB) Viewed 2318 times
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by EdwinK »

Nice tablet. Looks great on the wall. Dwarfs my 7" tablet.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Jonb
Posts: 16
Joined: Thursday 20 April 2017 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: NL
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by Jonb »

EdKo66 wrote:Nice tablet. Looks great on the wall. Dwarfs my 7" tablet.
Thanks, I just bought the new ASUS Zenpad 10, received it, opened the box, took of the backplate, drilled 3 holes and mounted the backplate on the wall and close the cover ;). I'm now busy with continuous power inside the wall so I have no wires in sight.
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by robgeerts »

Nice!
I was thinking about getting this one:
http://www.bcc.nl/computer/tablet/andro ... 08(221412)

It's cheap, not the best of course but I think good enough for mounting on the wall?
Jonb
Posts: 16
Joined: Thursday 20 April 2017 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: NL
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by Jonb »

robgeerts wrote:Nice!
I was thinking about getting this one:
http://www.bcc.nl/computer/tablet/andro ... 08(221412)

It's cheap, not the best of course but I think good enough for mounting on the wall?
Also a nice one. The resolution of that one is 1024 x 600 Pixels. I've chosen for the resolution of 1280x800 Pixels so I have some more space ;)
We just have to donate some more for your great project and you can buy the Zenpad 10 ! ;)

I'm in!
Jonb
Posts: 16
Joined: Thursday 20 April 2017 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: NL
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by Jonb »

robgeerts wrote:Nice!
I was thinking about getting this one:
http://www.bcc.nl/computer/tablet/andro ... 08(221412)

It's cheap, not the best of course but I think good enough for mounting on the wall?

Can you please update the new version? I'm curious of using the thermostat setpoint with + / - buttons. I've installed the Thermosmart thermostat yesterday...
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by Nautilus »

Nautilus wrote:
Spoiler: show
Nautilus wrote:
robgeerts wrote: Download latest version and try this to use iframes:
First, define the frame:

Code: Select all

var frames = {}
frames.weather = {height:500,frameurl:"http://iltasanomat.weatherproof.fi/tutka.php?map=Etel%C3%A4-Suomi",width:12}
Then add that frame to a column, like:

Code: Select all

columns[1]['blocks'] = [frames.weather]
Thanks, I am now able to insert the page to a block via iframe. I wonder if there is any css trick to shrink the source to the available space, that would be awesome... :)
I was able to achieve roughly what I wanted with this custom css:

Code: Select all

iframe {
  -moz-transform: scale(0.25, 0.25);
  -webkit-transform: scale(0.25, 0.25);
  -o-transform: scale(0.25, 0.25);
  -ms-transform: scale(0.25, 0.25);
  -transform: scale(0.25, 0.25);
  -moz-transform-origin: top left;
  -webkit-transform-origin: top left;
  -o-transform-origin: top left;
  -ms-transform-origin: top left;
  transform-origin: top left;
  height:600px !important;
  width:100vw !important;
  overflow:hidden !important;
}

.transbg.col-xs-12 {
  overflow:hidden !important;
}
The only remaining issue for me is that iframe block only grows in width (like the other blocks) where as to be able to fill the block nicely it would also need to grow in height - like for example the web camera block. Is this perhaps something that could be achieved with the custom.css or do you think it might be a good idea to implement this kind of behavior as default? I guess it might be as otherwise the ratio of the block changes which I'd assume in most cases makes the iframe source look a bit funny :)
Any thoughts on the above? :) Also, when trying to fit stuff on my old (wall-mounted) iPad 2 I was thinking the "currentweather_big" takes a bit too much space. What would be the best way to make this a bit smaller, some custom.css approach perhaps?
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by EdwinK »

robgeerts wrote:Nice!
I was thinking about getting this one:
http://www.bcc.nl/computer/tablet/andro ... 08(221412)

It's cheap, not the best of course but I think good enough for mounting on the wall?
For just using it for the Dashboard, I think it's good enough.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
maluko
Posts: 105
Joined: Sunday 02 February 2014 23:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Portugal
Contact:

Re: Dashticz v2.0, custom positioning and multiple screens

Post by maluko »

robgeerts wrote:Nice!
I was thinking about getting this one:
http://www.bcc.nl/computer/tablet/andro ... 08(221412)

It's cheap, not the best of course but I think good enough for mounting on the wall?
i am seeing new tablet too for this prices but have a disavantage, dont have bluetooth either and if you want radio to transfere to bluetooth speaker .... now way :(
Locked

Who is online

Users browsing this forum: No registered users and 1 guest