IMPORTANT REQUEST!!!

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: robgeerts, htilburgs

User avatar
Thuis
Posts: 68
Joined: Tuesday 11 September 2018 11:36
Target OS: -
Domoticz version: 2.9700
Location: The Netherlands
Contact:

Re: IMPORTANT REQUEST!!!

Post by Thuis » Tuesday 23 October 2018 12:56

Im trying to instal Rasbian on a Xeon N270 to see if there is any difference when i use linux, so far, the installer is busy, installing it to the hard drive...
On windows no luck yet, but i think, luck has nothing to do with it :-p
p1 Smartmeter, CM15Pro, Lyric T6, Sonoff, Xiaomi Aqara, Intel Xeon.

EastXIII
Posts: 19
Joined: Monday 08 October 2018 13:56
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: IMPORTANT REQUEST!!!

Post by EastXIII » Tuesday 23 October 2018 12:57

lightmanster wrote:
Friday 19 October 2018 13:39

...

also add:
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>

to your webserver config if you get Access-Control_allow-origin error

Kind regards
LM
Can you please specify where to put this in Apache2? I get this error all the time. Header module enabled and added this to apache2.conf
But I still get the mentioned error. I'm stuck!

peerkersezuuker
Posts: 41
Joined: Monday 14 December 2015 23:16
Target OS: Raspberry Pi
Domoticz version:
Location: Mierlo
Contact:

Re: IMPORTANT REQUEST!!!

Post by peerkersezuuker » Tuesday 23 October 2018 17:12

In Linux you can change the php version for apache.
Login with ssh to your machine and :

sudo a2dismod php5.6
sudo a2enmod php7.2
sudo apt-get install php7.2-curl
sudo service apache2 restart

peerkersezuuker
Posts: 41
Joined: Monday 14 December 2015 23:16
Target OS: Raspberry Pi
Domoticz version:
Location: Mierlo
Contact:

Re: IMPORTANT REQUEST!!!

Post by peerkersezuuker » Tuesday 23 October 2018 17:14

@EastXII
I have set it in my virtual host config in /etc/apache2/sites-enabled/domoticz.sonnehoek.nl.conf

<VirtualHost 192.168.0.20:880>
# Always set these headers.
Header always set Access-Control-Allow-Origin "*"
DocumentRoot /var/www/dashticz_v2
ServerName domoticz.sonnehoek.nl
<Directory "/var/www/dashticz_v2">
allow from all
Options Indexes FollowSymLinks
Require all granted
</Directory>
</VirtualHost>

jake
Posts: 485
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: IMPORTANT REQUEST!!!

Post by jake » Tuesday 23 October 2018 23:18

Thanks for all your tips and tricks guys. Over time my system must have become messy. I decided to wipe out everything that 'smelled' like PHP and start over.

To delete all PHP packages (I had 5.6, 7.0 and 7.2 packages installed)

Code: Select all

sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
Install PHP 7.2:
I followed the instructions (for the PHP7.2 part) on this website

After a restart of the apache2 webserver

Code: Select all

sudo service apache2 restart
the agenda came back to life.

The garbage is still not working. To outrule possible not updated HVC code, I decided to use the postal code/house number in the file garbage.js from the 'mijnafvalwijzer' and add those to my CONFIG.js. I double checked the combination on the mijnafvalwijzer website and the postal code / house number is a valid one.
Unfortunately it doesn't help. The block still shows 'loading...'

Adaption on garbage.js:

Code: Select all

	$.getJSON(getPrefixUrl() + 'http://127.0.0.1/beta2/dashboard/vendor/dashticz/afval/?service='+service+'&sub='+subservice+'&zipcode=' + address.zipcode + '&nr=' + address.housenumber + '&t=' + address.housenumberSuffix, function (data) {
Last edited by jake on Wednesday 24 October 2018 20:09, edited 1 time in total.

Lokonli
Posts: 110
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: IMPORTANT REQUEST!!!

Post by Lokonli » Wednesday 24 October 2018 0:06

If agenda is working then php is working.

I guess the url is not correct.

Press F12 in the browser. Probably there is an error.

What is the output in your browser if you go to: http://127.0.0.1/beta2/dashboard/vendor/dashticz/afval/
(should be: [])

If dashticz and the afval module are installed on the same server, same location then in garbage.js you can try the following:

Code: Select all

	$.getJSON('./vendor/dashticz/afval/?service='+service+'&sub='+subservice+'&zipcode=' + address.zipcode + '&nr=' + address.housenumber + '&t=' + address.housenumberSuffix, function (data) {

poudenes
Posts: 594
Joined: Wednesday 08 March 2017 10:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: IMPORTANT REQUEST!!!

Post by poudenes » Wednesday 24 October 2018 9:49

skip. ignore this post
RPi3 with OSMC - RPi3 with Domoticz - Dashticz - MiLight - Nanolead Aurora - KaKu - Logitech Hamony - Nest - RFLink

jake
Posts: 485
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: IMPORTANT REQUEST!!!

Post by jake » Wednesday 24 October 2018 14:47

Lokonli wrote: If dashticz and the afval module are installed on the same server, same location then in garbage.js you can try the following:

Code: Select all

	$.getJSON('./vendor/dashticz/afval/?service='+service+'&sub='+subservice+'&zipcode=' + address.zipcode + '&nr=' + address.housenumber + '&t=' + address.housenumberSuffix, function (data) {
I'm booking progress now: instead of that the garbage block tells me 'laden...' it shows 'geen gegevens gevonden'.

Once again I changed company names /address (deafvalapp with corresponding and working address), but with the same result.

I loaded dashticz on my desktop to check for the error log in the browser. This is what it gives me:
Spoiler: show
Source map error: request failed with status 404
Resource URL: http://192.168.x.yz/beta2/dashboard/vendor/head.js
Source Map URL: head.load.min.js.map[Learn More]
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/ jquery.min.js:4:15141
Source map error: TypeError: NetworkError when attempting to fetch resource.
Resource URL: null
Source Map URL: ical.min.js.map[Learn More]
Source map error: TypeError: NetworkError when attempting to fetch resource.
Resource URL: null
Source Map URL: maps/swiper.min.js.map[Learn More]
Loading failed for the <script> with source “https://az416426.vo.msecnd.net/scripts/a/ai.0.js”.
Doesn't seem related to garbage, but probably to the use of 'pihole' that blocks advertisements.
Last edited by jake on Wednesday 24 October 2018 20:08, edited 1 time in total.

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

Re: IMPORTANT REQUEST!!!

Post by EdwinK » Wednesday 24 October 2018 18:09

poudenes wrote:
Wednesday 24 October 2018 9:49
skip. ignore this post
Sorry, no can do ;)
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | RFxcom | Dashticz V2

Lokonli
Posts: 110
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: IMPORTANT REQUEST!!!

Post by Lokonli » Wednesday 24 October 2018 20:38

jake wrote:
Wednesday 24 October 2018 14:47
Lokonli wrote: If dashticz and the afval module are installed on the same server, same location then in garbage.js you can try the following:

Code: Select all

	$.getJSON('./vendor/dashticz/afval/?service='+service+'&sub='+subservice+'&zipcode=' + address.zipcode + '&nr=' + address.housenumber + '&t=' + address.housenumberSuffix, function (data) {
I'm booking progress now: instead of that the garbage block tells me 'laden...' it shows 'geen gegevens gevonden'.

Once again I changed company names /address (deafvalapp with corresponding and working address), but with the same result.

I loaded dashticz on my desktop to check for the error log in the browser. This is what it gives me:
Spoiler: show
Source map error: request failed with status 404
Resource URL: http://192.168.x.yz/beta2/dashboard/vendor/head.js
Source Map URL: head.load.min.js.map[Learn More]
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/ jquery.min.js:4:15141
Source map error: TypeError: NetworkError when attempting to fetch resource.
Resource URL: null
Source Map URL: ical.min.js.map[Learn More]
Source map error: TypeError: NetworkError when attempting to fetch resource.
Resource URL: null
Source Map URL: maps/swiper.min.js.map[Learn More]
Loading failed for the <script> with source “https://az416426.vo.msecnd.net/scripts/a/ai.0.js”.
Doesn't seem related to garbage, but probably to the use of 'pihole' that blocks advertisements.
Double check you have the correct settings in CONFIG.js:

Code: Select all

config['garbage_company'] = 'deafvalapp';
config['garbage_icalurl'] = '';
config['garbage_calendar_id'] = '';
config['garbage_zipcode'] = '5692VG';
config['garbage_street'] = '0';
config['garbage_housenumber'] = '33';

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

Re: IMPORTANT REQUEST!!!

Post by robgeerts » Wednesday 24 October 2018 21:15

Wow had to read back a lot and good to see that most off you already have it working again!!
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

stuffer
Posts: 10
Joined: Sunday 07 June 2015 9:36
Target OS: Linux
Domoticz version: 3.6367
Location: Utrecht
Contact:

Re: IMPORTANT REQUEST!!!

Post by stuffer » Wednesday 24 October 2018 21:41

robgeerts wrote:
Wednesday 24 October 2018 21:15
Wow had to read back a lot and good to see that most off you already have it working again!!
@robgeerts

Almost :-)

First I want to thank you for the project. A crate of beer is on his way when I get this working :-) (or at the Jumbo 1,5 for the price for one )

What I did on my Ubuntu 16 machine for domoticz:

apt install apache2
apt-get install python-software-properties
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php7.2
apt-get install php7.2-curl
service apache2 restart
nano /home/pi/domoticz/www/dashboard/js/calendar.js

//\\changed://\\

if (settings['calendar_parse_localy']){
curUrl = './vendor/dashticz/ical/?time=' + cache + '&url=' + curUrl;
} else {
curUrl = 'https://dashticz.nl/ical/?time=' + cache + '&url=' + curUrl;
}

//\\to//\\

change curUrl = 'https://MYOWNDOMOTICZIP/ical/?time=' + cache + '&url=' + curUrl;

and add this in my CONFIG.js
config['calendar_parse_localy']=true;

With the result that the dutch tv section is working again. Only my 2 iCals are still not responding. (Google and RMN https://inzamelschema.rmn.nl/ical/0356200000014977)

What is the best way to look at this?

Lokonli
Posts: 110
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: IMPORTANT REQUEST!!!

Post by Lokonli » Wednesday 24 October 2018 22:14

stuffer wrote:
Wednesday 24 October 2018 21:41
robgeerts wrote:
Wednesday 24 October 2018 21:15
Wow had to read back a lot and good to see that most off you already have it working again!!
@robgeerts

Almost :-)

First I want to thank you for the project. A crate of beer is on his way when I get this working :-) (or at the Jumbo 1,5 for the price for one )

What I did on my Ubuntu 16 machine for domoticz:

apt install apache2
apt-get install python-software-properties
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php7.2
apt-get install php7.2-curl
service apache2 restart
nano /home/pi/domoticz/www/dashboard/js/calendar.js

//\\changed://\\

if (settings['calendar_parse_localy']){
curUrl = './vendor/dashticz/ical/?time=' + cache + '&url=' + curUrl;
} else {
curUrl = 'https://dashticz.nl/ical/?time=' + cache + '&url=' + curUrl;
}

//\\to//\\

change curUrl = 'https://MYOWNDOMOTICZIP/ical/?time=' + cache + '&url=' + curUrl;

and add this in my CONFIG.js
config['calendar_parse_localy']=true;

With the result that the dutch tv section is working again. Only my 2 iCals are still not responding. (Google and RMN https://inzamelschema.rmn.nl/ical/0356200000014977)

What is the best way to look at this?
The CONFIG.js setting should be:
config['calendar_parse_localy']=1;

The change you made in calendar.js is not needed (and incorrect) so better to revert that one.

EastXIII
Posts: 19
Joined: Monday 08 October 2018 13:56
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: IMPORTANT REQUEST!!!

Post by EastXIII » Wednesday 24 October 2018 22:18

peerkersezuuker wrote:
Tuesday 23 October 2018 17:14
@EastXII
I have set it in my virtual host config in /etc/apache2/sites-enabled/domoticz.sonnehoek.nl.conf

<VirtualHost 192.168.0.20:880>
# Always set these headers.
Header always set Access-Control-Allow-Origin "*"
DocumentRoot /var/www/dashticz_v2
ServerName domoticz.sonnehoek.nl
<Directory "/var/www/dashticz_v2">
allow from all
Options Indexes FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
I can't get it to work. I see you are running Dashticz on your server to?
I do not have that, is that why it does not work?
What I also noticed is that OV works on Firefox on Linux but my tablet does not show OV...
I could live without OV but I really, really like the garbage part. In the short time I used Dashticz, it was my, and my wife's, favorite and most used block.

jake
Posts: 485
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: IMPORTANT REQUEST!!!

Post by jake » Wednesday 24 October 2018 22:53

Lokonli wrote:
Wednesday 24 October 2018 20:38
...
Double check you have the correct settings in CONFIG.js:

Code: Select all

config['garbage_company'] = 'deafvalapp';
config['garbage_icalurl'] = '';
config['garbage_calendar_id'] = '';
config['garbage_zipcode'] = '5692VG';
config['garbage_street'] = '0';
config['garbage_housenumber'] = '33';
In my CONFIG.js I disabled all 'garbage' related lines with the '//' Then I simply copied your complete example in there. However no change and still showing the text 'geen gegevens gevonden'


Is there possibly something wrong with my 'afval folder'? I downloaded the ZIP file that Rob shared and this one contained only index.php in the /afval folder.


Shame on me, I copy pasted the string to modify garbage.js
Some smart program changed the '&sub' into a special character, avoiding the complete json to complete. So, garbage works as well. Hurray!

One more thing, I already opened a github request for it, HVC changed their code. It seems that you first need to check your 'bagID', and put that into the next json request to get the pick-up dates. Although it explained in this topic, I wouldn't know how to fix up the Dashticz code.

Lokonli
Posts: 110
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: IMPORTANT REQUEST!!!

Post by Lokonli » Thursday 25 October 2018 8:07

jake wrote:
Wednesday 24 October 2018 22:53
Lokonli wrote:
Wednesday 24 October 2018 20:38
...
Double check you have the correct settings in CONFIG.js:

Code: Select all

config['garbage_company'] = 'deafvalapp';
config['garbage_icalurl'] = '';
config['garbage_calendar_id'] = '';
config['garbage_zipcode'] = '5692VG';
config['garbage_street'] = '0';
config['garbage_housenumber'] = '33';
In my CONFIG.js I disabled all 'garbage' related lines with the '//' Then I simply copied your complete example in there. However no change and still showing the text 'geen gegevens gevonden'


Is there possibly something wrong with my 'afval folder'? I downloaded the ZIP file that Rob shared and this one contained only index.php in the /afval folder.


Shame on me, I copy pasted the string to modify garbage.js
Some smart program changed the '&sub' into a special character, avoiding the complete json to complete. So, garbage works as well. Hurray!

One more thing, I already opened a github request for it, HVC changed their code. It seems that you first need to check your 'bagID', and put that into the next json request to get the pick-up dates. Although it explained in this topic, I wouldn't know how to fix up the Dashticz code.
HVC is part of 'afvalstromen'. For afvalstromen all code already is implemented, except for HVC. I'll make the fix this weekend.

poudenes
Posts: 594
Joined: Wednesday 08 March 2017 10:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: IMPORTANT REQUEST!!!

Post by poudenes » Thursday 25 October 2018 8:30

Hi All,

Almost perfect working. Did everything below. After that reboot Raspberry. Domoticz UP, Apache UP, Dasthicz page load fast. Calendar, TVGuide and Public Transport loads OK.

Only thing i don't have now are the fontawesome icons you can add like:

Code: Select all

icon: 'fa-window-close'
Here steps i did:

Code: Select all

apt-get install apache2 apache2-doc apache2-utils php7.0-zip
apt-get install libapache2-mod-php7.0 php7.0 php7.0-opcache php7.0-mbstring php7.0-mysql php7.0-curl php7.0-gd
apt-get install libapache2-mod-php php-curl
edit Port listen 80 > 82

Code: Select all

nano /etc/apache2/ports.conf

listen 82
edit Virtual Host

Code: Select all

nano /etc/apache2/sites-available/000-default.conf
add

Code: Select all

<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule> 


and change <VirtualHost *: 80> to

Code: Select all

<VirtualHost *: 82>
Create a Symbolic Link into /var/www/html/ because i backup the Domoticz Folder every night. Then everything is save.

Code: Select all

ln -s /home/pi/domoticz/www/dashbeta/ /var/www/html/
Last edited by poudenes on Thursday 25 October 2018 9:49, edited 12 times in total.
RPi3 with OSMC - RPi3 with Domoticz - Dashticz - MiLight - Nanolead Aurora - KaKu - Logitech Hamony - Nest - RFLink

edge
Posts: 10
Joined: Wednesday 02 September 2015 14:04
Target OS: Raspberry Pi
Domoticz version:
Location: The Netherlands
Contact:

Re: IMPORTANT REQUEST!!!

Post by edge » Thursday 25 October 2018 9:26

In my situation Domoticz is running at :8080. If I start a new webserver at :8081 where the scripts are 'hosted' I receive a
"No access-control-allow-origin' header is present on the requested resource" within Chrome.

Workaround:
Start Chrome with the following parameters:
chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security

So that's why I would like to host the scripts behind :8080 (at the domoticz port). But when I try to access the scripts I receive a "Domoticz offline" message.

Anyone with this problem?

Edit: I will try what's mentioned here above first! :)

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

Re: IMPORTANT REQUEST!!!

Post by gielie » Thursday 25 October 2018 9:40

robgeerts wrote:
Wednesday 24 October 2018 21:15
Wow had to read back a lot and good to see that most off you already have it working again!!
Nope, i cant get it to work.
I started from scratch, installed dashticz in var/www/html (instead of domoticz/www) with all the necessary dependencies.
I also tried to host the files on my synology and redirected to that address but still no luck.

Can someone make a clear tutorial how to change this.

And one question, if i change the icall/garbage file wont this be a problem with the next git pull update?
- 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

poudenes
Posts: 594
Joined: Wednesday 08 March 2017 10:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: IMPORTANT REQUEST!!!

Post by poudenes » Thursday 25 October 2018 9:41

gielie wrote:
Thursday 25 October 2018 9:40
robgeerts wrote:
Wednesday 24 October 2018 21:15
Wow had to read back a lot and good to see that most off you already have it working again!!
Nope, i cant get it to work.
I started from scratch, installed dashticz in var/www/html (instead of domoticz/www) with all the necessary dependencies.
I also tried to host the files on my synology and redirected to that address but still no luck.

Can someone make a clear tutorial how to change this.

And one question, if i change the icall/garbage file wont this be a problem with the next git pull update?
See my post 2 up... For me it work now. Only the custom icons part is gone now. But rest is working
RPi3 with OSMC - RPi3 with Domoticz - Dashticz - MiLight - Nanolead Aurora - KaKu - Logitech Hamony - Nest - RFLink

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest