Page 1 of 2

Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 14:37
by florisi
I'm running dashticz stable on my ubuntu server.
Wanna upgrade to v3.4.1 beta
How can I upgrade to the last beta?

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 15:46
by Alfagek

Code: Select all

git checkout beta
git pull

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 16:06
by florisi
Thanks, works.
But still have the problem with the Mi Flower.

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 18:17
by Lokonli
Normally we are pretty quick in answering issues, but we can't address all requests within one day.
If you want to help, you are more than welcome.

Anyway, to add Mi Flower support, replace the function getExtendedBlockTypes in custom/custom.js with the following:

Code: Select all

function getExtendedBlockTypes(blocktypes){
	blocktypes.SubType['Soil Moisture'] = {}
	blocktypes.SubType['Soil Moisture']['cb'] = {
		icon: 'fas fa-seedling',
		title: '<Name>',
		value: '<Data>',
	};
	blocktypes.SubType['Soil Moisture']['advice'] = {
		icon: 'fas fa-seedling',
		title: '<Name>',
		value: '<Desc>',
	};
	
	return blocktypes;
} 
You should get two devices: The moisture value, and the irrigation advice.

Please confirm whether this is working, and I'll merge it in the next beta release.

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 20:11
by florisi
Replaced custom.js with the snippet, now the devices are disappeared. (not working)
Here is my current custom.js

Code: Select all

 //add custom javascript in here
function afterGetDevices(){


}

function getExtendedBlockTypes(blocktypes){
    blocktypes.SubType['Soil Moisture'] = {}
    blocktypes.SubType['Soil Moisture']['cb'] = {
        icon: 'fas fa-seedling',
        title: '<Name>',
        value: '<Data>',
    };
    blocktypes.SubType['Soil Moisture']['advice'] = {
        icon: 'fas fa-seedling',
        title: '<Name>',
        value: '<Desc>',
    };
    return blocktypes;
}

function getStatus_98(idx,value,device) {
    if(parseFloat(device['Data'])>1000) {
        $('div.block_98').addClass('warning');
    } else {
        $('div.block_98').removeClass('warning');
    }
}

function getStatus_100(idx,value,device) {
    if(parseFloat(device['Data'])>1000) {
        $('div.block_100').addClass('warning');
    } else {
        $('div.block_100').removeClass('warning');
    }
}

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 20:44
by Lokonli
In 3.4.1 beta the interface of the getStatus functions changed. See the following link for some examples:

https://dashticz.readthedocs.io/en/beta ... fterupdate

replace the functions with the following code block:

Code: Select all

function getStatus_98(block) {
var device=block.device;
    if(parseFloat(device['Data'])>1000) {
        block.addClass='warning';
    } else {
        block.addClass='';
    }
}

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 20:51
by florisi
Hi,

thanks for the update, but still not working.
The Mi Flower doesn't appear.

Here is the custom.js again.

Code: Select all

 //add custom javascript in here
function afterGetDevices(){


}

function getExtendedBlockTypes(blocktypes){
    blocktypes.SubType['Soil Moisture'] = {}
    blocktypes.SubType['Soil Moisture']['cb'] = {
        icon: 'fas fa-seedling',
        title: '<Name>',
        value: '<Data>',
    };
    blocktypes.SubType['Soil Moisture']['advice'] = {
        icon: 'fas fa-seedling',
        title: '<Name>',
        value: '<Desc>',
    };
    return blocktypes;
}

function getStatus_98(block) {
var device=block.device;
    if(parseFloat(device['Data'])>1000) {
        block.addClass='warning';
    } else {
        block.addClass='';
    }
}

function getStatus_100(block) {
var device=block.device;
    if(parseFloat(device['Data'])>1000) {
        block.addClass='warning';
    } else {
        block.addClass='';
    }
}

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 20:57
by Lokonli
The other blocks are displayed correctly?

Can you open DevTools in Chrome by pressing F12.
Then open or refresh Dashticz.

In Devtools go to the console tab. Do you see any error?

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 21:02
by florisi
I have this error:

Code: Select all

