Great, thanks!

Moderators: leecollings, htilburgs, robgeerts
Great, thanks!
Code: Select all
blocks[s1] = {}
blocks[s1]['title'] = 'Living';
Add to custom.css:When trying to fit stuff on my old (wall-mounted) iPad 2 I was thinking the \"currentweather_big\" takes a bit too much space. What would be the best way to make this a somewhat smaller, some custom.css approach perhaps?
Code: Select all
/* smaller .weather block */
.weatherfull > div div.day {
margin-top: 0px;
}
.weatherfull > div div.icon {
height: 60px;
margin: 0px auto;
}
.weatherfull > div div.temp .nightT {
padding-bottom: 0px;
}
You missed the quotes, in case of only number it's not need but for scenes, so when there's a S before the idx, you have to add quotes:mvveelen wrote:![]()
Working, thanks!
Is it also possible to change the Scene-names? Tried
But that was not the way to go.Code: Select all
blocks[s1] = {} blocks[s1]['title'] = 'Living';
Code: Select all
blocks['s1'] = {}
blocks['s1']['title'] = 'Living';
Added to the core CSSmadrian wrote:Add to custom.css:When trying to fit stuff on my old (wall-mounted) iPad 2 I was thinking the \"currentweather_big\" takes a bit too much space. What would be the best way to make this a somewhat smaller, some custom.css approach perhaps?
Result:Code: Select all
/* smaller .weather block */ .weatherfull > div div.day { margin-top: 0px; } .weatherfull > div div.icon { height: 60px; margin: 0px auto; } .weatherfull > div div.temp .nightT { padding-bottom: 0px; }
Screen Shot 2017-04-21 at 22.55.38.png
Thanks, will try!madrian wrote:Add to custom.css:When trying to fit stuff on my old (wall-mounted) iPad 2 I was thinking the \"currentweather_big\" takes a bit too much space. What would be the best way to make this a somewhat smaller, some custom.css approach perhaps?
Code: Select all
/* smaller .weather block */ .weatherfull > div div.day { margin-top: 0px; } .weatherfull > div div.icon { height: 60px; margin: 0px auto; } .weatherfull > div div.temp .nightT { padding-bottom: 0px; }
Denied!madrian wrote:Just submitted a cosmetic bugfix: change switch's title/status position as it is for all other devices (first is status, second row is title).
Rob: maybe you are right, I am always thinking in tablet screen. Maybe we should create a poll about screen sizes?
Ok, got it.robgeerts wrote:Denied!madrian wrote:Just submitted a cosmetic bugfix: change switch's title/status position as it is for all other devices (first is status, second row is title).
Rob: maybe you are right, I am always thinking in tablet screen. Maybe we should create a poll about screen sizes?
Take a closer look at the if-row
(This is a function, designed to manually switch this, another user requested this)
Code: Select all
blocks[5]['switch'] = true;
indeed. the background change by time of dayrobgeerts wrote:Do you mean the changing background by time of the day?
Code: Select all
var screens = {}
screens[1] = {}
screens[1]['background'] = 'bg1.jpg';
screens[1]['background_morning'] = 'bg_morning.jpg';
screens[1]['background_noon'] = 'bg_noon.jpg';
screens[1]['background_afternoon'] = 'bg_afternoon.jpg';
screens[1]['background_night'] = 'bg_night.jpg';
screens[1]['columns'] = [1,2,3]
Fixed in latest version wich will be pushed somewhere this weekendbierlaagh wrote:indeed. the background change by time of dayrobgeerts wrote:Do you mean the changing background by time of the day?
Code: Select all
var screens = {} screens[1] = {} screens[1]['background'] = 'bg1.jpg'; screens[1]['background_morning'] = 'bg_morning.jpg'; screens[1]['background_noon'] = 'bg_noon.jpg'; screens[1]['background_afternoon'] = 'bg_afternoon.jpg'; screens[1]['background_night'] = 'bg_night.jpg'; screens[1]['columns'] = [1,2,3]
Well, in your first image, you use 3 columns wich is to much for a small screen.marcotrumpet wrote:Hi everyone.. I still can't use your dashboard. (I'm the guy uploaded the change to your dashboard some pages back). I've just installed the last version but there are the same problem of a week ago (problem form me of course).
that's what appen if I use your dashboard in a smaller screen (like a phone)
Schermata 2017-04-22 alle 11.37.39 copia.jpg
that's is your dashboard with my code. (the page became scrollable up and down because of the resize)
Schermata 2017-04-22 alle 11.38.22 copia.jpg
Do you think that's possible to implement?
this is your dashboard with modification (if you remember I didn't modify nothing because I don't know how to. My brother made this to me so I can only share with you all the code hoping you'll find the code) http://dropcanvas.com/frli6
Waiting for his answer I share this with you, maybe a better way to explain due to my bad englishrobgeerts wrote:Well, in your first image, you use 3 columns wich is to much for a small screen.marcotrumpet wrote:Hi everyone.. I still can't use your dashboard. (I'm the guy uploaded the change to your dashboard some pages back). I've just installed the last version but there are the same problem of a week ago (problem form me of course).
that's what appen if I use your dashboard in a smaller screen (like a phone)
Schermata 2017-04-22 alle 11.37.39 copia.jpg
that's is your dashboard with my code. (the page became scrollable up and down because of the resize)
Schermata 2017-04-22 alle 11.38.22 copia.jpg
Do you think that's possible to implement?
this is your dashboard with modification (if you remember I didn't modify nothing because I don't know how to. My brother made this to me so I can only share with you all the code hoping you'll find the code) http://dropcanvas.com/frli6
Your brother changed it so you use 1 column (where titles have width of 12 en the switches width of 6).
Could you ask your brother what he has changed at creative.css or main.js?
I cannot spit through you code to find all changes
Code: Select all
-- Variables to customize ------------------------------------------------
local moonpicture = "MoonPicture" -- name of the uservar to write the name of the moonphase picture to
local checkvar = "MoonphaseCheck" -- name of the uservar to check if update is allowed
local checktime = 3600 -- check allowed every x seconds 3600 = 60 min. Check the wundergroud API limitation before changing this
local city = "<your town>" -- Your city for Wunderground API
local countryCode = "<YOUR COUNTRY CODE>" -- Your country code for Wunderground API
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
local wuAPIkey = "<your key>" -- Your Weather Underground API Key
local DOMO_IP = "<your domo ip>" -- Domoticz ip address
local DOMO_PORT = "<your domo port>" -- Domoticz port
local tempfilename = '/var/tmp/phase.tmp' -- can be anywhere writeable
local debug=false -- false, true for domoticz log
-------------------------------------------------------------------------
function file_exists(path)
-- function to check if a file exists
local file = io.open(path, "rb")
if file then file:close() end
return file ~= nil
end
function timedifference(s)
-- function to determine the difference in seconds between the current time and a given one
year = string.sub(s, 1, 4)
month = string.sub(s, 6, 7)
day = string.sub(s, 9, 10)
hour = string.sub(s, 12, 13)
minutes = string.sub(s, 15, 16)
seconds = string.sub(s, 18, 19)
t1 = os.time()
t2 = os.time{year=year, month=month, day=day, hour=hour, min=minutes, sec=seconds}
difference = os.difftime (t1, t2)
return difference
end
function may_update(device, timeelapsed)
-- function to check whether an update is allowed
return uservariables_lastupdate[device] == nil or timedifference(uservariables_lastupdate[device]) >= timeelapsed
end
commandArray = {}
time = os.date("*t")
url='http://api.wunderground.com/api/'..wuAPIkey..'/astronomy/q/'..countryCode..'/'..city..'.json'
if (may_update(checkvar,checktime)==true) or (file_exists(tempfilename)==false) then
-- read API Wunderground
if debug then print("Moonphase - Collecting data from: "..url) end
os.execute('curl -s '..url..' > '..tempfilename)
-- NOTE: if the command above doens't work in your situation try
-- read = os.execute('curl -s -o '..tempfilename..' "'..url..'"')
-- instead! Thanks to EdKo66
file = io.open(tempfilename, "r")
s= file:read("*a")
s = (string.gsub(s, "%c+", ""))
file:close()
-- moonrise
moonriseHour, moonriseMinute = string.match(s, [["moonrise": {"hour":"(%d+)","minute":"(%d+)"]])
if debug then print("Moonrise:\t"..moonriseHour..":"..moonriseMinute) end
-- moonset
moonsetHour, moonsetMinute = string.match(s, [["moonset": {"hour":"(%d+)","minute":"(%d+)"]])
if debug then print("Moonset:\t"..moonsetHour..":"..moonsetMinute) end
-- percentage of moon illuminated
percentIlluminated = string.match(s, [["percentIlluminated":"(%d+)"]])
if debug then print("Percent:\t"..percentIlluminated.."%") end
-- age of moon since last new moon
age = string.match(s, [["ageOfMoon":"(%d+)"]])
if debug then print("Age:\t\t"..age) end
-- Phase of the moon
-- set the moonPhaseIcon to your appropriate icon number (8 x)
moonPhase = string.match(s, [["phaseofMoon":"(.-)"]])
if moonPhase=="New Moon" then
moonPhase = "Nieuwe maan"
is_waxing = true
end
if moonPhase=="Waxing Crescent" then
moonPhase = "Wassende halve maan"
is_waxing = true
end
if moonPhase=="First Quarter" then
moonPhase = "Eerste kwartier"
is_waxing = true
end
if moonPhase=="Waxing Gibbous" then
moonPhase = "Wassende maan"
is_waxing = true
end
if moonPhase=="Full" then
moonPhase = "Volle maan"
is_waxing = false
end
if moonPhase=="Waning Gibbous" then
moonPhase = "Afnemende maan"
is_waxing = false
end
if moonPhase=="Last Quarter" then
moonPhase = "Laatste kwartier"
is_waxing = false
end
if moonPhase=="Waning Crescent" then
moonPhase = "Afnemende halve maan"
is_waxing = false
end
-- calculate moonphase picture
if percentIlluminated == '0' then
n='50'
else
if waardecheck==false then
picnumber=math.floor(math.abs(percentIlluminated-100)/2)
else
picnumber=math.floor(50+(percentIlluminated/2))
if picnumber == 100 then
picnumber=99
end
end
n=tostring(picnumber)
if string.len(n)==1 then
n='0'..n
end
end
picture='moon.'..n..'.png'
if debug then print('Picture number: '..n..' '..'Picture name: '..picture) end
commandArray['Variable:'..checkvar]=moonPhase
commandArray['Variable:'..moonpicture]=picture
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}
else
if debug then print("MoonPhase - Update not allowed: Difference is "..timedifference(uservariables_lastupdate[checkvar]).." seconds") end
end
return commandArray
Code: Select all
var _IDXmoonpicture = 12; //index of the uservariabele MoonPicture
Code: Select all
buttons.moon= {width:12, isimage:true, refreshimage:60000, image: 'moon'}
Code: Select all
columns[9]['blocks'] = ['blocktitle_3_3',buttons.moon,132,125]
Code: Select all
blocks['news_2'] = {}
blocks['news_2']['feed'] = 'https://crossorigin.me/http://feeds.feedburner.com/telegraaf/RiEs';
Okay, so far I understand.wizjos wrote:Together with @robgeerts I've created the possibility to read Wunderground's moonphase data. It will be released in the upcoming version...
moonphase.PNG
I'll try to explain what is needed
Will I make this in the tab setup/More Option/User Variables?. If so, I get an err[rror]As you can see there are some (dummy)devices that need to be created in Domoticz.
2 uservariables:
- MoonPicture
- MoonphaseCheck
At least these i understand
and 5 devices:
idx; Hardware; Name; Type; Axislabel
124; DummySwitch; Moon up; Text
125; DummySwitch; Moonpercentage; Percentage
127; DummySwitch; Moon under; Text
131; DummySwitch; Moon age; Custom Sensor; Days
132; DummySwitch; Moonphase; Text
Thanks.Regards,
Wizjos
Users browsing this forum: No registered users and 1 guest