Page 58 of 184

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

Posted: Wednesday 19 April 2017 12:33
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

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

Posted: Wednesday 19 April 2017 13:58
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 ;)

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

Posted: Wednesday 19 April 2017 14:07
by EdwinK
I'll will be waiting for this to be in a next upgrade. ;)

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

Posted: Wednesday 19 April 2017 14:08
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?

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

Posted: Wednesday 19 April 2017 14:16
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!)

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

Posted: Wednesday 19 April 2017 14:32
by wizjos
robgeerts wrote:Genius!
I have integrated this in the next version (hopefully tonight on Gitlab!)
8-) Thanks!

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

Posted: Wednesday 19 April 2017 21:54
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

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

Posted: Wednesday 19 April 2017 21:59
by SwordFish
We will be there tomorrow


Verzonden vanaf mijn iPhone met Tapatalk

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

Posted: Wednesday 19 April 2017 22:12
by EdwinK
More waiting...

Oh well, guess we have to.

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

Posted: Wednesday 19 April 2017 22:18
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:

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

Posted: Wednesday 19 April 2017 22:23
by robgeerts
No not yet, sorry, tomorrow :(

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

Posted: Thursday 20 April 2017 10:31
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:

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

Posted: Thursday 20 April 2017 10:35
by EdwinK
Nice tablet. Looks great on the wall. Dwarfs my 7" tablet.

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

Posted: Thursday 20 April 2017 10:38
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.

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

Posted: Thursday 20 April 2017 10:54
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?

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

Posted: Thursday 20 April 2017 11:00
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!

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

Posted: Thursday 20 April 2017 11:01
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...

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

Posted: Thursday 20 April 2017 12:04
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?

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

Posted: Thursday 20 April 2017 12:38
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.

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

Posted: Thursday 20 April 2017 13:08
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 :(