Page 7 of 66
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 14:53
by mvveelen
I've copied all of the code necessary (I think) to my frontpage.html, but the + and - just won't show and I therefor can't set the dim level for the lights. What are the things I might be missing here...?
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 15:12
by bbqkees
There are too many changes to both the code and the html. There are a bunch of additional div's and other stuff.
So I do not know what you did or did not copy. Perhaps you forgot to copy the button images or your page array is incomplete.
It is better if you test first with my complete version to see if that works.
Just copy all the files and fill in the domoticz URL and 1 correct ID with the correct settings.
If you wait a few days, I'll make a new version with an external settings file.
This should make future updates or changes very easy.
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 15:18
by mvveelen
I've copied the images and tested it first with your version. Everything worked fine. But it was easier to use my own version and add the extra code / array to my page. Unfortunately it now doesn't show me the pop-ups and the + / - buttons. Too bad. I'll wait a few days, I hope you can make it easier to use. Thanks for the effort so far

Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 15:23
by jannl
Debugging the javascript code can be done by right-clicking on the page en select the bottom option (inspect element), this may give a clue about the problem.
Above works in google chrome
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 15:26
by mvveelen
I'll try that....
Come to think of it: with your version I can't get the pop-ups too.... and also the + doesn't work. The - does work and I can set the lights on / off (using 1, 1), so I have to look for a solution to that problem first

Or just wait....

Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 15:26
by jannl
Slayer007 wrote:Is it also possible to access this frontpage from outside home eg. At work? I have a vpn connection, but when i open the frontpage i see the blocks but not the value's. Am i forgetting something?
Must be something in your frontpage or vpn setting.
I make a vpn connection to my FritzBox and call frontpage.html, works like a charm
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 15:44
by Slayer007
Oke, thnx. But if you have any idea where to search....
Because I can connect en can open the page en shows me everything (even de camera), but no
Other values

Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 18:15
by mvveelen
I give up for now: I managed to get the pop-ups to work (there was 1 </div> missing....), but the + just won't do his job

Everything else is fine though.
Edit: No, the protected switches won't pop-up a message that the switch is protected. It just switches to ON or OFF

Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 18:48
by pwhooftman
jan_nl wrote:Slayer007 wrote:Is it also possible to access this frontpage from outside home eg. At work? I have a vpn connection, but when i open the frontpage i see the blocks but not the value's. Am i forgetting something?
Must be something in your frontpage or vpn setting.
I make a vpn connection to my FritzBox and call frontpage.html, works like a charm
I only forwarded my domoticz port in my router to make it work. + provide the external url in frontpage.html (like you.synology.me:8090 instead of 192.198.0.1:8090)
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 19:07
by jannl
Forwarding is way to insecure for me. I'll stick to vpn.
@slayer007 did you check the ip address? May be use the actual ip address instead of 127.0.0.1
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 19:50
by Slayer007
Thanks for the replies. I sill want to use the Vpn. I think it's more secure. I don't use my local host anywhere.
In domo I allowed my rpi ip-adres. 192.168.x.x:xxxx.
In my front page by user values I also used the same ip-adres.
With my Vpn on my phone on 4g I can access any ip adress I use at home. I can access the Domoticz page without any problems. Only i cant't with this front page....
So I can't see what I'm doing wrong
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 20:21
by jannl
hm, strange.
Do you use any authentication on your Domoticz installation?
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 20:35
by ThinkPad
What IP does your phone/tablet gets when you connect trough VPN? My normal IP-range is 192.168.4.x, but via VPN (VPN server on my Synology NAS) i get a 10.0.0.x IP.
Be sure to whitelist the VPN IP-range also

Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 20:51
by Slayer007
jan_nl wrote:hm, strange.
Do you use any authentication on your Domoticz installation?
Yes, the login.
ThinkPad wrote:What IP does your phone/tabetl gets when you connect trough VPN? My normal IP-range is 192.168.4.x, but via VPN (VPN server on my Synology NAS) i get a 10.0.0.x IP.
Be sure to whitelist the VPN IP-range also

The ip-adress i get is the ip-adress from my provider at home (Caiway). Is that weird?
My VPN-tunnel goes to my provider at home. And from there my rpi is in a dmz and I can access all of my internal ip's.
When I switch back on WIFI on my Phone the FrontPage opens perfect, so yes, I think it has something to do with the vpn, but I'm not completely in to that.
ps,: Where do I whitelist the VPN? Also in the domoticz settings?
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 21:06
by ThinkPad
Your provider IP = WAN IP... which you can see at
http://www.whatismyip.com
When you are on 3G/4G and you go to that page you will see the WAN IP of your mobile provider. When you connect to your VPN and visit the page again, you will see a different IP: your home WAN IP.
But what i mean is the internal (LAN) IP. The VPN server will assign a VPN-range IP. Look in the settings of your VPN-server, and whitelist that range (like: 10.0.0.* , the asterisk (*) indicates a joker/wildcard)). Whitelisting can be done at Setup > Application settings.
I have: 127.0.0.*;192.168.4.*;10.8.0.*
First one is the Pi itself, second my home LAN, third the VPN range.
But i think we should stop the discussion about VPN here, better to create an own topic
-------------------------------------------------------------------------------------------------------------------------------------------
I fixed the minus and plus icons not displaying, i changed the image path in frontpage2.css from: images/minsmall.png to ../images/minsmall.png
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 21:27
by Slayer007
Okay. You're right. A little bit off-topic. I thought it was an easy answer. But thanks anyway.
If someone is interested in some icons for the FrontPage, I've added some.
Some pics aren't transparent, because I use the FrontPage with white blocks instead of black.
When I have more and people are interested for using it, I'll post more.
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 22:01
by jannl
With the help of the code of bbqkees, I 'upgraded' the dimmer functionality a bit
Clicking the level goes to off, clicking off, switches back on.
When off, clicking either button returns to the previous level.
Substituted SwitchOff with the already used SwitchToggle.
Edit: oops, typo, forgot to change one SwitchOff to SwitchToggle

Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 22:08
by ThinkPad
Is it possible to only post the code that has changed? I just finished editing my settings into the code of bbqkees... This way i keep staying busy, if for every change i need to do my settings again

Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 22:09
by Slayer007
Thanks Thinkpad for the solution.
For those who have a VPN connection, you have to allow acces in the domoticz settings (local networks).
VPN often starts often with 10.x.x.x. (or look in your vpn setting to your ip-range) Add this to domoticz and you can access the FrontPage from outside with your VPN.
Re: NEW frontpage.html - request comments
Posted: Thursday 22 January 2015 22:16
by jannl
ThinkPad wrote:Is it possible to only the code that has changed? I just finished editing my settings into the code bbqkees... This way i keep staying busy, if for every change i need to do my settings again

I get your point, I got the same, every change I have to figure out what has changed and slowly adapt my own frontpage code.
Started 2 hrs ago with the idea to add some minor changes and here we are 2 hrs later.....
BTW, the biggest problem I have now is that swiping seems to show 4 slides, 2 of which seem to be more or less empty, not sure how this happens.
Edit: for the plumin buttons bbqkees already changed the settings, I think I only changed code