Dashticz - General Discussions

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Locked
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

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

Post by Nautilus »

robgeerts wrote:
Added to my todolist at:
https://trello.com/b/qsNqHtie/dashboard
Great, thanks! :D
User avatar
mvveelen
Posts: 687
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

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

Post by mvveelen »

:oops:

Working, thanks!

Is it also possible to change the Scene-names? Tried

Code: Select all

blocks[s1] = {}
blocks[s1]['title'] = 'Living';
But that was not the way to go.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
madrian
Posts: 231
Joined: Saturday 27 August 2016 1:18
Target OS: -
Domoticz version:
Contact:

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

Post by madrian »

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?
Add to custom.css:

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;
}
Result:
Screen Shot 2017-04-21 at 22.55.38.png
Screen Shot 2017-04-21 at 22.55.38.png (223.93 KiB) Viewed 2733 times
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

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

Post by robgeerts »

mvveelen wrote::oops:

Working, thanks!

Is it also possible to change the Scene-names? Tried

Code: Select all

blocks[s1] = {}
blocks[s1]['title'] = 'Living';
But that was not the way to go.
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:

Code: Select all

blocks['s1'] = {}
blocks['s1']['title'] = 'Living';
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

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

Post by robgeerts »

madrian wrote:
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?
Add to custom.css:

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;
}
Result:

Screen Shot 2017-04-21 at 22.55.38.png
Added to the core CSS :)
(Next version will be there in the next couple of days!
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

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

Post by Nautilus »

madrian wrote:
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?
Add to custom.css:

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;
}
Thanks, will try! :)
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

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

Post by robgeerts »

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? :)
Denied! :)
Take a closer look at the if-row ;)
(This is a function, designed to manually switch this, another user requested this)
madrian
Posts: 231
Joined: Saturday 27 August 2016 1:18
Target OS: -
Domoticz version:
Contact:

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

Post by madrian »

robgeerts wrote:
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? :)
Denied! :)
Take a closer look at the if-row ;)
(This is a function, designed to manually switch this, another user requested this)
Ok, got it.

Code: Select all

blocks[5]['switch'] = true;
8-) Thanks!
User avatar
bierlaagh
Posts: 42
Joined: Friday 14 March 2014 16:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9984
Contact:

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

Post by bierlaagh »

Rob Thnx UV is working great now. only without the possibility of showing Graph

Another thing i noticed is that the function to change the background isn't working anymore.

the last working version i downloaded 19 of april, but haven't found where i had to look wat has changed.
1x Raspberry PI 3 With Domoticz V.3.7318
1X RFXtrx433 USB 433.92MHz
1X Synology DS213j Nas
Toon by Eneco including Toon Zon
several KAKU switches and dimmers
Mysensors WIFI Gateway including meters, switches en humidity sensors
Wifi Dimmers (home made)
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

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

Post by robgeerts »

Do you mean the changing background by time of the day?
User avatar
bierlaagh
Posts: 42
Joined: Friday 14 March 2014 16:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9984
Contact:

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

Post by bierlaagh »

robgeerts wrote:Do you mean the changing background by time of the day?
indeed. the background change by time of 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]
1x Raspberry PI 3 With Domoticz V.3.7318
1X RFXtrx433 USB 433.92MHz
1X Synology DS213j Nas
Toon by Eneco including Toon Zon
several KAKU switches and dimmers
Mysensors WIFI Gateway including meters, switches en humidity sensors
Wifi Dimmers (home made)
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

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

Post by robgeerts »

bierlaagh wrote:
robgeerts wrote:Do you mean the changing background by time of the day?
indeed. the background change by time of 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 weekend ;)
jurjan
Posts: 5
Joined: Saturday 22 April 2017 11:06
Target OS: -
Domoticz version:
Contact:

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

Post by jurjan »

I am trying to add a domoticz group to dashticz, but the group has the same idx as one of my switches.
How can I do this?
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

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

Post by robgeerts »

add 's' before the idx number.

columns[1]['blocks'] = ['s1']

dont forget the quotes!
marcotrumpet
Posts: 102
Joined: Saturday 18 February 2017 8:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by marcotrumpet »

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
Schermata 2017-04-22 alle 11.37.39 copia.jpg (144.76 KiB) Viewed 2603 times
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
Schermata 2017-04-22 alle 11.38.22 copia.jpg (144.91 KiB) Viewed 2603 times
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
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

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

Post by robgeerts »

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
Well, in your first image, you use 3 columns wich is to much for a small screen.
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 ;)
marcotrumpet
Posts: 102
Joined: Saturday 18 February 2017 8:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by marcotrumpet »

robgeerts wrote:
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
Well, in your first image, you use 3 columns wich is to much for a small screen.
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 ;)
Waiting for his answer I share this with you, maybe a better way to explain due to my bad english
http://dropcanvas.com/z2yio
User avatar
wizjos
Posts: 79
Joined: Monday 07 March 2016 19:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

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

Post by wizjos »

Together with @robgeerts I've created the possibility to read Wunderground's moonphase data. It will be released in the upcoming version...
moonphase.PNG
moonphase.PNG (254.44 KiB) Viewed 2584 times
I'll try to explain what is needed

At first you need a LUA script to read the data from Wunderground. Don't forget to fill in the right values for your situation!
You also may want to change the dutch description of the different moon phases (8x) like 'volle maan':

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

EDIT: I've revised this script because there were a few errors in it.
Found a bug when the picturenumber length = 1 (eg. 0-9). The code to add a '0' before the picturenumber was not right. Corrected. See later posts. Script here updated as well.


As you can see there are some (dummy)devices that need to be created in Domoticz.
2 uservariables:
- MoonPicture
- MoonphaseCheck
Both of type string...

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

Create these...
When debug is set to true the log should read something like:
LUA: Moonphase - Collecting data from: http://api.wunderground.com/api/key/ast ... laats.json
LUA: Moonrise: 4:23
LUA: Moonset: 14:17
LUA: Percent: 32%
LUA: Age: 24
LUA: Picture number: 34 Picture name: moon.34.png

When everything is up-and-running in Domoticz you need to make the following settings in config.js:
Create a variabele for the moonphase picture index:

Code: Select all

var _IDXmoonpicture		= 12; //index of the uservariabele MoonPicture
and a button:

Code: Select all

buttons.moon= {width:12, isimage:true, refreshimage:60000, image: 'moon'}
!Caution: image: 'moon' is a placeholder: it will be filled with the right moonphase-picture filename...

and finally a setting like this, to place the block in a column:

Code: Select all

columns[9]['blocks'] = ['blocktitle_3_3',buttons.moon,132,125]

Regards,
Wizjos

EDIT: Revised LUA script. See above.
EDIT2: Revised the LUA script once more. See above.
Last edited by wizjos on Friday 12 May 2017 13:51, edited 4 times in total.
User avatar
mvveelen
Posts: 687
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

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

Post by mvveelen »

Tried to get the newsfeed from Telegraaf.nl (http://feeds.feedburner.com/telegraaf/RiEs) but if I replace the Tweakers.net URL with the Telegraaf URL, the block disappears. Something wrong with the way I tried it?

Code: Select all

blocks['news_2'] = {}
blocks['news_2']['feed'] = 'https://crossorigin.me/http://feeds.feedburner.com/telegraaf/RiEs';
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

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

Post by EdwinK »

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
Okay, so far I understand. :lol: But then
As you can see there are some (dummy)devices that need to be created in Domoticz.
2 uservariables:
- MoonPicture
- MoonphaseCheck
Will I make this in the tab setup/More Option/User Variables?. If so, I get an err[rror]

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
At least these i understand ;)
Regards,
Wizjos
Thanks.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Locked

Who is online

Users browsing this forum: No registered users and 1 guest