Page 67 of 184

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 9:25
by EdwinK
wizjos wrote:
EdKo66 wrote:Yes, I even triple checked it. Just to be sure I put in the full path to the Moon.tmp file, '../var/packages/domoticz/scripts/lua/tmp/Moon.tmp', checked the permissions of that file (777). My Rain.tmp uses the same path (different file, of course) and that is working. It has to have something to do with permissions, but can't figure it out now. And since I'm now working on it for about 8 hours, going to bed, and will think more tomorrow.
Hmmm, a thought on that: have you checked the output from a direct call to Wunderground (eg.: in a putty session issueing the same command as the script would)?
This is what I get. At first I thought maybe it's because of the double '/' in the URL, but it seems to work.

Code: Select all

root@DiskStation:~# curl http://api.wunderground.com/api/APIKEY/astronomy/q//Rhoon.json

{
  "response": {
  "version":"0.1",
  "termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
  "features": {
  "astronomy": 1
  }
	}
		,	"moon_phase": {
		"percentIlluminated":"14",
		"ageOfMoon":"26",
		"phaseofMoon":"Waning Crescent",
		"hemisphere":"North",
		"current_time": {
		"hour":"9",
		"minute":"23"
		},
		"sunrise": {
		"hour":"6",
		"minute":"28"
		},
		"sunset": {
		"hour":"20",
		"minute":"53"
		},
		"moonrise": {
		"hour":"5",
		"minute":"26"
		},
		"moonset": {
		"hour":"16",
		"minute":"56"
		}
	},
	"sun_phase": {
		"sunrise": {
		"hour":"6",
		"minute":"28"
		},
		"sunset": {
		"hour":"20",
		"minute":"53"
		}
	}
}

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 10:16
by robgeerts
That seems ok!
Remove your api key ;)

I really think its your tempfile, it gets the data but cannot write correctly...

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 10:19
by EdwinK
Would it make a change if I put the script inside the /scripts/lua folder instead of in the events tab.

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 10:22
by robgeerts
Yeah or setup a cronjob

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 10:48
by wizjos
EdKo66 wrote:Would it make a change if I put the script inside the /scripts/lua folder instead of in the events tab.
For me, on a synology a well, the latter is not an option. I can place a script there, but it does nothing...
I agree with @robgeerts that it's probably a matter of rights...
Sure you have the lua script set up like this?
event.PNG
event.PNG (51.23 KiB) Viewed 2120 times

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 10:51
by SwordFish
This is a very nice update with the swipe and stuff :D
One question, how do i remove the dots on the bottom page? When i have swipe i don't need the dots 8-)

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 10:58
by maluko
SwordFish wrote:This is a very nice update with the swipe and stuff :D
One question, how do i remove the dots on the bottom page? When i have swipe i don't need the dots 8-)
good question :)

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 11:02
by SwordFish
Also noticed that the train and traffic isn't working?

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 11:04
by Dropshot
SwordFish wrote:Also noticed that the train and traffic isn't working?
Just wanted to ask the same, my news and traffic aren't working anymore.

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 11:07
by SwordFish
Dropshot wrote:
SwordFish wrote:Also noticed that the train and traffic isn't working?
Just wanted to ask the same, my news and traffic aren't working anymore.
I think there down, just did a test with a older version and there is it also not working :?

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 11:10
by SwordFish
maluko wrote:
SwordFish wrote:This is a very nice update with the swipe and stuff :D
One question, how do i remove the dots on the bottom page? When i have swipe i don't need the dots 8-)
good question :)
Found it ( i think)

Code: Select all

.swiper-pagination-bullet 
{
	display: none !important;
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 100%;
    background: #000;
    opacity: .2;
}
This is working

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 11:16
by EdwinK
wizjos wrote:
EdKo66 wrote:Would it make a change if I put the script inside the /scripts/lua folder instead of in the events tab.
For me, on a synology a well, the latter is not an option. I can place a script there, but it does nothing...
I agree with @robgeerts that it's probably a matter of rights...
Sure you have the lua script set up like this?event.PNG
Screen Shot 2017-04-23 at 11.15.23.png
Screen Shot 2017-04-23 at 11.15.23.png (31.84 KiB) Viewed 2104 times
(Changed 'time' to 'all')

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 11:27
by Maartenkr
I dont se the picture of the moon fase in the dasboard.

First i had a fault i forgote the pictures. now ia add them but no picture?

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 11:27
by maluko
SwordFish wrote:
maluko wrote:
SwordFish wrote:This is a very nice update with the swipe and stuff :D
One question, how do i remove the dots on the bottom page? When i have swipe i don't need the dots 8-)
good question :)
Found it ( i think)

Code: Select all

.swiper-pagination-bullet 
{
	display: none !important;
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 100%;
    background: #000;
    opacity: .2;
}
This is working
you can put this on custom.css

Code: Select all

.swiper-pagination-bullet {
    width: 0px;
    height: 0px;
}

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 12:11
by Dropshot
wizjos wrote:Together with @robgeerts I've created the possibility to read Wunderground's moonphase data. It will be released in the upcoming version...

Image

