NEW frontpage.html - request comments

ubfssF
Posts: 43
Joined: Monday 02 November 2015 15:12
Target OS: Linux
Domoticz version: 2.2364
Location: Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by ubfssF » Saturday 21 January 2017 19:30

OK, you probably mean to run apache or nginx then. I see

madrian
Posts: 238
Joined: Saturday 27 August 2016 1:18
Target OS: -
Domoticz version:
Contact:

Re: NEW frontpage.html - request comments

Post by madrian » Saturday 21 January 2017 20:29

Anybody to this?

I tried

Code: Select all

var d = (32/100)*level;
, but it does not work. The plus button decreases the value, not increases. :roll:

User avatar
G3rard
Posts: 827
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by G3rard » Saturday 21 January 2017 20:51

@hpapagaj, that is strange. Can you post the complete function and the code with the dimmer part.
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

madrian
Posts: 238
Joined: Saturday 27 August 2016 1:18
Target OS: -
Domoticz version:
Contact:

Re: NEW frontpage.html - request comments

Post by madrian » Saturday 21 January 2017 22:19

@G3rard I am using the stock frontpage.js.

In settings I have a standard level controller:

Code: Select all

['25',	'Level',		'cell2',	'Konyha LED','1','1'],
The relevant part from frontpage.js:

Code: Select all

//Dimmer, only works with 1-16 dimmer for now
function ChangeStatus(OpenDicht,level,idx,currentlevel)
	{
	//When switched off return to previous level, no matter if plus or min pressed
	if (level == txt_off) {
		if (currentlevel == 1) {
			currentlevel++;
		}
		//console.log("In uit",currentlevel);
		$.ajax({
		url: $.domoticzurl+"/json.htm?type=command&param=switchlight&idx=" + idx + "&switchcmd=Set Level&level=" + currentlevel,
		async: false,
		dataType: 'json',
		success: function(){
		console.log('SUCCES');
		},
		error: function(){
		console.log('ERROR');
		}
		});
	}
	else {
		level = level * 1;
		console.log(OpenDicht,level);
		if (OpenDicht == "plus")
			{
			var d = level * 3.125;
			
			console.log("in plus",d,level);
			if(d > 32) {
				d = 32;
			}
			$.ajax({
			url: $.domoticzurl+"/json.htm?type=command&param=switchlight&idx=" + idx + "&switchcmd=Set Level&level=" + d,
			async: false,
			dataType: 'json',
			success: function(){
			console.log('SUCCES');
			},
			error: function(){
			console.log('ERROR');
			}
			});
		}
		else {
			var d = Math.round((level / 100.0) * 32);
			console.log("in min",d,level);
			if( d < 0 ){
				d = 0;
			}
			$.ajax({
			url: $.domoticzurl+"/json.htm?type=command&param=switchlight&idx=" + idx + "&switchcmd=Set Level&level=" + d,
			async: false,
			dataType: 'json',
			success: function(){
			console.log('SUCCES');
			},
			error: function(){
			console.log('ERROR');
			}
			});
		}
	}
	RefreshData();
	}
+I added to this function::

Code: Select all

//Dimmer
	if(vtype == 'Level' && item.SwitchType == 'Dimmer') {
this code:

Code: Select all

} else if (item.MaxDimLevel == 32) {
						//vdata2 = vdimmervalue; //used for ChangeStatus
						//vdimmervalue = Math.round(vdimmervalue / 5)*5; //round to ten
						
						vdata = vdimmervalue; //show current dim value
						var hlp = '<span onclick="SwitchToggle('+item.idx+',\'Off\');lightbox_open(\'switch\', '+switch_off_timeout+', '+txt_switch_off+')"; style='+alarmcss+'>'+ vdata+'</span>';
						var plus = "<img src=icons/up.png align=right vspace=12 onclick=ChangeStatus('plus'," + vdata + "," + item.idx + ","+ vdimmercurrent+")>"; //align=right replaced by hspace and vspace
						var min = "<img src=icons/down.png align=left vspace=12 onclick=ChangeStatus('min'," + vdata + "," + item.idx + ","+ vdimmercurrent+")>" //align=left
					}	

