Dashticz - Save CONFIG.js automatically with PHP

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: robgeerts, htilburgs

User avatar
robgeerts
Posts: 1233
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: 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?
Send:
- XVG to D8fwNbyV6YxJk1aSiXftWTtdaPipsKn2Fa
- ANY ERC20-TOKEN to 0x9b8ee84329d77765a28bca188218c6c793875a8a

or donate via PayPal: https://www.paypal.me/robgeerts

dutchdevil83
Posts: 152
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: 1239
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: 1233
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: 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?
Send:
- XVG to D8fwNbyV6YxJk1aSiXftWTtdaPipsKn2Fa
- ANY ERC20-TOKEN to 0x9b8ee84329d77765a28bca188218c6c793875a8a

or donate via PayPal: https://www.paypal.me/robgeerts

pvm
Posts: 930
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: 1239
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 2893 times
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

pvm
Posts: 930
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: 1239
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: 1239
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: 1239
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: 1233
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: 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?
Send:
- XVG to D8fwNbyV6YxJk1aSiXftWTtdaPipsKn2Fa
- ANY ERC20-TOKEN to 0x9b8ee84329d77765a28bca188218c6c793875a8a

or donate via PayPal: https://www.paypal.me/robgeerts

pvm
Posts: 930
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: 1239
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: 163
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: 163
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: 163
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?

User avatar
gielie
Posts: 219
Joined: Tuesday 12 January 2016 12:40
Target OS: Raspberry Pi
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by gielie » Friday 09 February 2018 17:26

in my system the save option doesn't work, before, when i pushed save, i got an page with the settings which i had to copy to the config.js but i don't get this anymore how can i get this back?
- Vision ZU1401 USB Stick
- Aeotec MultiSensor 6
- FIBARO FGS222
- FIBARO FGWPE Wall Plug
- Everspring AN157
- Neo CoolCam Power plug
- Neo CoolCam PIR Sensor
- Popp Smoke Detector
- Toon
- Kodi Media Server

michaelm86
Posts: 28
Joined: Friday 02 February 2018 12:36
Target OS: Linux
Domoticz version: 3.8153
Location: Netherlands
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by michaelm86 » Monday 12 February 2018 11:04

Hi Guys,

i have installed the beta of dashticz on my ubuntu server. But when i lauch it the first time. the changed are not saved to config.js.

i did the following :

- installed ubuntu and comfiguratio
- installed php 7
- installed and configured domoticz (working adn using it)
- git clone https://github.com/robgeerts/dashticz_v2 --branch beta
- sudo chmod 777 -R domoticz/
- sudo cp CONFIG_DEFAULT.js CONFIG.js
- lauched the web browser and accessed the ip of my server http://192.168.116.80:8080/dashticz_v2/

can anyone help me ou? :)
Domoticz 3.8153 on linux laptop ubuntu 17.10 | Toon Thermostat | RFlink usb gateway

User avatar
DewGew
Posts: 237
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi
Domoticz version: V4.9741
Location: Sweden
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by DewGew » Monday 12 February 2018 11:34

michaelm86 wrote:
Monday 12 February 2018 11:04
Hi Guys,

i have installed the beta of dashticz on my ubuntu server. But when i lauch it the first time. the changed are not saved to config.js.

i did the following :

- installed ubuntu and comfiguratio
- installed php 7
- installed and configured domoticz (working adn using it)
- git clone https://github.com/robgeerts/dashticz_v2 --branch beta
- sudo chmod 777 -R domoticz/
- sudo cp CONFIG_DEFAULT.js CONFIG.js
- lauched the web browser and accessed the ip of my server http://192.168.116.80:8080/dashticz_v2/

can anyone help me ou? :)
Edit CONFIG.js and put only this and try again:

Code: Select all

var config = {}
config['domoticz_ip'] = 'http://ipnumber:port';
config['app_title'] = 'Dashticz';
config['domoticz_refresh'] = '5';
config['dashticz_refresh'] = '60';
Last edited by DewGew on Monday 12 February 2018 11:36, edited 1 time in total.
Raspberry Pi 2B - domoticz - Aeon Labs Z-Stick GEN5 - RFlink gateway
NanoPi NEO-air - domoticz - REGO6XX interface
Dashticz V2 - Homebridge

michaelm86
Posts: 28
Joined: Friday 02 February 2018 12:36
Target OS: Linux
Domoticz version: 3.8153
Location: Netherlands
Contact:

Re: Dashticz - Save CONFIG.js automatically with PHP

Post by michaelm86 » Monday 12 February 2018 11:36

Hi DewGew,

I tried this. but is does not work ... :(

when i add the ip and port is does not see it in the config. but when i add the user and ww it sees it.

any other options?
Domoticz 3.8153 on linux laptop ubuntu 17.10 | Toon Thermostat | RFlink usb gateway

Post Reply

Who is online

Users browsing this forum: EdwinK and 4 guests