Page 2 of 2
Re: Dashticz - Custom JS
Posted: Tuesday 06 February 2018 21:13
by robgeerts
_SHOW_LASTUPDATE is an old variable, this is the working code:
Code: Select all
function getBlock_150(device,idx){ //idx 150 - iPhone Harm
$('.block_'+idx).attr('switchDevice(this)');
var html='';
html+='<div class="col-xs-4 col-icon">';
if(device['Status']=='Off') html+=iconORimage(idx,'fa-toggle-off','','off icon');
else html+=iconORimage(idx,'fa-toggle-on','','on icon');
html+='</div>';
html+='<div class="col-xs-8 col-data">';
html+='<strong class="title">'+device['Name']+'</strong><br />';
if(device['Status']=='Off') html+='<span class="state">AFWEZIG</span>';
else html+='<span class="state">AANWEZIG</span>';
// check if device has show_last_update=true
if((settings['last_update'] && (typeof(blocks[idx])=='undefined' || typeof(blocks[idx]['hide_lastupdate'])=='undefined' || blocks[idx]['hide_lastupdate']===false)) || (!settings['last_update'] && (typeof(blocks[idx])!=='undefined' && typeof(blocks[idx]['show_lastupdate'])!=='undefined' && blocks[idx]['show_lastupdate']==true)) )
{
html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(settings['timeformat'])+'</span>';
}
html+='</div>';
return html;
}
Re: Dashticz - Custom JS
Posted: Tuesday 06 February 2018 22:11
by htilburgs
robgeerts wrote: ↑Tuesday 06 February 2018 21:13
_SHOW_LASTUPDATE is an old variable, this is the working code:
YES! It works again. Thnx!
Re: Dashticz - Custom JS
Posted: Monday 17 September 2018 23:22
by EdwinK
And now I see a toggle-icon instead of the male figure I once had. did FontAwesome change things? Or did I screw up (as usually)

- Screen Shot 2018-09-17 at 23.27.28.png (31.46 KiB) Viewed 1049 times
Re: Dashticz - Custom JS
Posted: Saturday 06 October 2018 14:14
by SwordFish

