NEW frontpage.html - request comments

Moderator: leecollings

thorbj
Posts: 113
Joined: Thursday 20 November 2014 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Norway
Contact:

Re: NEW frontpage.html - request comments

Post by thorbj »

jan_nl wrote:oops, I think I pointed you in the wrong direction.
You need to compare the Status value in PageArray.
In the array the word Humidity or Temp can be found, in this way you can determine what is in which cell.

Sorry for the confusion.
Jan
Ah, thank you, now I've got it :)

The following works like a charm:

Code: Select all

if(item.idx == '35' && vdata > -100 && vtype == 'Temp'){			// Adds the Celsius sign after the temperature
vdata=new String(vdata).replace( vdata,vdata + "℃");
}
if(item.idx == '35' && vdata > -100 && vtype == 'Humidity'){			// Adds the Percentage sign after the humidity
vdata=new String(vdata).replace( vdata,vdata + "%");
}
2xRaspberry Pi Model 2 w/RaZberry z-wave chip (master/slave)|Fibaro Wall Plug|Fibaro Universal Dimmer 500W|Aeon Labs Multisensor|RFXtrx433E|Nexa WMR-1000|Nexa Pe-3|Nexa Remote|Nexa LGDR3500|Lightify Gateway|Lightify RGBW bulb
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by mvveelen »

I've made some small changes:

- Button up, the icon that is, wasn't OK (thanks for pointing that one out for me, ThinkPad)
- The % is now shown on a similar button

Downloadlink: LINK


Edit:


jan_nl, can you help me out :

I would like to use 2 separate images for every forecast. For example: when it's partly cloudy, I now have a sun with clouds in front of it. But when it's after sunset I'd like to have the moon with the clouds in front of it. I already made the images (and as you can see, they are in the uploaded package), but what code should I use?
Could you give me a nudge in the right direction?

The code I now have is this:

Code: Select all

	if (vdata == 'Partly Cloudy' ) {
	vdata=new String(vdata).replace( "Partly Cloudy","<img src=icons/04day-partlycloudy.png width=204 height=204>");
	}
Attachments
Schermafbeelding 2015-02-04 om 22.27.34.png
Schermafbeelding 2015-02-04 om 22.27.34.png (18.91 KiB) Viewed 3086 times
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
thorbj
Posts: 113
Joined: Thursday 20 November 2014 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Norway
Contact:

Re: NEW frontpage.html - request comments

Post by thorbj »

@mvveelen, maybe you could put the icons in day/night folders and somehow alter the path depending on the IsDonker switch, or sunset/sunrise? Just a thought.
2xRaspberry Pi Model 2 w/RaZberry z-wave chip (master/slave)|Fibaro Wall Plug|Fibaro Universal Dimmer 500W|Aeon Labs Multisensor|RFXtrx433E|Nexa WMR-1000|Nexa Pe-3|Nexa Remote|Nexa LGDR3500|Lightify Gateway|Lightify RGBW bulb
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by mvveelen »

thorbj wrote:@mvveelen, maybe you could put the icons in day/night folders and somehow alter the path depending on the IsDonker switch, or sunset/sunrise? Just a thought.
Thanks, but that gives me the same problem: I somehow have to figure out how I could fix this. Tried some things, but haven't succeeded yet.

Oh, and if there are people who want this button.....?

Image
Last edited by mvveelen on Thursday 05 February 2015 20:19, edited 1 time in total.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
BobbyNL
Posts: 12
Joined: Monday 02 February 2015 16:15
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by BobbyNL »

When i set ['11','Direction', 'cell6', 'Windrichting','0','0'],
the output is Wind bearing, but i wan't the Direction. What goes wrong?

Already fixed it by using 'DirectionStr'
Last edited by BobbyNL on Friday 06 February 2015 14:15, edited 1 time in total.
Rpi-Domoticz +RFXtrx433E | Rpi-Openelec | Rpi-Runeaudio | unRaid 6 server | Intel NUC-Linux Tvheadend + Oscam
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by ThinkPad »

thorbj wrote:
jan_nl wrote:oops, I think I pointed you in the wrong direction.
You need to compare the Status value in PageArray.
In the array the word Humidity or Temp can be found, in this way you can determine what is in which cell.

Sorry for the confusion.
Jan
Ah, thank you, now I've got it :)

The following works like a charm:

Code: Select all

if(item.idx == '35' && vdata > -100 && vtype == 'Temp'){			// Adds the Celsius sign after the temperature
vdata=new String(vdata).replace( vdata,vdata + "&#8451;");
}
if(item.idx == '35' && vdata > -100 && vtype == 'Humidity'){			// Adds the Percentage sign after the humidity
vdata=new String(vdata).replace( vdata,vdata + "&#37;");
}
I think you don't even need the

Code: Select all

&& vdata > -100
part. If it is a temperature, you want to add the Celsius sign :)
Same with Humidity

Or is the -100 some kind of error message (no value received from sensor) ?
I am not active on this forum anymore.
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by mvveelen »

ThinkPad wrote:
thorbj wrote:
jan_nl wrote:oops, I think I pointed you in the wrong direction.
You need to compare the Status value in PageArray.
In the array the word Humidity or Temp can be found, in this way you can determine what is in which cell.

Sorry for the confusion.
Jan
Ah, thank you, now I've got it :)

The following works like a charm:

Code: Select all

if(item.idx == '35' && vdata > -100 && vtype == 'Temp'){			// Adds the Celsius sign after the temperature
vdata=new String(vdata).replace( vdata,vdata + "&#8451;");
}
if(item.idx == '35' && vdata > -100 && vtype == 'Humidity'){			// Adds the Percentage sign after the humidity
vdata=new String(vdata).replace( vdata,vdata + "&#37;");
}
I think you don't even need the

