Dashticz - General Discussions

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Locked
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: RE: Re: New Dashboard Design

Post by stlaha2007 »

clubeddie wrote: I know want to change 'Woonkamer' on the frontpage to show the actual energy produced. But i cannot seems to find where i can change this field.
hope someone can help.
You have to look for a Temperature sensor as (Hardware)Type in main.js

It's located just above the Smartmeter parts...
Don't have the listing aside now. But i changed it to reflect my Hardware RFXcom thry LAN and DeviceType to Thermostat to show the Thermostats sensed temperature.
clubeddie
Posts: 80
Joined: Saturday 19 March 2016 21:12
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: New Dashboard Design

Post by clubeddie »

This is how it looks in that area of code

Code: Select all

function getDevices(){
	
	if(!sliding){
		if(typeof(req)!=='undefined') req.abort();
		req = $.ajax({
			url: _HOST_DOMOTICZ+'/json.htm?type=devices&filter=all&used=true&order=Name&jsoncallback=?',
			type: 'GET',async: true,contentType: "application/json",dataType: 'jsonp',
			success: function(data) {
				if(!sliding){
					$('#switches').html('');
					$('#groups').html('');
					$('#sliders').html('');
					for(r in data.result){
						
						if(data.result[r]['HardwareType']=='P1 Smart Meter USB'){
						if(data.result[r]['Type']=='P1 Smart Meter' && data.result[r]['SubType']=='Energy'){
							$('.energy').html(data.result[r]['Usage']);
							$('.energytoday').html(data.result[r]['CounterToday']);
							$('.energytoday').parents('.hideinit').show();
							$('.energy').parents('.hideinit').show();
							}
						if(data.result[r]['Type']=='P1 Smart Meter' && data.result[r]['SubType']=='Gas'){
							$('.gas').html(number_format(data.result[r]['CounterToday'],2,',','.')+' m3');
							$('.gas').parents('.hideinit').show();
							}
I searched for temp, but there is no such entry.
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: New Dashboard Design

Post by stlaha2007 »

The code for Woonkamer is located below (sorry, my bad). The part including the changes i have made are these:

Code: Select all

//               if(data.result[r]['Type']=='Temp'){
                 if(data.result[r]['Type']=='Temp' && data.result[r]['HardwareName']=='RFX_Pi_Living'){
//               if(data.result[r]['Type']=='Temp' && data.result[r]['HardwareType']=='RFXCOM - RFXtrx shared over LAN interface'){
                          $('.tempinside').html(data.result[r]['Temp']+'°C');
                          $('.tempinside').parents('.hideinit').show();
                }
//              }
So, dive deeper ;-)

It's there for sure.

And to create extra devices... You need to copy blocks like Energy and Energytoday from smartmeter and rename them eg. ReturnEnergy and ReturnToday.... And Also copy the according lines within index.html

I recommand to backup the files first.... Or use remarks like // within java or <!-- and --> within html-code

Sent from my K00C using Tapatalk
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: New Dashboard Design

Post by stlaha2007 »

Perhaps the original file had another Type.... Its just below Energy and Gas !!

A screenshot of it expanded with more energy and Woonkamer:
Image
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: New Dashboard Design

Post by robgeerts »

EdKo66 wrote:Hope I can post this here.

Would like to see this added:

Code: Select all

     "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "8.7 C",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 21,
         "HardwareName" : "Buienradar",
         "HardwareType" : "Buienradar.nl (Weather lookup)",
         "HardwareTypeVal" : 94,
         "HaveTimeout" : false,
         "ID" : "00150001",
         "LastUpdate" : "2017-03-17 10:17:59",
         "Name" : "Buienradar - Temperature",
         "Notifications" : "false",
         "PlanID" : "0",
         "PlanIDs" : [ 0 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "SubType" : "LaCrosse TX3",
         "Temp" : 8.6999999999999993,
         "Timers" : "false",
         "Type" : "Temp",
         "TypeImg" : "temperature",
         "Unit" : 1,
         "Used" : 1,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "95"
      },
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "Humidity 70 %",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 21,
         "HardwareName" : "Buienradar",
         "HardwareType" : "Buienradar.nl (Weather lookup)",
         "HardwareTypeVal" : 94,
         "HaveTimeout" : false,
         "Humidity" : 70,
         "HumidityStatus" : "Wet",
         "ID" : "00150002",
         "LastUpdate" : "2017-03-17 10:17:59",
         "Name" : "Buienradar - Humidity",
         "Notifications" : "false",
         "PlanID" : "0",
         "PlanIDs" : [ 0 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "SubType" : "LaCrosse TX3",
         "Timers" : "false",
         "Type" : "Humidity",
         "TypeImg" : "temperature",
         "Unit" : 2,
         "Used" : 1,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "96"
      },
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "Barometer" : 1017.5,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "1017.5 hPa",
         "Description" : "",
         "Favorite" : 1,
         "Forecast" : 0,
         "ForecastStr" : "Stable",
         "HardwareID" : 21,
         "HardwareName" : "Buienradar",
         "HardwareType" : "Buienradar.nl (Weather lookup)",
         "HardwareTypeVal" : 94,
         "HaveTimeout" : false,
         "ID" : "00150004",
         "LastUpdate" : "2017-03-17 10:17:59",
         "Name" : "Buienradar - Barometer",
         "Notifications" : "false",
         "PlanID" : "0",
         "PlanIDs" : [ 0 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "SubType" : "Barometer",
         "Timers" : "false",
         "Type" : "General",
         "TypeImg" : "gauge",
         "Unit" : 4,
         "Used" : 1,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "97"
      },
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "Chill" : 5.5,
         "CustomImage" : 0,
         "Data" : "288.0;WNW;63;98;8.7;5.5",
         "Description" : "",
         "Direction" : 288.0,
         "DirectionStr" : "WNW",
         "Favorite" : 1,
         "Gust" : "5",
         "HardwareID" : 21,
         "HardwareName" : "Buienradar",
         "HardwareType" : "Buienradar.nl (Weather lookup)",
         "HardwareTypeVal" : 94,
         "HaveTimeout" : false,
         "ID" : "00150006",
         "LastUpdate" : "2017-03-17 10:17:59",
         "Name" : "Buienradar - Wind",
         "Notifications" : "false",
         "PlanID" : "0",
         "PlanIDs" : [ 0 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "Speed" : "4",
         "SubType" : "TFA",
         "Temp" : 8.6999999999999993,
         "Timers" : "false",
         "Type" : "Wind",
         "TypeImg" : "wind",
         "Unit" : 6,
         "Used" : 1,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "98"
      }
I've just updated main.js (https://gitlab.com/robgeerts/dashboard/tree/master) to handle these types!
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: New Dashboard Design

Post by EdwinK »

Thanks. Great how this works. :)

And this is how the new blocks look like

Imageimage upload no limit
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: New Dashboard Design

Post by stlaha2007 »

@robgeerts... It really looks nice.
Clear and readable code.

I've adjusted it to my needs. Made it 2 colums, removed the weatherforecast etcetera...

While working on it i have 2 questions...
1) in index.html config.js and main.js are called with ?v=1, why? As i can't find it referenced there.
2) would it be handy to call CONFIG.js within index.html, and call the other files from there? So you can easily enable/disable/implement other scripts when used/not used?

Just curiousity, i'm not a native coder. But can write code in other languages.

Grtz.
User avatar
jaha
Posts: 55
Joined: Thursday 26 January 2017 10:26
Target OS: Linux
Domoticz version:
Contact:

Re: New Dashboard Design

Post by jaha »

Looks very nice, will domoticz alarm panel work with this?
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: New Dashboard Design

Post by stlaha2007 »

jaha wrote:Looks very nice, will domoticz alarm panel work with this?
Depends... As robgeerts has build it to replace a Toon device, i haven't seen code for the AlarmPanel yet.

But when your handy enough with coding javascript you can implement it yourself or embed it in the index.html if you want it....

I'm rewriting most of it (including the index.html), because of missing devices (and yes, i know, rob's working on it) and roomplan functionality.
Xroads
Posts: 30
Joined: Thursday 25 February 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: New Dashboard Design

Post by Xroads »

HI
Really love this design, but I'm strugling to get my own location for the weather (Denmark, Aarhus), where do I change it.

Thanks.
Raspberry pi 2
Razberry z-wave module with Fibaro dimmer, relay and pir and Dlink pir.
433mhz RFlink with 5 pcs. on/off switches
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: New Dashboard Design

Post by robgeerts »

stlaha2007 wrote:
jaha wrote:Looks very nice, will domoticz alarm panel work with this?
I'm rewriting most of it (including the index.html), because of missing devices (and yes, i know, rob's working on it) and roomplan functionality.
Maybe you can share the code when it is finished?

Xroads wrote:HI
Really love this design, but I'm strugling to get my own location for the weather (Denmark, Aarhus), where do I change it.

Thanks.
It always searched for the entered city (in config.js) in the Netherlands, I've just added a country-variable.
Download the latest version from gitlab!

Make sure you have the country-variable in config.js after you've updated!

Example:

Code: Select all

var _WEATHER_CITY 			= 'Aarhus';
var _WEATHER_COUNTRY 		= 'DK';
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: New Dashboard Design

Post by stlaha2007 »

Ofcourse i will ;)
By the way, do you happen to have answers to my questions?

Because it does help rewriting it. I already started seperating devices from main into utility(gas/water/energy), temp-weather(temp/baro/humidity/UV), heating (OTGW/EvoHome) and other_devices
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: New Dashboard Design

Post by robgeerts »

Wich questions?
As I can see, you only answer other people's questions in this topic?
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: New Dashboard Design

Post by stlaha2007 »

robgeerts wrote:Wich questions?
As I can see, you only answer other people's questions in this topic?
See: https://www.domoticz.com/forum/viewtopi ... 51#p124651

About ?v=1 and sourcing/calling multiple .js within index.html and move to config.js...
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: New Dashboard Design

Post by robgeerts »

stlaha2007 wrote:@robgeerts... It really looks nice.
1) in index.html config.js and main.js are called with ?v=1, why? As i can't find it referenced there.
I had some caching issues, so the idea was to change ?v=1 with every new version (v=2,v=3 etc). So, when loaded, it doesnt get a cached (and older) version of the file.
stlaha2007 wrote:@robgeerts... It really looks nice.
2) would it be handy to call CONFIG.js within index.html, and call the other files from there? So you can easily enable/disable/implement other scripts when used/not used?
That's fine by me :)
In that case, people only have to update js-files :)
Xroads
Posts: 30
Joined: Thursday 25 February 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: New Dashboard Design

