I checked for the bug which causes issues with displaying the graphs for _1 en _2 devices.
I changed two function in blocks.js for this:
Code: Select all
function getStatusBlock(device,block){
var value = block.value;
var title = block.title;
for(d in device) {
value = value.replace('<'+d+'>',device[d]);
title = title.replace('<'+d+'>',device[d]);
}
if(device['SubType']=='Percentage' || device['SubType']=='Custom Sensor' || device['TypeImg']=='counter' || device['Type']=='Temp' || device['Type']=='Wind' || device['Type']=='Rain' || device['Type']== 'Temp + Humidity' || device['Type']== 'Temp + Humidity + Baro'){
//debugger;
getButtonGraphs(device);
$('.block_'+device['idx']).addClass('hover');
$('.block_'+device['idx']).attr('data-toggle','modal');
$('.block_'+device['idx']).attr('data-target','#opengraph'+device['idx']);
$('.block_'+device['idx']+'_1').addClass('hover');
$('.block_'+device['idx']+'_1').attr('data-toggle','modal');
$('.block_'+device['idx']+'_1').attr('data-target','#opengraph'+device['idx']);
$('.block_'+device['idx']+'_1').addClass('hover');
$('.block_'+device['idx']+'_2').attr('data-toggle','modal');
$('.block_'+device['idx']+'_2').attr('data-target','#opengraph'+device['idx']);
}
var attr='';
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']+'° ';
if (_TRANSLATE_SPEED==true){
value+=TranslateDirection(device['DirectionStr'])
} else {
value+=device['DirectionStr'];
}
//end alteration
}
and
Code: Select all
function getStateBlock(id,icon,title,value,device){
if(device['SubType']=='Percentage' || device['SubType']=='Custom Sensor' || device['TypeImg']=='counter' || device['Type']=='Temp' || device['Type']=='Wind' || device['Type']=='Rain' || device['Type']== 'Temp + Humidity' || device['Type']== 'Temp + Humidity + Baro'){
getButtonGraphs(device);
$('.block_'+device['idx']).addClass('hover');
$('.block_'+device['idx']).attr('data-toggle','modal');
$('.block_'+device['idx']).attr('data-target','#opengraph'+device['idx']);
$('.block_'+device['idx']+'_1').addClass('hover');
$('.block_'+device['idx']+'_1').attr('data-toggle','modal');
$('.block_'+device['idx']+'_1').attr('data-target','#opengraph'+device['idx']);
$('.block_'+device['idx']+'_2').addClass('hover');
$('.block_'+device['idx']+'_2').attr('data-toggle','modal');
$('.block_'+device['idx']+'_2').attr('data-target','#opengraph'+device['idx']);
}
triggerChange(device['idx'],value);
var stateBlock ='<div class="col-xs-4 col-icon">';
stateBlock+='<em class="'+icon+'"></em>';
stateBlock+='</div>';
stateBlock+='<div class="col-xs-8 col-data">';
if(typeof(blocks[device['idx']])!=='undefined' && typeof(blocks[device['idx']]['switch'])!=='undefined' && blocks[device['idx']]['switch']==true){
stateBlock+='<strong class="title">'+title+'</strong><br />';
stateBlock+='<span>'+value+'</span>';
}
else {
stateBlock+='<strong class="title">'+value+'</strong><br />';
stateBlock+='<span>'+title+'</span>';
}
stateBlock+='</div>';
return stateBlock;
}
It now simply tries to add the class for each type, maybe this can be done more efficiently.
I din't find anything yet for the problem the graph isn't readable with a 7 day log. Domoticz always return 7 days (or the number of days set in the setting). I think the result have to be split in pages for each day to make it readable.