- screen.PNG (5.53 KiB) Viewed 967 times
Its a long time since i post something here but now i have a question.
How can i reverse the icons for de blinds, when its closed i want the open icon and when its open i want the closed icon.
Also how can i reverse the text, i want the lux value under and the "lux buiten" on top?
Last one how do get the show last update false for some switches? When i set show last update to 1 i get all last updates and the show last update = false seems not working?
Re: Dashticz - Custom JS
Posted: Saturday 06 October 2018 15:51
by ArthurNL
SwordFish wrote: ↑Saturday 06 October 2018 14:14
screen.PNGIts a long time since i post something here but now i have a question.
How can i reverse the icons for de blinds, when its closed i want the open icon and when its open i want the closed icon.
Also how can i reverse the text, i want the lux value under and the "lux buiten" on top?
Last one how do get the show last update false for some switches? When i set show last update to 1 i get all last updates and the show last update = false seems not working?
Can't answer all the questions;
- reversing, use this code in the config.js:
blocks['1_1']['switch'] = true;
- last update;
On the top of
config.js, below
var config = {} I have the next item:
config['last_update'] = false; // true this will disable all 'updates' everywhere. Now you can enable it for a particular item with
blocks['1_1']['last_update'] = true;
My Config.js
- Spoiler: show
-
var config = {}
config['language'] = 'en_US';
config['domoticz_ip'] = 'http://ipthingy:8080';
config['app_title'] = 'Dashticz';
config['domoticz_refresh'] = '60';
config['dashticz_refresh'] = '60';
config['standard_graph'] = 'hours'; // or 'hours' or 'day'
config['last_update'] = false; // true
/*
OpenWeathermap config
*/
config['owm_api'] = 'apikey';
config['owm_city'] = 'city';
config['owm_name'] = '';
config['owm_country'] = 'nl';
config['static_weathericons'] = 1;
var blocks = {}
blocks[1] = {} //
blocks[1]['width'] = 6;
blocks['1_1'] = {} // Electra verbruik
blocks['1_1']['title'] = 'Verbruik';
blocks['1_1']['switch'] = true;
blocks['1_1']['icon'] = 'fas fa-bolt';
blocks['1_1']['last_update'] = true;
blocks['1_3'] = {} // Electra gebruik
blocks['1_3']['title'] = 'Gebruik';
blocks['1_3']['switch'] = true;
blocks['1_3']['icon'] = 'fas fa-bolt';
blocks[4] = {} //
blocks[4]['width'] = 6;
blocks['4_1'] = {} // Gas verbruik
blocks['4_1']['title'] = 'Verbruik';
blocks['4_1']['switch'] = true;
blocks['4_3'] = {} // Gas gebruik
blocks['4_3']['title'] = 'Gebruik';
blocks['4_3']['switch'] = true;
blocks[5] = {} //
blocks[5]['width'] = 6;
blocks['5_1'] = {} // Sonoff
blocks['5_1']['title'] = 'Temperatuur';
blocks['5_1']['switch'] = true;
blocks['5_2'] = {} // Sonoff
blocks['5_2']['title'] = 'Vochtigheid';
blocks['5_2']['switch'] = true;
blocks[7] = {} //
blocks[7]['width'] = 6;
blocks['7_1'] = {} // Esp #1 Woonkamer
blocks['7_1']['title'] = 'Temperatuur';
blocks['7_1']['switch'] = true;
blocks['7_2'] = {} // Esp #1 Woonkamer
blocks['7_2']['title'] = 'Vochtigheid';
blocks['7_2']['switch'] = true;
blocks[8] = {} //
blocks[8]['width'] = 6;
blocks['8_1'] = {} // Esp #2 Werkkamer
blocks['8_1']['title'] = 'Temperatuur';
blocks['8_1']['switch'] = true;
blocks['8_2'] = {} // Esp #2 Werkkamer
blocks['8_2']['title'] = 'Vochtigheid';
blocks['8_2']['switch'] = true;
/*
blocks['blocktitle10'] = {}
blocks['blocktitle10']['type'] = 'blocktitle';
blocks['blocktitle10']['title'] = 'Sonff';
blocks['blocktitle20'] = {}
blocks['blocktitle20']['type'] = 'blocktitle';
blocks['blocktitle20']['title'] = 'Esp #1';
blocks['blocktitle30'] = {}
blocks['blocktitle30']['type'] = 'blocktitle';
blocks['blocktitle30']['title'] = 'Esp #2';
*/
var buttons = {}
buttons.webcam1 = {width:6, isimage:true, refresh:10000, image: 'http://cdn.knmi.nl/knmi/map/page/weer/a ... ratuur.png', url: 'http://www.knmi.nl'}
buttons.webcam2 = {width:6, isimage:true, refresh:10000, image: 'https://cdn.knmi.nl/knmi/map/page/weer/ ... kracht.png', url: 'http://www.knmi.nl'}
var columns = {}
columns['bar'] = {};
columns['bar']['blocks'] = ['sunrise','miniclock','settings'];
columns[10] = {} // Kolom 1
columns[10]['blocks'] = ['graph_8','8_1','8_2','graph_7','7_1','7_2','graph_5','5_1','5_2'];
columns[10]['width'] = 4;
columns[20] = {} // Kolom 2
columns[20]['blocks'] = ['graph_1','1_1','1_3','graph_4','4_1','4_3'];
columns[20]['width'] = 4;
columns[30] = {} // Kolom 3
columns[30]['blocks'] = ['currentweather_big_owm','weather_owm',buttons.webcam1,buttons.webcam2];
columns[30]['width'] = 4;
var screens = {}
screens[10] = {}
screens[10]['columns'] = [10,20,30];
Re: Dashticz - Custom JS
Posted: Saturday 06 October 2018 22:04
by EdwinK
if you want your text above the value of the date do blocks[IDX]['switch'] = true;
Put the IDX of your LUX on the correct place
Re: Dashticz - Custom JS
Posted: Sunday 07 October 2018 11:33
by SwordFish
Thanks, that did the trick.
Re: Dashticz - Custom JS
Posted: Saturday 13 October 2018 12:12
by SwordFish
I have 2 pictures one for on.png and one for off.png in the image folder. How can I use these with Custom js for a lightswitch?
Update; solved, i had to read the wiki