Code: Select all

&& vdata > -100
part. If it is a temperature, you want to add the Celsius sign :)
Same with Humidity

Or is the -100 some kind of error message (no value received from sensor) ?
I've put that part in to prevent the Celsius sign from appearing after the WeatherForecast-images.....I don't know another way to prevent that.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
maluko
Posts: 105
Joined: Sunday 02 February 2014 23:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Portugal
Contact:

Re: NEW frontpage.html - request comments

Post by maluko »

excelent work guys

i wonder kwow if its possible to add a cell with volume botton, like dimmer, i have two virtual switch one to plus and other to minus, and good will be integrade this two switch on one cell with json http.
am wrong?

thanks
jannl
Posts: 625
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: NEW frontpage.html - request comments

Post by jannl »

For the day/night weather icons I implemented an additional variable (Isnight) which is set to 1 or 0 depending on day or night. Isnight is set at the same location the background is altered for day and night.

In the location where the weather icons are set, I added an additional if statement the set the day or night icon.

I did not post it here because I am not completely satisfied with the I implemented this, allthough it seems to work correctly.

I will post it here later anyway, because it works.
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by mvveelen »

Can't you use the virtual switch 'IsDark' for that? And what is the second 'if' statement? I'm very curious and this might be one of the last additions I want to have in my frontpage.html (although the Skycons are still on my list :oops: ).
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
jannl
Posts: 625
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: NEW frontpage.html - request comments

Post by jannl »

Something like (very, very simplified):

if (cloudy)
if (Isnight)
Show night-cloud icon
else
Show day-cloud icon
end
end

Isdark can not be used, because it not set globally.
But now I think of it, that could also be set globally and be used in stead of an extra Isnight,

Thanks for the tip
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by mvveelen »

'Samen komen we er wel' :)

If you have some pieces of code I could use, I'd be glad to test / use / try it :D
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
jannl
Posts: 625
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: NEW frontpage.html - request comments

Post by jannl »

I will try to post the code tonight.

Got another weekend with a lot of carnaval ahead.... :D
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by mvveelen »

I managed to get it to work with the 'IsNight'.

I've put the

var Isnight = 'yes'; in the frontpage_settings.js

And in the frontpage.js I added something like:

Code: Select all

   if (vdata == 'Partly Cloudy' & IsNight == 'No') {
   vdata=new String(vdata).replace( "Partly Cloudy","<img src=icons/04day-partlycloudy.png width=204 height=204>");
   }

etc.
The IsNight is set in the part where I let the .css be chosen, based on the IsDonker var :)

Code: Select all

	if(item.idx == idx_IsDonker && vdata == 'Off'){
	document.getElementById('dark-styles').disabled  = true;				// day
	IsNight = 'No';
	}

	if(item.idx == idx_IsDonker && vdata == 'On'){
	document.getElementById('dark-styles').disabled  = false;				// night
	IsNight = 'Yes';
	}

So far so good. Now, lets see what the forecast image does when the sun sets :)

Edit: OK, maybe it's not the way it should / could be coded, but hey.....it works. If someone could rewrite this, be my guest :)
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by bbqkees »

floris74 wrote:It's SetPoint, yes.
I see that you have a solution for the thermostat, but i don't know how to implement it in Jan_nl his version.
Floris
So normal CamelCase then.

Because Jan followed a different approach in respect to the dimming function, my solution is pretty incompatible at this moment.
Maybe Jan can modify his function to incorporate your SetPoint change, or you need to exchange the function alltogether.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
jannl
Posts: 625
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: NEW frontpage.html - request comments

Post by jannl »

mvveelen wrote:
Edit: OK, maybe it's not the way it should / could be coded, but hey.....it works. If someone could rewrite this, be my guest :)
Should work like this.
Basically the same I did. IsDark can not be used, I my case IsDark contains an idx value.
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by mvveelen »

It does work like this, but I meant that the code could be rewritten somehow.

It's after sunset, and this is the way the forecast is now:
Attachments
Schermafbeelding 2015-02-06 om 20.13.13.png
Schermafbeelding 2015-02-06 om 20.13.13.png (97.88 KiB) Viewed 2910 times
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
floris74
Posts: 75
Joined: Sunday 30 November 2014 8:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hoorn, Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by floris74 »

bbqkees wrote:
floris74 wrote:It's SetPoint, yes.
I see that you have a solution for the thermostat, but i don't know how to implement it in Jan_nl his version.
Floris
So normal CamelCase then.

Because Jan followed a different approach in respect to the dimming function, my solution is pretty incompatible at this moment.
Maybe Jan can modify his function to incorporate your SetPoint change, or you need to exchange the function alltogether.
Thanks for the info, bbqkees. How is your working in process withe front page.html?

@jan_nl, can you implement the SetPoint? Maybe between the carnaval days? :)

floris
Slayer007
Posts: 29
Joined: Wednesday 18 June 2014 23:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by Slayer007 »

Does anyone know how to convert the json timestamp for example (2015-01-24 13:14:38) to a normal date in html?
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by mvveelen »

Just made some layout-tweaks:

- The sun / moon are now displayed on a similar button as all the others
- The % (text) for the dimmer isn't displayed anymore. instead there is a blue circle that becomes smaller or bigger when you dim the light.

I only have one problem with this last one: I can't use the button to switch the dimmed lights off. I made the numbers (%) 0% so it isn't displayed, that's why I can't use it to click on. When I use opacity to let the text to be transparent (and let it be big enough to make it clickable), both up and down buttons will be transparent too and that's not what we want do we :) ?

If anyone has a quick fix for this....??
Attachments
Schermafbeelding 2015-02-07 om 18.25.06.png
Schermafbeelding 2015-02-07 om 18.25.06.png (147.01 KiB) Viewed 2791 times
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest