Dashticz - General Discussions

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Locked
User avatar
wizjos
Posts: 78
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 »

HansieNL wrote:I've a little different error: Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_moon_phase.lua: /home/pi/domoticz/scripts/lua/script_time_moon_phase.lua:118: attempt to call field 'round' (a nil value)
As did I :oops:
Had a look at what was wrong. Cause was a division by zero...
New version of the lua moonphase script is to be found in a later post.

EDIT: code in this post removed...

Wizjos
Last edited by wizjos on Thursday 27 April 2017 10:11, edited 2 times in total.
Martijn85
Posts: 53
Joined: Wednesday 20 January 2016 20:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

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

Post by Martijn85 »

SwordFish wrote:I have dashticz running on a rpi and a tablet on the wall. Now i have dashticz also running on my NAS webserver. So i did some dirty custom css and now its fits on my iphone with a different layout as on my tablet 8-)
Nice! Can you please share this custom css? :D
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 »

WARNING: DASHTICZ HAS MOVED FROM GITLAB TO GITHUB!! BACKUP YOUR CONFIG.JS, CUSTOM.CSS AND CUSTOM.JS!!
From now on, you can find the source over here: https://github.com/robgeerts/dashticz_v2/tree/master

custom.js, custom.css and config.js has been moved to the custom-folder!
Also, I created a beta-branch to test new features, in the future. If you like you can download this branch but be prepared of having more bugs...

AND last but not least, I have moved the mentioned bugs and features to the github issue-tracker, instead of Trello:
https://github.com/robgeerts/dashticz_v2/issues

By the way, did I mention to BACKUP YOUR CONFIG.JS, CUSTOM.CSS AND CUSTOM.JS!! ?
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 »

I am going to celebrate this. :lol:

Should we send merge request to the beta branch? Then after test you can move to the stable one.

---

What about an (automatic) upgrade and backup feature? If it is welcomed, It is possible to get from github info about latest release?
Last edited by madrian on Wednesday 26 April 2017 17:36, edited 1 time in total.
User avatar
htilburgs
Posts: 464
Joined: Tuesday 03 November 2015 11:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post by htilburgs »

robgeerts wrote:WARNING: DASHTICZ HAS MOVED FROM GITLAB TO GITHUB!! BACKUP YOUR CONFIG.JS, CUSTOM.CSS AND CUSTOM.JS!!
From now on, you can find the source over here: https://github.com/robgeerts/dashticz_v2/tree/master

custom.js, custom.css and config.js has been moved to the custom-folder!
Also, I created a beta-branch to test new features, in the future. If you like you can download this branch but be prepared of having more bugs...

AND last but not least, I have moved the mentioned bugs and features to the github issue-tracker, instead of Trello:
https://github.com/robgeerts/dashticz_v2/issues

By the way, did I mention to BACKUP YOUR CONFIG.JS, CUSTOM.CSS AND CUSTOM.JS!! ?
Mmmm... work to do! Update wiki! ;)
Hardware:
RPi3 - Aeon Labs Z-Stick GEN5 - Fibaro Dimmer 2 - Fibaro Roller Shutter 2 - Fibaro Smoke Sensor - Yeelight RGBW Led bulb - Yeelight Smart LED Light Strip - Neo Coolcam PIR Motion Sensor - Neo Coolcam PowerPlug - Nest Thermostat v3
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 »

htilburgs wrote:
robgeerts wrote:WARNING: DASHTICZ HAS MOVED FROM GITLAB TO GITHUB!! BACKUP YOUR CONFIG.JS, CUSTOM.CSS AND CUSTOM.JS!!
From now on, you can find the source over here: https://github.com/robgeerts/dashticz_v2/tree/master

custom.js, custom.css and config.js has been moved to the custom-folder!
Also, I created a beta-branch to test new features, in the future. If you like you can download this branch but be prepared of having more bugs...

AND last but not least, I have moved the mentioned bugs and features to the github issue-tracker, instead of Trello:
https://github.com/robgeerts/dashticz_v2/issues

By the way, did I mention to BACKUP YOUR CONFIG.JS, CUSTOM.CSS AND CUSTOM.JS!! ?
Mmmm... work to do! Update wiki! ;)
You should consider to manage Wiki on the project's GitHub page too. 8-)
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

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

Post by robgeerts »

madrian wrote:I am going to celebrate this. Image

Should we send merge request to the beta branch? Then after test you can move to the stable one.

---

What about an (automatic) upgrade and backup feature? If it is welcomed, It is possible to get from github info about latest release?
Yes, merge requests to beta :)
Will look into the upgrade functions/alerts.
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 »

Look for "releases" on GitHub, it is possible to make releases here. From that point it is easy as pie /there is an RSS feed for release page/.

https://help.github.com/articles/creating-releases/
User avatar
htilburgs
Posts: 464
Joined: Tuesday 03 November 2015 11:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post by htilburgs »

madrian wrote:
htilburgs wrote:
robgeerts wrote:WARNING: DASHTICZ HAS MOVED FROM GITLAB TO GITHUB!! BACKUP YOUR CONFIG.JS, CUSTOM.CSS AND CUSTOM.JS!!
From now on, you can find the source over here: https://github.com/robgeerts/dashticz_v2/tree/master

