Page 68 of 184
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 15:56
by Dropshot
wizjos wrote: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
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
Thank you, I've the same devices in Domoticz. I think I still don't understand how these 'blocktypes.Name' work. I only see the 'On' status of these devices:
How can I show the data instead of the status of these devices?
EDIT: Ah, I get it. I have added the lines to the blocks.js file (~/dashboard/js/blocks.js). It now shows the correct values,
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 15:59
by rbisschops
@robgeerts
I downloaded the lastest version. The 'Thuis' button is now behaving normally. I will try to add some custom.js for the combined behavious with aanwezig (like in the previous version) and using a standard font awesome image

.
Another one I checked is the latest blinds version. There is still a part cut off from the 'clickable' part of the + image. I think this is causing it:

- blinds.jpg (15.79 KiB) Viewed 2225 times
Thanks for the quick fixes so far. Much appreciated !
Ralph
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 16:25
by EdwinK
For now I give up on that Moonphase script. It still doesn't understand that my temp file is on '/var/packages/domoticz/scripts/lua/tmp/Moon.tmp'.
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 16:30
by wizjos
Dropshot wrote:EDIT: Ah, I get it. I have added the lines to the blocks.js file (~/dashboard/js/blocks.js). It now shows the correct values,
Nice to see it's working now! But you need to be aware that this file might be overwritten each time... Rob has implemented this via custom.js:
Code: Select all
function getExtendedBlockTypes(blocktypes){
blocktypes.Name['Download'] = { icon: 'fa fa-download', title: '<Name>', value: '<Data>' }
return blocktypes;
}
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 16:33
by wizjos
EdKo66 wrote:For now I give up on that Moonphase script. It still doesn't understand that my temp file is on '/var/packages/domoticz/scripts/lua/tmp/Moon.tmp'.
Sorry to read this... No luck with the orginal location (/var/tmp/phase.tmp) as well?
Wizjos
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 16:35
by SuperMouse
EDKO66
Is used this:
local tempfilename = '/home/pi/Moon.tmp' -- can be anywhere writeable
Start a SSH to you device and start the next commands direct after login:
BEWARE OF CAPITALS.
sudo nano Moon.tmp
sudo chmod 777 Moon.tmp
This helped me !
Also not this is important:
local city = "Maassluis" -- Your city for Wunderground API
local countryCode = "Maassluis" -- Your country code for Wunderground API
You need to have your city entered two times.
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 16:39
by wizjos
SuperMouse wrote:Also not this is important:
local city = "Maassluis" -- Your city for Wunderground API
local countryCode = "Maassluis" -- Your country code for Wunderground API
You need to have your city entered two times.

Huh, my countrycode is 'NL'
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 16:41
by EdwinK
wizjos wrote:EdKo66 wrote:For now I give up on that Moonphase script. It still doesn't understand that my temp file is on '/var/packages/domoticz/scripts/lua/tmp/Moon.tmp'.
Sorry to read this... No luck with the orginal location (/var/tmp/phase.tmp) as well?
Wizjos
Nope, no succes either.

Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 16:45
by EdwinK
SuperMouse wrote:EDKO66
Is used this:
local tempfilename = '/home/pi/Moon.tmp' -- can be anywhere writeable
Start a SSH to you device and start the next commands direct after login:
BEWARE OF CAPITALS.
sudo nano Moon.tmp
sudo chmod 777 Moon.tmp
This helped me !
Also not this is important:
local city = "Maassluis" -- Your city for Wunderground API
local countryCode = "Maassluis" -- Your country code for Wunderground API
You need to have your city entered two times.
Tried both 644 and 777 as permission. Both failed. I've got another tmp file on exact the same location, and that one works without problems. Even copied the exact path, and still no go.
Since you can't use nano on Synology, I used VI but that shouldn't really matter. Can give the double cityname a go, although I doubt that will fix the tmp. file problems.
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 16:51
by SuperMouse
Sorry, My mistake
Code: Select all
local city = "Maassluis" -- Your city for Wunderground API
local countryCode = "NL" -- Your country code for Wunderground API
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 17:00
by kdschlosser
I would like to make a suggestion. If the WU API key is present to use the radar from them.
It is nice because you have many options you can specify
radius of the radar
radius unit of measure
width of the image
height of the image
show base map (satellite view)
different colors for rain snow and mix
smooth the colors
remove any false radar reading
number of frames in animation
delay between frames of animation
timestamp image
animation or still image
you can also grab the condition/forecast icons from WU as well
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 17:06
by wizjos
EdKo66 wrote:wizjos wrote:EdKo66 wrote:For now I give up on that Moonphase script. It still doesn't understand that my temp file is on '/var/packages/domoticz/scripts/lua/tmp/Moon.tmp'.
Sorry to read this... No luck with the orginal location (/var/tmp/phase.tmp) as well?
Wizjos
Nope, no succes either.

If you PM me your working rainscript and the failing moon script maybe I can help you find the solution...
Wizjos
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 17:09
by pvm
For Android tablet users
turn screen on when motion
Still thinking about whether I will be using the Dashticz screensaver mode or totally turn the screen off based on the mentioned topic
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 17:10
by EdwinK
wizjos wrote:EdKo66 wrote:wizjos wrote:Sorry to read this... No luck with the orginal location (/var/tmp/phase.tmp) as well?
Wizjos
Nope, no succes either.

If you PM me your working rainscript and the failing moon script maybe I can help you find the solution...
Wizjos
Done so
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 17:18
by vmb
Does anybody know how I can add this (
www.klokradio.nl) local radiostaton to the Streamplayer? There is no mp3 stream available, only pls etc.
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 17:34
by sonar
vmb wrote:Does anybody know how I can add this (
http://www.klokradio.nl) local radiostaton to the Streamplayer? There is no mp3 stream available, only pls etc.
Stream url is:
http://klokradio.shoutcaststream.com:8062/
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 17:41
by EdwinK
After much work and some PM's with Wisjo, I'm happy to say that the Moonscript is finally working for me.
Pfftt...
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 17:48
by madrian
vmb wrote:Does anybody know how I can add this (
http://www.klokradio.nl) local radiostaton to the Streamplayer? There is no mp3 stream available, only pls etc.
Check sonar's answer, alternatively download pls and inside pls you can find the stream.
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 17:49
by vmb
Thx for very quick respons

. Stream does not respond

Any suggestions? This is the content from my config.js:
var _STREAMPLAYER_TRACKS = [
{"track":1,"name":"Klokradio","file":"
http://klokradio.shoutcaststream.com:8062"},
{"track":2,"name":"538 Hitzone","file":"
http://vip-icecast.538.lw.triple-it.nl/WEB11_MP3"},
Re: Dashticz v2.0, custom positioning and multiple screens
Posted: Sunday 23 April 2017 18:00
by SuperMouse
EdKo66 wrote:After much work and some PM's with Wisjo, I'm happy to say that the Moonscript is finally working for me.
Pfftt...
What was the solution?