TypeError: (title + value).match is not a function
    at getStatusBlock (js/blocks.js:897)
    at handleDevice (js/blocks.js:1342)
    at deviceUpdateHandler (js/blocks.js:394)
    at js/blocks.js:448
    at ListObservable.subscribe (js/domoticz-api.js:421)
    at Object._subscribe [as subscribe] (js/domoticz-api.js:342)
    at addDeviceUpdateHandler (js/blocks.js:446)
    at getBlock (js/blocks.js:307)
    at buildScreens (<anonymous>:457:29)
    at onLoad (<anonymous>:241:5)

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 21:13
by Lokonli
I think I've found the issue.

Try the following in custom.js for the getExtendedBlockTypes function:

Code: Select all

function getExtendedBlockTypes(blocktypes){
    blocktypes.SubType['Soil Moisture'] = {
        icon: 'fas fa-seedling',
        title: '<Name>',
        value: '<Data> <Desc>',
    };
    return blocktypes;
}


Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 21:18
by florisi
that's working.
The device shows:

41 cb irrigation advise.

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 21:21
by Lokonli
florisi wrote: Wednesday 01 April 2020 21:18 that's working.
The device shows:

41 cb irrigation advise.
Good. Time to water the plants :)

Apparently subdevices cannot be generated from a SubType device block at the moment, but that can be changed.

Do you prefer one or two devices?

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 21:24
by florisi
I prefer two devices if it. is not to much work.
Will check tomorrow.

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 21:37
by Gianni
how can i upgrade from this.
my version is 3.3.4 beta

git checkout beta

Already on 'beta'
Your branch is up to date with 'origin/beta'.
gianni@domotic:/var/www/html/homecontrol $ git pull
Already up to date.
gianni@domotic:/var/www/html/homecontrol $

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 21:45
by Lokonli
What do you get with:

Code: Select all

git remote -v

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 21:48
by Gianni
@lokonli you was faster then me :-)

was already testing

Code: Select all

gianni@domotic:/var/www/html/homecontrol $ git remote -v
origin  https://github.com/dashticzv3/dashticz_v3 (fetch)
origin  https://github.com/dashticzv3/dashticz_v3 (push)
gianni@domotic:/var/www/html/homecontrol $ git status
On branch beta
Your branch is up to date with 'origin/beta'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)


[code]

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 21:57
by Lokonli
You are using my old repository...

Code: Select all

git remote set-url origin https://github.com/Dashticz/dashticz
git pull

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 22:02
by Gianni
1 step + but abort error now

Code: Select all

gianni@domotic:/var/www/html/homecontrol $ git pull
remote: Enumerating objects: 646, done.
remote: Counting objects: 100% (646/646), done.
remote: Compressing objects: 100% (106/106), done.
remote: Total 2610 (delta 567), reused 585 (delta 538), pack-reused 1964
Receiving objects: 100% (2610/2610), 13.66 MiB | 5.72 MiB/s, done.
Resolving deltas: 100% (1729/1729), completed with 81 local objects.
From https://github.com/Dashticz/dashticz
   68a376c..6b4374a  beta                                -> origin/beta
 * [new branch]      blocks                              -> origin/blocks
 * [new branch]      dependabot/npm_and_yarn/acorn-6.4.1 -> origin/dependabot/npm_and_yarn/acorn-6.4.1
 + 11e431f...e67ca60 master                              -> origin/master  (forced update)
 * [new tag]         v3.0.0                              -> v3.0.0
 * [new tag]         v3.0.3-beta                         -> v3.0.3-beta
 * [new tag]         v3.0.4-beta                         -> v3.0.4-beta
 * [new tag]         v3.0.5                              -> v3.0.5
 * [new tag]         v3.0.6                              -> v3.0.6
 * [new tag]         v3.0.6-beta                         -> v3.0.6-beta
 * [new tag]         v3.1.0-beta                         -> v3.1.0-beta
 * [new tag]         v3.1.1-beta                         -> v3.1.1-beta
 * [new tag]         v3.1.2                              -> v3.1.2
 * [new tag]         v3.3.2                              -> v3.3.2
 * [new tag]         v3.3.3                              -> v3.3.3
 * [new tag]         v3.3.4-beta                         -> v3.3.4-beta
 * [new tag]         v3.4.1-beta                         -> v3.4.1-beta