In my opinion the bug is in the vdata = vdimmervalue; --> maybe here I am missing a formula or in the var d = level * 3.125;.

BarryT
Posts: 256
Joined: Tuesday 31 March 2015 22:06
Target OS: Raspberry Pi
Domoticz version: beta
Location: east netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by BarryT » Sunday 22 January 2017 16:56

denisj wrote:
albertvandam wrote:Dear all,

With all the examples and code in this forum, I have managed to create a pretty good frontpage which runs on a wall mounted tablet.

Image
Albert,
can you please upload your frontpage packet some wear in order to download it and take some sample please ?

Thanks in advance
Denis
+1
It isnt that simple as adding a couple tables?

Please explain how did you do this, looks nice!
6x Raspberry 3B
A lot of scripts, switches and sensors :)

User avatar
G3rard
Posts: 827
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by G3rard » Monday 23 January 2017 0:02

@hpapagaj,

Can you try this

Code: Select all

var d = ((level + 10)/100 * 32) +  0.5;
in stead of

Code: Select all

var d = level * 3.125;
What is the console showing then when you press plus, related to this part of your code?

Code: Select all

console.log("in plus",d,level);
Level = the old level
d = the new level
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

ubfssF
Posts: 43
Joined: Monday 02 November 2015 15:12
Target OS: Linux
Domoticz version: 2.2364
Location: Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by ubfssF » Monday 23 January 2017 11:46

I am using the frontpage-version by Swordfish, which is based on the frontpage of this thread, just some tweaks to cell colors etc. What I cannot achieve is displaying travel times in the frontpage. When I browse the Domoticz database I can see the custom sensor (ID=181) and its value (sValue=12), but I cannot use the sValue. It just displays the Id-number. I can retrieve a few of the other fields of this custom sensor, like CustomImage.
Is there any way to retrieve and display in the Frontpage?
Inserting "Minuten"doesn't work as well:

Code: Select all

        ['181','Minuten',               'cell8',        'Alblasserdam-Gorinchem','1','0'],
Spectacle.kn3558.png
See left under, nr 181
Spectacle.kn3558.png (44.54 KiB) Viewed 2556 times
Spectacle.db.png
Spectacle.db.png (121.32 KiB) Viewed 2556 times

ubfssF
Posts: 43
Joined: Monday 02 November 2015 15:12
Target OS: Linux
Domoticz version: 2.2364
Location: Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by ubfssF » Monday 23 January 2017 16:38

To answer my own question... :D

I had to look up the available datafields, for example in: http://127.0.0.1:8080/json.htm?type=devices&plan=0
There it was clear that I needed the contents of "Data":

So the right line is:

Code: Select all

['181','Data',          'cell8',        'Alblasserdam-Gorinchem','1','0'],

madrian
Posts: 238
Joined: Saturday 27 August 2016 1:18
Target OS: -
Domoticz version:
Contact:

Re: NEW frontpage.html - request comments

Post by madrian » Tuesday 24 January 2017 14:14

G3rard wrote:@hpapagaj,

Can you try this

Code: Select all

var d = ((level + 10)/100 * 32) +  0.5;
Super it's working now. :P Thank you!

Little glitch that one step is 6% instead of 3% (like in Domoticz):

50 to 56:

plus 50
in plus 19.7 50
SUCCES

56 to 62:

plus 56
in plus 21.62 56
SUCCES

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

Re: NEW frontpage.html - request comments

Post by EdwinK » Wednesday 25 January 2017 21:30

Can this be installed on a Synology NAS? Can't find any map in which Domoticz could be living.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

User avatar
G3rard
Posts: 827
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by G3rard » Wednesday 25 January 2017 22:00

To install the frontpage on a Synology, enable Web station and put the frontpage in the web folder.
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

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

Re: NEW frontpage.html - request comments