Great tutorial, thanks. I have one question though, how did you create the blocks beneath the moon picture? I get only 'on' instead of the tekst value.

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 12:30
by madrian
@Rob,
Dashboard.jpg
Dashboard.jpg (101.8 KiB) Viewed 2084 times
1, Can you please change title order for percentage and fertility (General-Custom Sensor) type device (red arrow, blue arrow)?

Percentage:

Code: Select all

{
         "BatteryLevel" : 93,
         "CustomImage" : 0,
         "Data" : "54.00%",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 2,
         "HardwareName" : "Dummy",
         "HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
         "HardwareTypeVal" : 15,
         "HaveTimeout" : true,
         "Image" : "Computer",
         "LastUpdate" : "2017-04-23 12:10:09",
         "Name" : "MiFlora1_moisture",
         "SubType" : "Percentage",
         "Type" : "General",
         "TypeImg" : "hardware",
         "Unit" : 1,
         "Used" : 1,
         "idx" : "41"
      },
Fertility:

Code: Select all

 {
         "Data" : "788 Fertility",
         "HardwareName" : "Dummy",
         "HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
         "HardwareTypeVal" : 15,
         "Image" : "Custom",
         "LastUpdate" : "2017-04-23 12:10:09",
         "Name" : "MiFlora1_fertility",
         "SensorType" : 1,
         "SensorUnit" : "Fertility",
         "ShowNotifications" : true,
         "SubType" : "Custom Sensor",
         "Type" : "General",
         "TypeImg" : "Custom",
         "Unit" : 1,
         "Used" : 1,
         "idx" : "42"
      },
2, add missing FA icon for fertility type sensor. We should use this one.

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 12:58
by SuperMouse
Hello all.

Just saying this Dashticz v2.0 is really really greet to play with an looks very nice.
Mayby it is an idea to create a new post and 'show off' you Dashticz?

My question: is it also possible to alter the 'data' value or to clear it totally?

Now I am using green for home and red for away:

See custom css:

.fa.fa-female.on {color: green}
.fa.fa-female.off {color: red}

I think this would look nicer.

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 12:59
by wizjos
Dropshot wrote:Great tutorial, thanks. I have one question though, how did you create the blocks beneath the moon picture? I get only 'on' instead of the tekst value.
Thanks for the compliment!
About the block beneath the moon, these are filled from the lua script. The first block is the value from idxmoonphase and the second one contains the value of idxmoonpercentage.:

Code: Select all

local idxmoonpercentage ='125'              -- Your virtual moon percentage illuminated Device ID
local idxmoonage ='131'                     -- Your virtual moon age Device ID
local idxmoonphase ='132'                   -- Your virtual moon phase Device ID
local idxmoonrise='124'                     -- Your virtual moon rise variable ID
local idxmoonset='127'                      -- Your virtual moon set variable ID
The values are stored in this part of the script:

Code: Select all

        commandArray[1] = {['UpdateDevice'] = idxmoonphase.."|0|"..moonPhase}
        commandArray[2] = {['UpdateDevice'] = idxmoonrise.."|0|"..moonriseHour..":"..moonriseMinute}
        commandArray[3] = {['UpdateDevice'] = idxmoonset.."|0|"..moonsetHour..":"..moonsetMinute}
        commandArray[4] = {['UpdateDevice'] = idxmoonage.."|0|"..age}
        commandArray[5] = {['UpdateDevice'] = idxmoonpercentage.."|0|"..percentIlluminated}
In Domoticz I've created these dummy sensors:
virtual devices.PNG
virtual devices.PNG (18.4 KiB) Viewed 2072 times
That's about all I had to do as far as I remember :)

There is however one thing to the moonphase block. By default it only shows as displayed when you name the virtual device as shown here:

Code: Select all

blocktypes.Name['Maanfase'] = { icon: 'fa fa-moon-o', title: '<Data>', value: '<Name>' }
blocktypes.Name['Moon phase'] = { icon: 'fa fa-moon-o', title: '<Data>', value: '<Name>' }
blocktypes.Name['Mondphase'] = { icon: 'fa fa-moon-o', title: '<Data>', value: '<Name>' }
Defined in blocks.js.
There is a way around this by adding this code in custom.js

Code: Select all

function getExtendedBlockTypes(blocktypes){
   blocktypes.Name['My moon phase name'] = { icon: 'fa fa-moon-o', title: '<Data>', value: '<Name>' }
   return blocktypes;
}
I hope that helps!

Regards,
Wizjos

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 13:20
by mvveelen
SuperMouse wrote:Hello all.

Just saying this Dashticz v2.0 is really really greet to play with an looks very nice.
Mayby it is an idea to create a new post and 'show off' you Dashticz?
A new topic with "show off" your Dashticz v2 would be nice, BUT.....with exactly a how-to. So, if someone has something added or changed, simply write down how you did it so others can use it.

Re: Dashticz v2.0, custom positioning and multiple screens

Posted: Sunday 23 April 2017 13:33
by SuperMouse
I will start mine with some print screens and exports of the custom.css and config.js
I need to clean up the code and make some pictures first :P

Here it is:
Show your Dashticz v2.0 and how-to's!

https://www.domoticz.com/forum/viewtopi ... =8&t=17242