custom.js, custom.css and config.js has been moved to the custom-folder!
Also, I created a beta-branch to test new features, in the future. If you like you can download this branch but be prepared of having more bugs...

AND last but not least, I have moved the mentioned bugs and features to the github issue-tracker, instead of Trello:
https://github.com/robgeerts/dashticz_v2/issues

By the way, did I mention to BACKUP YOUR CONFIG.JS, CUSTOM.CSS AND CUSTOM.JS!! ?
Mmmm... work to do! Update wiki! ;)
You should consider to manage Wiki on the project's GitHub page too. 8-)
@Robgeerts, this is an option.
I think I've to rewrite the wiki, because Github uses an other format.
And you have to create the wiki, because it's your project ;) (I believe I cannot create a wiki if you not started one).
Hardware:
RPi3 - Aeon Labs Z-Stick GEN5 - Fibaro Dimmer 2 - Fibaro Roller Shutter 2 - Fibaro Smoke Sensor - Yeelight RGBW Led bulb - Yeelight Smart LED Light Strip - Neo Coolcam PIR Motion Sensor - Neo Coolcam PowerPlug - Nest Thermostat v3
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 »

robgeerts wrote:
By the way, did I mention to BACKUP YOUR CONFIG.JS, CUSTOM.CSS AND CUSTOM.JS!! ?

You mean we have to backup some files? ;)
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
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 »

Smallish 'error'. Your script says to get 'Moon.0.png', but it is named 'Moon.00.png' in the images map. Easy to fix by just changing the name of the file, but others might not find it.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
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 »

EdKo66 wrote:
robgeerts wrote:
By the way, did I mention to BACKUP YOUR CONFIG.JS, CUSTOM.CSS AND CUSTOM.JS!! ?

You mean we have to backup some files? ;)
Sort of ;)
EdKo66 wrote:Smallish 'error'. Your script says to get 'Moon.0.png', but it is named 'Moon.00.png' in the images map. Easy to fix by just changing the name of the file, but others might not find it.
I will rename it :)
TapNL
Posts: 30
Joined: Monday 24 April 2017 21:52
Target OS: -
Domoticz version:
Contact:

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

Post by TapNL »

Just updated to the new version. Works brilliant. Happy with the different maps possible.
Everything is set to get a tablet on the wall or to get a touchscreen monitor with a pi connected.
I favour the last option.

@rob: thanks again.
User avatar
HansieNL
Posts: 957
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by HansieNL »

TapNL wrote:Just updated to the new version. Works brilliant. Happy with the different maps possible.
Everything is set to get a tablet on the wall or to get a touchscreen monitor with a pi connected.
I favour the last option.

@rob: thanks again.
MagicMirror² The open source modular smart mirror platform.
https://magicmirror.builders/
Blah blah blah
User avatar
mvveelen
Posts: 678
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 »

Also updated to the latest (beta) from the new location, but I receive an error:

Code: Select all

Domoticz error!
Please, double check the path in _HOST_DOMOTICZ-variable!
Nothing changed in the CONFIG.js and Domoticz is still running. What's wrong ??

Edit: read, read, READ !!

Moved config.js to the custom folder :)
Last edited by mvveelen on Wednesday 26 April 2017 20:41, edited 1 time in total.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
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 »

wizjos wrote:
HansieNL wrote:I've a little different error: Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_moon_phase.lua: /home/pi/domoticz/scripts/lua/script_time_moon_phase.lua:118: attempt to call field 'round' (a nil value)
As did I :oops:
Had a look at what was wrong. Cause was a division by zero...
New version of the lua moonphase script
Spoiler: show

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='00'
        else
            if waardecheck==false then
                picnumber=math.floor(math.abs(percentIlluminated-100)/2)
                n=tostring(picnumber)
                if n.length==1 then
                    n='0'+n
                end
            else
                picnumber=math.round(50+(percentIlluminated/2))
                if picnumber == 100 then
	        	    picnumber=99
    		    end
            end
            n=tostring(picnumber)
        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

Please confirm if this does the trick.

Sorry for the inconvenience!
Wizjos

Edit: typo in script fixed[/quote

partly conformed
Only

Code: Select all

n='00'
should be

Code: Select all

n='50'
Although my moon.50.png is New Moon and moon.00.png is a full moon
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)
User avatar
mvveelen
Posts: 678
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 »

I was wondering: Is it possible to get the "var _SHOW_LASTUPDATE" per device?

For instance: I couldn't care less when the last time it was when I switch off a light, but it would be nice to see when a door sensor has been opened/closed.
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 »

bierlaagh wrote:
[qoute]Edit: typo in script fixed
partly conformed
Only

Code: Select all

n='00'
should be

Code: Select all

n='50'
Although my moon.50.png is New Moon and moon.00.png is a full moon

Don't know about that. The moon looked good for me. Will see what Rob makes of it :)
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
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 »

We can better ask @madrian ... He created that part ;)
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 »

What part? Moon part wasn't me. :shock: :)
Locked

Who is online

Users browsing this forum: No registered users and 1 guest