Updating 68a376c..6b4374a
error: Your local changes to the following files would be overwritten by merge:
        .gitignore
        Dockerfile
        Makefile
        README.md
        css/creative.css
        docs/blocks/blocks.rst
        docs/blocks/buttons.rst
        docs/blocks/domoticzblocks.rst
        docs/blocks/frames.rst
        docs/blocks/specials/calendar.rst
        docs/blocks/specials/garbage.rst
        docs/blocks/specials/news.rst
        docs/blocks/specials/publictransport.rst
        docs/blocks/specials/streamplayer.rst
        docs/blocks/specials/trafficinfo.rst
        docs/blocks/specials/tvguide.rst
        docs/blocks/specials/weather.rst
        docs/customcss/customcss.rst
        docs/customjss/customjss.rst
        docs/dashticzconfiguration.rst
        docs/develop/code.rst
        docs/develop/documentation.rst
        docs/gettingstarted/automaticinstall.rst
        docs/gettingstarted/basicdashboard.rst
        docs/gettingstarted/manualinstall.rst
        docs/index.rst
        docs/releasenotes.rst
        docs/screens.rst
        docs/tipsandtricks.rst
        index.html
        index2.html
        js/blocks.js
        js/calendar.js
        js/chromecast.js
        js/garbage.js
        js/graphs.js
        js/login.js
        js/main.js
        js/publictransport.js
        js/settings.js
        js/sonarr.js
        js/switches.js
        js/thermostat.js
        js/version.js
        js/weather_owm.js
        lang/bs_BA.json
        lang/ca_ES.json
        lang/cs_CZ.json
        lang/da_DK.json
        lang/de_DE.json
        lang/en_US.json
        lang/es_ES.json
        lang/fi_FI.json
        lang/fr_FR.json
        lang/hu_HU.json
        lang/it_IT.json
        lang/lt_LT.json
        lang/nb_NO.json
        lang/nl_NL.json
        lang/nn_NO.json
        lang/pl_PL.json
        lang/pt_PT.json
        lang/ro_RO.json
        lang/ru_RU.json
        lang/sk_SK.json
        lang/sl_SI.json
        lang/sr_RS.json
        lang/sv_SE.json
        lang/tr_TR.json
        lang/uk_UA.json
        lang/zh_CN.json
        scripts/dashticz_install.sh
        vendor/dashticz/ical/index.php
        version.txt
Please commit your changes or stash them before you merge.
error: The following untracked working tree files would be overwritten by merge:
        .babelrc
        .eslintrc.js
        .vscode/settings.json
        babel.config.js
        css/secpanel.css
        dist/0724bb8b89ab6b8b9b7df917b17be0b7.svg
        dist/57dcda6f368ea90179f75cbdae96c263.eot
        dist/5d0861781aeef6c82fda3a3076954a1b.svg
        dist/75f38a159982b6bd1704891332d95fa7.ttf
        dist/89889688147bd7575d6327160d64e760.svg
        dist/89e02bae13c9131c7468b1e729339ac1.eot
        dist/9d67fa1429375bd2a899a17eb77d0342.svg
        dist/9ec698d1a597bff5df337094b71ddaaf.ttf
        dist/assets/images/ui-icons_444444_256x240.png
        dist/assets/images/ui-icons_555555_256x240.png
        dist/assets/images/ui-icons_777620_256x240.png
        dist/assets/images/ui-icons_777777_256x240.png
        dist/assets/images/ui-icons_cc0000_256x240.png
        dist/assets/images/ui-icons_ffffff_256x240.png
        dist/bundle.js
        docs/blocks/graphs.rst
        docs/blocks/img/climate.jpg
        docs/blocks/img/climate_te_hu.jpg
        docs/blocks/img/customlabels.jpg
        docs/blocks/img/evohome.png
        docs/blocks/img/graph_buttons1.png
        docs/blocks/img/graph_buttons2.png
        docs/blocks/img/graph_buttons3.png
        docs/blocks/img/graph_buttons4.png
        docs/blocks/img/graph_debug.jpg
        docs/blocks/img/graph_groupby_day.png
        docs/blocks/img/graph_zoom_x.jpg
        docs/blocks/img/graph_zoom_x2.jpg
        docs/blocks/img/group_by_device_1.png
        docs/blocks/img/group_by_device_2.png
        docs/blocks/img/group_by_device_3.png
        docs/blocks/img/muligraph_patch4_1.png
        docs/blocks/img/muligraph_patch4_2.png
        docs/blocks/img/muligraph_patch4_3.png
        docs/blocks/img/muligraph_patch4_4.png
        docs/blocks/img/muligraph_patch4_5.png
        docs/blocks/img/multigraph3.png
        docs/blocks/img/multigraph4.png
        docs/blocks/img/multigraph5.png
        docs/blocks/img/multigraph6.png
        docs/blocks/img/multigraph_button_styling.jpg
        docs/blocks/img/multigraph_custom.png
        docs/blocks/img/multigraph_point_styling.jpg
        docs/blocks/img/multigraph_setpoints.png
        docs/blocks/img/p1.jpg
        docs/blocks/img/p1_custom.jpg
        docs/blocks/img/p1_legend.jpg
        docs/blocks/img/p1_legend_2.jpg
        docs/blocks/img/solar_1_default.jpg
        docs/blocks/img/solar_custom_legend.jpg
        docs/blocks/img/solar_default.jpg
        docs/blocks/img/solar_legend.jpg
        docs/blocks/img/solar_yellow_bar.jpg
        docs/blocks/img/water.jpg
        docs/blocks/specials/img/calendar1.jpg
        docs/blocks/specials/security_panel.rst
        docs/blocks/specials/security_panel_block.jpg
        docs/blocks/specials/security_panel_frame.jpg
        docs/customcss/specialclasses.jpg
        docs/customjs/customjs.rst
        docs/img/dashticz-websocket.gif
        docs/releasenotes/index.rst
        docs/releasenotes/releasenotes.rst
        docs/releasenotes/upgrading/upgrading.rst
        docs/releasenotes/upgrading/v320.rst
        font/Audiowide.eot
        font/Audiowide.svg
        font/Audiowide.ttf
        font/Audiowide.woff
        font/Digital.eot
        font/Digital.svg
        font/Digital.ttf
        font/Digital.woff
        img/curtainclosed.png
        img/curtainopen.png
        img/dishwasher_240px.png
        img/dishwasher_off.png
        img/dishwasher_on.png
        img/evohome.png
        img/hot_water_on.png
        img/speaker_off.png
        img/speaker_on.png
        img/tv_off.png
        js/components/blocktitle.js
        js/components/button.js
        js/components/frame.js
        js/components/graph.js
        js/components/longfonds.js
        js/components/news.js
        js/components/publictransport.js
        js/components/secpanel.js
        js/components/stationclock.js
        js/components/streamplayer.js
        js/components/traffic.js
        js/components/trafficinfo.js
        js/components/train.js
        js/components/tvguide.js
        js/dashticz.js
        js/domoticz-api.js
        package.json
        sounds/arm.aac
        sounds/arm.mp3
        sounds/arm.ogg
        sounds/disarm.aac
        sounds/disarm.mp3
        sounds/disarm.ogg
        sounds/key.aac
        sounds/key.mp3
        sounds/key.ogg
        sounds/wrongcode.aac
        sounds/wrongcode.mp3
        sounds/wrongcode.ogg
        src/functions.js
        src/index.js
        src/templateengine.js
        vendor/dashticz/ical/composer.json
        vendor/dashticz/ical/composer.lock
        vendor/dashticz/ical/ical5/SG_iCal.php
        vendor/dashticz/ical/ical5/blocks/SG_iCal_VCalendar.php
        vendor/dashticz/ical/ical5/blocks/SG_iCal_VEvent.php
        vendor/dashticz/ical/ical5/blocks/SG_iCal_VTimeZone.php
        vendor/dashticz/ical/ical5/helpers/SG_iCal_Duration.php
        vendor/dashticz/ical/ical5/helpers/SG_iCal_Factory.php
        vendor/dashticz/i
Aborting

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 22:09
by Lokonli
Maybe better to start over, make a new clone from github and copy your previous CONFIG.js, custom.css and custom.js files.

Re: Update from v3.3.3.1 (stable) to v3.4.1 (beta)

Posted: Wednesday 01 April 2020 22:13
by Gianni
yep did that now :lol:
but still a error with garb....... :-p(offtopic try the auto install garb still not working)