Dashticz - Save CONFIG.js automatically with PHP

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: htilburgs, robgeerts

Post Reply
User avatar
robgeerts
Posts: 1140
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: Son, NL
Contact:

Dashticz - Save CONFIG.js automatically with PHP

Post by robgeerts » Sunday 01 October 2017 13:31

In latest BETA-version, the config will be saved automatically to CONFIG.js with PHP.
Please backup your config.js ;)

Make sure your CONFIG.js is writable.
If it doesnt save the file, you will still get the screen where you can copy the config!
Creator of Dashticz, Do you appreciate my work and want to buy me a beer? You can send Bitcoins to 17Qy4bsLM9J238fCZt5kaRc2bD5S1Aw6og or donate via PayPal: https://www.paypal.me/robgeerts

dutchdevil83
Posts: 151
Joined: Monday 31 October 2016 20:34
Target OS: Raspberry Pi
Domoticz version: latest
Location: Netherlands
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by dutchdevil83 » Sunday 01 October 2017 13:48

Wow, nice work. Going to try it in a moment. You had a good vacation?

Just tested:
1) When clicking the settings icon and clicking save it saves so this is good
2) When going into EDIT mode my changes aren`t save to the config file and still have to this manually
Hardware
1x Raspberry Pi
1x Razberry Z-Wave
1x RFXtrx433E
1x Toon
1x GoodWe Solarpanels
2x FGSD-002 Smoke Detector
1x FGBS-001 Binaire Sensor (RFID lezer)
7x FGMS-001 Motion Sensor
3x ZW089 Verzonken Deursensor
7x NC Wallplug
&lots of KaKu stuff

User avatar
EdwinK
Posts: 921
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by EdwinK » Sunday 01 October 2017 19:43

It doesn't seem to save. If I change anything in settings and click 'save', the page refreshes, but no changes visible. I do believe I have PHP enabled on the webserver.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

User avatar
robgeerts
Posts: 1140
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: Son, NL
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by robgeerts » Sunday 01 October 2017 22:10

You do believe or are you sure? ;)
And is the file writable (chmod)
Creator of Dashticz, Do you appreciate my work and want to buy me a beer? You can send Bitcoins to 17Qy4bsLM9J238fCZt5kaRc2bD5S1Aw6og or donate via PayPal: https://www.paypal.me/robgeerts

pvm
Posts: 925
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: Stable
Location: NL
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by pvm » Tuesday 03 October 2017 15:08

Nice job, did a quick test by changing the dashboard title, that works.
Changing contents of the dashboard by f.e. adding a clock is not saved (beta version downloaded today ("Latest commit 957b89e 2 days ago"))
I started from default installation with only the correct IP set. After the first test I also tried to change config['auto_positioning'] to 0 (was on 1 before), but that also did not solve the issue. Will it be possible to switch auto_positioning from the web-config-interface in the future?

(for users with issues, I'm running Dashticz on my Synology nas, made the file write-able for the 'http' user by right clicking on the file in 'File Station')
Synology NAS, PI3, ZWave, Xiamo zigbee devices, BTLE plant sensor

User avatar
EdwinK
Posts: 921
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by EdwinK » Tuesday 03 October 2017 17:43

pvm wrote:
Tuesday 03 October 2017 15:08
(for users with issues, I'm running Dashticz on my Synology nas, made the file write-able for the 'http' user by right clicking on the file in 'File Station')
You mean, like this?
Screen Shot 2017-10-03 at 17.42.20.png
Screen Shot 2017-10-03 at 17.42.20.png (46.44 KiB) Viewed 858 times
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

pvm
Posts: 925
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: Stable
Location: NL
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by pvm » Tuesday 03 October 2017 18:18

Yes, hope it helps you. Can you change the dashboard title now?
Synology NAS, PI3, ZWave, Xiamo zigbee devices, BTLE plant sensor

User avatar
EdwinK
Posts: 921
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by EdwinK » Tuesday 03 October 2017 18:26

Nope. Tried, but nothing changes.
Maybe it's the PHP version I'm using. It's 5.6 (if I'm not mistaken) on Synology.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

User avatar
EdwinK
Posts: 921
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by EdwinK » Tuesday 03 October 2017 19:05

It does seem to change the config.js file, but doesn't show when page is reloaded. Something to figure out next time.

Reading through the config.js file, it looks like all config blocks are there at least twice (last count 5 times, because I tried it several times), one with the new settings, and below that are the old settings. So, first the title is defined as Control-Center, but... in the second (old) part the title is defined as ControlCenter. I think the latest read by the browser is what it is going to use for the page.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

User avatar
EdwinK
Posts: 921
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by EdwinK » Tuesday 03 October 2017 19:17

Code: Select all

//var _EDIT_MODE = true;

var config = {}
config['domoticz_ip'] = 'http://192.168.0.10:8084';
config['app_title'] = 'ControlCenter';
config['domoticz_refresh'] = '15';
config['dashticz_refresh'] = '60';
config['default_news_url'] = 'http://www.nu.nl/rss/algemeen';
config['news_scroll_after'] = 7;
config['standby_after'] = 'false';
config['auto_swipe_back_to'] = 1;
config['auto_swipe_back_after'] = 0;
config['auto_slide_pages'] = 0;
config['slide_effect'] = 'slide';
config['standard_graph'] = 'day';
config['language'] = 'nl_NL';
config['timeformat'] = 'YY-MM-DD HH:mm';
config['calendarformat'] = 'dd DD.MM HH:mm';
config['calendarlanguage'] = 'nl_NL';
config['calendarurl'] = 0;
config['boss_stationclock'] = 'RedBoss';
config['gm_api'] = 'SECRET';
config['gm_zoomlevel'] = '11';
config['gm_latitude'] = '51.860067';
config['gm_longitude'] = '4.412692';
config['wu_api'] = '17318c1fc1678195';
config['wu_city'] = 'Rhoon';
config['wu_name'] = 0;
config['wu_country'] = 'NL';
config['idx_moonpicture'] = 1;
config['switch_horizon'] = 0;
config['host_nzbget'] = 0;
config['spot_clientid'] = 'More Secret–';
config['sonarr_url'] = 0;
config['sonarr_apikey'] = 0;
config['sonarr_maxitems'] = 0;
config['garbage_company'] = 'recyclemanager';
config['garbage_icalurl'] = 0;
config['garbage_zipcode'] = '3161LH';
config['garbage_street'] = 'Jonkerhof';
config['garbage_housenumber'] = '27';
config['garbage_maxitems'] = 1;
config['garbage_width'] = '12';
config['selector_instead_of_buttons'] = 1;
config['auto_positioning'] = 0;
config['use_favorites'] = 0;
config['last_update'] = 0;
config['hide_off_button'] = 1;
config['hide_topbar'] = 0;
config['edit_mode'] = 0;
config['hide_seconds'] = 0;
config['hide_seconds_stationclock'] = 0;
config['use_fahrenheit'] = 0;
config['use_beaufort'] = 1;
config['translate_windspeed'] = 0;
config['static_weathericons'] = 0;
config['hide_mediaplayer'] = 0;
config['garbage_hideicon'] = 0;

config['domoticz_ip'] = 'http://192.168.0.10:8084';
config['app_title'] = 'Control-Center';
config['domoticz_refresh'] = '15';
config['dashticz_refresh'] = '60';
config['default_news_url'] = 'http://www.nu.nl/rss/algemeen';
config['news_scroll_after'] = 7;
config['standby_after'] = 'false';
config['auto_swipe_back_to'] = 1;
config['auto_swipe_back_after'] = 0;
config['auto_slide_pages'] = 0;
config['slide_effect'] = 'slide';
config['standard_graph'] = 'day';
config['language'] = 'nl_NL';
config['timeformat'] = 'YY-MM-DD HH:mm';
config['calendarformat'] = 'dd DD.MM HH:mm';
config['calendarlanguage'] = 'nl_NL';
config['calendarurl'] = 0;
config['boss_stationclock'] = 'RedBoss';
config['gm_api'] = 'TOP SECRET';
config['gm_zoomlevel'] = '11';
config['gm_latitude'] = '51.860067';
config['gm_longitude'] = '4.412692';
config['wu_api'] = '17318c1fc1678195';
config['wu_city'] = 'Rhoon';
config['wu_name'] = 0;
config['wu_country'] = 'NL';
config['idx_moonpicture'] = 1;
config['switch_horizon'] = 0;
config['host_nzbget'] = 0;
config['spot_clientid'] = 'MY EYES ONLY';
config['sonarr_url'] = 0;
config['sonarr_apikey'] = 0;
config['sonarr_maxitems'] = 0;
config['garbage_company'] = 'recyclemanager';
config['garbage_icalurl'] = 0;
config['garbage_zipcode'] = '3161LH';
config['garbage_street'] = 'Jonkerhof';
config['garbage_housenumber'] = '27';
config['garbage_maxitems'] = 1;
config['garbage_width'] = '12';
config['selector_instead_of_buttons'] = 1;
config['auto_positioning'] = 0;
config['use_favorites'] = 0;
config['last_update'] = 0;
config['hide_off_button'] = 1;
config['hide_topbar'] = 0;
config['edit_mode'] = 0;
config['hide_seconds'] = 0;
config['hide_seconds_stationclock'] = 0;
config['use_fahrenheit'] = 0;
config['use_beaufort'] = 1;
config['translate_windspeed'] = 0;
config['static_weathericons'] = 0;
config['hide_mediaplayer'] = 0;
config['garbage_hideicon'] = 0;
And everytime I save the from the webbrowser a new block like this is added
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

User avatar
robgeerts
Posts: 1140
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: Son, NL
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by robgeerts » Friday 06 October 2017 12:25

Could you send me your complete config.js?
Creator of Dashticz, Do you appreciate my work and want to buy me a beer? You can send Bitcoins to 17Qy4bsLM9J238fCZt5kaRc2bD5S1Aw6og or donate via PayPal: https://www.paypal.me/robgeerts

pvm
Posts: 925
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: Stable
Location: NL
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by pvm » Friday 06 October 2017 16:42

I do not see the effect of continuous adding of blocks. I'm not able to add any blocks however.
Do I need to specify columns or should everything be possible from within the web-interface?
(when setting auto positioning to 1 i see my favorites)

When I use the chrome web-interface nothing happens when pressing save after adding some blocks. The save button in the settings screen does generate a lot of calls and a refresh op the page.
Is there any more info I can provide?


My config (changed app_title, / coordinates
Spoiler: show
var config = {}
config['domoticz_ip'] = 'http://192.168.1.2:8084';
config['app_title'] = 'ABCD';
config['domoticz_refresh'] = 5;
config['dashticz_refresh'] = '60';
config['default_news_url'] = 'http://www.nu.nl/rss/algemeen';
config['news_scroll_after'] = 7;
config['standby_after'] = 0;
config['auto_swipe_back_to'] = 1;
config['auto_swipe_back_after'] = '10';
config['auto_slide_pages'] = '';
config['slide_effect'] = 'slide';
config['standard_graph'] = 'hours';
config['language'] = 'nl_NL';
config['timeformat'] = 'DD-MM-YY HH:mm';
config['calendarformat'] = 'dd DD.MM HH:mm';
config['calendarlanguage'] = 'nl_NL';
config['calendarurl'] = '';
config['boss_stationclock'] = 'RedBoss';
config['gm_api'] = '';
config['gm_zoomlevel'] = '';
config['gm_latitude'] = '11';
config['gm_longitude'] = '22';
config['wu_api'] = '';
config['wu_city'] = 'Amsterdam';
config['wu_name'] = '';
config['wu_country'] = 'NL';
config['idx_moonpicture'] = '';
config['switch_horizon'] = '';
config['host_nzbget'] = '';
config['spot_clientid'] = '';
config['sonarr_url'] = '';
config['sonarr_apikey'] = '';
config['sonarr_maxitems'] = '';
config['garbage_company'] = '';
config['garbage_icalurl'] = '';
config['garbage_zipcode'] = '';
config['garbage_street'] = '';
config['garbage_housenumber'] = '';
config['garbage_maxitems'] = '';
config['garbage_width'] = '';
config['selector_instead_of_buttons'] = 0;
config['auto_positioning'] = 0;
config['use_favorites'] = 1;
config['last_update'] = 1;
config['hide_off_button'] = 0;
config['hide_topbar'] = 0;
config['edit_mode'] = 1;
config['hide_seconds'] = 0;
config['hide_seconds_stationclock'] = 0;
config['use_fahrenheit'] = 0;
config['use_beaufort'] = 0;
config['translate_windspeed'] = 1;
config['static_weathericons'] = 0;
config['hide_mediaplayer'] = 0;
config['garbage_hideicon'] = 0;
Synology NAS, PI3, ZWave, Xiamo zigbee devices, BTLE plant sensor

User avatar
EdwinK
Posts: 921
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by EdwinK » Friday 06 October 2017 19:00

robgeerts wrote:
Friday 06 October 2017 12:25
Could you send me your complete config.js?
Will do.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

Blueone
Posts: 160
Joined: Friday 29 November 2013 12:30
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by Blueone » Thursday 12 October 2017 9:56

Does someknow know what chmod I have to use to make sure the config.js is writable for the webuser?

Blueone
Posts: 160
Joined: Friday 29 November 2013 12:30
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by Blueone » Thursday 26 October 2017 11:14

I tried a lot to write the config automatically to the config.js, it doesn't work om my end. Does anyone have an idea about how to fix this?

Blueone
Posts: 160
Joined: Friday 29 November 2013 12:30
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by Blueone » Thursday 16 November 2017 17:10

anyone knows how to do this?

Post Reply

Who is online

Users browsing this forum: Siopaos and 2 guests