Post by Xroads »


It always searched for the entered city (in config.js) in the Netherlands, I've just added a country-variable.
Download the latest version from gitlab!

Make sure you have the country-variable in config.js after you've updated!

Example:

Code: Select all

var _WEATHER_CITY 			= 'Aarhus';
var _WEATHER_COUNTRY 		= 'DK';
Thank you very much
Raspberry pi 2
Razberry z-wave module with Fibaro dimmer, relay and pir and Dlink pir.
433mhz RFlink with 5 pcs. on/off switches
User avatar
gjaa
Posts: 38
Joined: Thursday 12 February 2015 6:59
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: New Dashboard Design

Post by gjaa »

The following code in main.js (search for it as I have a newer version than you right now) fills the Woonkamer-block:

Code: Select all
if(data.result[r]['Type']=='Temp'){


If you know the IDX of the temperature-device, you could change this line to:

Code: Select all
if(data.result[r]['idx']==102){


(where 102 is the IDX-number)
I've changed the room temp with the idx number of te room temparature but woonkamer stays empty. It's one of my favorites so I can see its filled
screen.png
screen.png (295.51 KiB) Viewed 4731 times
What's going wrong??

Gerard
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: New Dashboard Design

Post by stlaha2007 »

Your missing the singlequotes.
As the data is textvalues and 102 is represented as text.
MarceldeJongNL
Posts: 43
Joined: Tuesday 03 May 2016 10:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5108
Location: Barendrecht
Contact:

Re: New Dashboard Design

Post by MarceldeJongNL »

gjaa wrote:
The following code in main.js (search for it as I have a newer version than you right now) fills the Woonkamer-block:

Code: Select all
if(data.result[r]['Type']=='Temp'){


If you know the IDX of the temperature-device, you could change this line to:

Code: Select all
if(data.result[r]['idx']==102){


(where 102 is the IDX-number)
I've changed the room temp with the idx number of te room temparature but woonkamer stays empty. It's one of my favorites so I can see its filled
screen.png

What's going wrong??

Gerard



If you look at the code, it only applies to Toon Thermostat values.

I have commented that line out and it shows my temperature now:

Code: Select all

      
			//			if(data.result[r]['HardwareType']=='Toon Thermostat'){
							if(data.result[r]['Type']=='P1 Smart Meter' && data.result[r]['SubType']=='Energy'){
								$('.energy').html(data.result[r]['Usage']);
								$('.energytoday').html(data.result[r]['CounterToday']);
								$('.energytoday').parents('.hideinit').show();
								$('.energy').parents('.hideinit').show();
							}
							if(data.result[r]['Type']=='P1 Smart Meter' && data.result[r]['SubType']=='Gas'){
								$('.gas').html(number_format(data.result[r]['CounterToday'],2,',','.')+' m3');
								$('.gas').parents('.hideinit').show();
							}
							if(data.result[r]['Type']=='Temp' && data.result[r]['idx']=='19'){
								$('.tempinside').html(data.result[r]['Temp']+'°C');
								$('.tempinside').parents('.hideinit').show();
							}
						
// }

Hardware: Raspberry Pi 2B | RFXCOM RFXtrx433E v1 | Synology DS213+ | KaKu Clones | Conrad RSL switches | KAKu Doorbell Clone | USB Webcam | ICY Thermostat | Resol DL2 | Imatic Relay Board | Eminent 6230 | Eminent 6220 | iMatic 16 ports Relay Board
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: New Dashboard Design

Post by stlaha2007 »

Thats also a piece to look for...
However its already mentioned earlier.

I'm rewriting main.js into a few seperate .js files, which will filter on devicetype instead of hardware.

I'm almost finished, and can be maintained easier if theres a new devicetype...

@robgeerts, how do i get the code to you? As most of the code is based on version of March 12. PM the code, so you can post it on your github (still need to setup mine :-) )
Locked

Who is online

Users browsing this forum: No registered users and 1 guest