Post by EdwinK » Thursday 26 January 2017 17:36

G3rard wrote:To install the frontpage on a Synology, enable Web station and put the frontpage in the web folder.

Just that easy? Thanks :)
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

Trigun
Posts: 184
Joined: Wednesday 30 November 2016 12:58
Target OS: Raspberry Pi
Domoticz version: 3.5877
Contact:

Re: NEW frontpage.html - request comments

Post by Trigun » Friday 27 January 2017 22:08

G3rard wrote:There is no other documentation, but let my try to help you.

You have to use the IP of your Sonos in the config.php, not the IP of the Pi.
Part of the config.php where 115 is the IDX in Domoticz.

Code: Select all

'zones' => array(
      '115'   => '192.168.1.161', /* kitchen*/
	),
The url you have to use in this example is:

Code: Select all

http://yourserver/tablet/sonos/index.php?zone=115&action=Play
And you have to run the PHP on a PHP enabled web server. So if that's not installed on your Pi, you have to install PHP on it.
Hi G3rard,
I was looking at this post and this is exactly what I would like to use.
I am able to control the sonos via HTTP but I can't get it to work with the PHP option in G3rards files.

perhaps you can help me out here?
maybe a noob question but how do I install the PHP server on the Domoticz Pi?

Thanks in advance!

Kind regards,

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

Re: NEW frontpage.html - request comments

Post by EdwinK » Friday 27 January 2017 23:20

After reading through the 60 pages in this topic, I still not sure what is going on.

When I open the frontpage on my Synology NAS, the page loads, but then keeps trying to connect to some site, but I can't find out what. Because it does this, I also can't see if my changes work.

Image
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

Trigun
Posts: 184
Joined: Wednesday 30 November 2016 12:58
Target OS: Raspberry Pi
Domoticz version: 3.5877
Contact:

Re: NEW frontpage.html - request comments

Post by Trigun » Friday 27 January 2017 23:42

EdKo66 wrote:After reading through the 60 pages in this topic, I still not sure what is going on.

When I open the frontpage on my Synology NAS, the page loads, but then keeps trying to connect to some site, but I can't find out what. Because it does this, I also can't see if my changes work.

Image
did you make any configutations yet?
for example: put in your ip adress and use the right floorplan in the frontpage_settings file?

ubfssF
Posts: 43
Joined: Monday 02 November 2015 15:12
Target OS: Linux
Domoticz version: 2.2364
Location: Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by ubfssF » Friday 27 January 2017 23:58

Floorplan 0 will do for starting. Later on, you can create one specially for the Frontpage.
IP address of the domoticz server has to be right.
If you have at least one sensor configured, you should see something.
Page loads slowly, but if configured right it should work.

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

Re: NEW frontpage.html - request comments

Post by EdwinK » Friday 27 January 2017 23:58

Yes. I did :) It's just that the frontpage is trying to connect to a site. I think it might either be to Buienradar or the webcam.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

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

Re: NEW frontpage.html - request comments

Post by EdwinK » Saturday 28 January 2017 0:00

ubfssF wrote: Page loads slowly, but if configured right it should work.
Have been waiting for over an hour. Still no luck.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

ubfssF
Posts: 43
Joined: Monday 02 November 2015 15:12
Target OS: Linux
Domoticz version: 2.2364
Location: Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by ubfssF » Saturday 28 January 2017 14:12

I suspect Buienradar also for the slow loading, but an hour is way too much. I have a Ubuntu setup, so I don't know the pitfalls of a Synology setup, but I suspect that Frontpage isn't able to reach the Domoticz server. The IP address or port number are the first to think of, but maybe with a Synology setup there are other challenges? The long loading times are not due to the Buienradar or things like that, I would say, but the Domoticz server.

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

Re: NEW frontpage.html - request comments

Post by EdwinK » Saturday 28 January 2017 18:30

Everything else on the Synology is working normally. I will go investigate it a bit more.


Found that somewhere something is calling to a local address (that I don't have). So now looking for where it exactly sits in the files.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests