Page 1 of 1

[SOLVED] Not able to adjust setpoint

Posted: Saturday 09 February 2019 18:13
by paalkr
Hi

I'm using latest beta build of Dashticz, and I'm impressed with the dashboards I'm able to build with ease. But I'm facing a problem with my setpoint devices. How can I modify the default min temp of 12c and max temp of 25c? I'm not able to set the temp outside of this values. I would like to have min possible value set to 5 and the max possible value set to 35.

Thx

Re: Not able to adjust setpoint

Posted: Saturday 09 February 2019 20:46
by paalkr
So, answering my own question ;)

The setpoint min and max range is defined in the getThermostatBlock function in main.js.
change this line with your desired values

Code: Select all

this.html += '<strong class="title input-number title-input" min="12" max="25" data-light="' + device['idx'] + '">' + this.title + '</strong>';

Code: Select all

function getThermostatBlock(device, idx) {
    this.html = '';
    this.html += iconORimage(idx + '_1', '', 'heating.png', 'on icon', 'style="max-height:35px;"');
    this.html += '<div class="col-xs-8 col-data">';

    this.title = device['Data'] + _TEMP_SYMBOL;
    this.value = device['Name'];
    if (titleAndValueSwitch(idx + '_1')) {
        this.title = device['Name'];
        this.value = device['Data'] + _TEMP_SYMBOL;
    }
    this.html += '<strong class="title">' + this.title + '</strong><br />';
    this.html += '<span class="state">' + this.value + '</span>';
    if (showUpdateInformation(idx)) {
        this.html += '<br /><span class="lastupdate">' + moment(device['LastUpdate']).format(settings['timeformat']) + '</span>';
    }
    this.html += '</div>';

    $('div.block_' + idx + '_1').html(this.html);

    this.html = '';
    this.html += '<ul class="col-thermostat input-groupBtn">';
    this.html += '<li class="up"><a href="javascript:void(0)" class="btn btn-number plus" data-type="plus" data-field="quant[' + device['idx'] + ']" onclick="this.blur();">';
    this.html += '<em class="fas fa-plus fa-small fa-thermostat"></em>';
    this.html += '</a></li>';
    this.html += '<li class="down"><a href="javascript:void(0)" class="btn btn-number min" data-type="minus" data-field="quant[' + device['idx'] + ']" onclick="this.blur();">';
    this.html += '<em class="fas fa-minus fa-small fa-thermostat"></em>';
    this.html += '</a></li>';
    this.html += '</ul>';

    this.html += iconORimage(idx + '_2', '', 'heating.png', 'on icon iconheating', '', '2');
    this.html += '<div class="col-xs-8 col-data">';

    this.title = number_format(device['Data'], 1) + _TEMP_SYMBOL;
    this.value = device['Name'];
    if (titleAndValueSwitch(idx) || titleAndValueSwitch(idx + '_2')) {
        this.title = device['Name'];
        this.value = number_format(device['Data'], 1) + _TEMP_SYMBOL;
    }
    this.html += '<strong class="title input-number title-input" min="5" max="40" data-light="' + device['idx'] + '">' + this.title + '</strong>';
    this.html += '<div class="state stateheating">' + this.value + '</div>';
    this.html += '</div>';

    $('div.block_' + idx + '_2').html(this.html);
    $('div.block_' + idx).html(this.html);

    if (typeof(addedThermostat[idx]) === 'undefined') {
        addThermostatFunctions('.block_' + idx);
        addedThermostat[idx] = true;
    }
    if (typeof(addedThermostat[idx + '_2']) === 'undefined') {
        addThermostatFunctions('.block_' + idx + '_2');
        addedThermostat[idx + '_2'] = true;
    }
    return [this.html, false];
}

Re: Not able to adjust setpoint

Posted: Saturday 09 February 2019 20:55
by paalkr
Or even better, expose the min and max setpoint values as configurable parameters :)

modify main.js

Code: Select all

this.html += '<strong class="title input-number title-input" min="' + settings['setpoint_min'] + '" max="' + settings['setpoint_max'] + '" data-light="' + device['idx'] + '">' + this.title + '</strong>';
add config to your CONFIG.js

Code: Select all

config['setpoint_min'] = 5;
config['setpoint_max'] = 40;