Page 1 of 3

Dashticz - Module Moonphases

Posted: Wednesday 13 September 2017 15:01
by htilburgs

Re: Dashticz - Module Moonphases

Posted: Wednesday 13 September 2017 15:05
by htilburgs
As of sometime today (don't know exactly when), I've an error:

Code: Select all

Error: EventSystem: in /home/pi/domoticz/scripts/lua/check_time_moon.lua: /home/pi/domoticz/scripts/lua/check_time_moon.lua:62: attempt to concatenate global 'moonriseMinute' (a nil value)
When I check manualy, then I see that the Moonrise is missing.
Has this something to do with Wunderground not sending the correct information?

"moonrise": {
"hour":"",
"minute":""
}

Code: Select all

{
  "response": {
  "version":"0.1",
  "termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
  "features": {
  "astronomy": 1
  }
	},"moon_phase": {
		"percentIlluminated":"47",
		"ageOfMoon":"22",
		"phaseofMoon":"Waning Gibbous",
		"hemisphere":"North",
		"current_time": {
		"hour":"14",
		"minute":"56"
		},
		"sunrise": {
		"hour":"7",
		"minute":"09"
		},
		"sunset": {
		"hour":"19",
		"minute":"56"
		},
		"moonrise": {
		"hour":"",
		"minute":""
		},
		"moonset": {
		"hour":"15",
		"minute":"24"
		}
	},
	"sun_phase": {
		"sunrise": {
		"hour":"7",
		"minute":"09"
		},
		"sunset": {
		"hour":"19",
		"minute":"56"
		}
	}
}

Re: Dashticz - Module Moonphases - Empty Moonrise

Posted: Wednesday 13 September 2017 15:28
by htilburgs
Just found and article from Wunderground on https://apicommunity.wunderground.com/w ... g-sometime

Code: Select all

moonrise: {
  hour: "",
  minute: ""
},
moonset: {
  hour: "11",
  minute: "46"
}
This happens when a day does not have a moon rise. In this case, the moon rose yesterday.
And now for the million dollar question "how can we solve this in the source, when this happens" ???

Re: Dashticz - Module Moonphases

Posted: Wednesday 13 September 2017 15:50
by EdwinK
So ,that was the problem

Re: Dashticz - Module Moonphases

Posted: Wednesday 13 September 2017 15:52
by htilburgs
Yip, but now the solution....

Haven't found anything yet. I'm looking in the lua script, but nothing works (yet).
Maybe somebody has a great idea??

Re: Dashticz - Module Moonphases

Posted: Wednesday 13 September 2017 20:47
by htilburgs
Ok, with some help I've changed the part of the script. That should avoid giving an error and in your textsensor would get --:--

Code: Select all

        -- moonrise
        moonriseHour, moonriseMinute = string.match(s, [["moonrise": {"hour":"(%d+)","minute":"(%d+)"]])
        if moonriseHour == nil then moonriseHour = '--' end
        if moonriseMinute == nil then moonriseMinute = '--' end
        if debug then print("Moonrise:\t"..moonriseHour..":"..moonriseMinute) end
		
        -- moonset
        moonsetHour, moonsetMinute = string.match(s, [["moonset": {"hour":"(%d+)","minute":"(%d+)"]])
        if moonsetHour == nil then moonsetHour = "--" end
        if moonsetMinute == nil then moonsetMinute = "--" end
        if debug then print("Moonset:\t"..moonsetHour..":"..moonsetMinute) end
 
Updated Wiki also....

Re: Dashticz - Module Moonphases

Posted: Wednesday 20 September 2017 20:42
by Jmerino
Hi all,
I just installed the module and I'm doing something wrong because it doesn't show the picture.
It seems that the sensors and the lua script its working fine because all are filled correctly.
I modified the custom.js to include the module but nothing.

I need some help please

Re: Dashticz - Module Moonphases

Posted: Wednesday 20 September 2017 21:14
by marxkemp
Same here. We must have done something wrong..

Verstuurd vanaf mijn SM-G930F met Tapatalk


Re: Dashticz - Module Moonphases

Posted: Friday 22 September 2017 7:54
by Jmerino
Solved

Re: Dashticz - Module Moonphases

Posted: Friday 22 September 2017 8:12
by marxkemp
What did you do?



Re: Dashticz - Module Moonphases

Posted: Friday 22 September 2017 8:29
by Jmerino
My problem was here:
var _IDXmoonpicture = IDX_Number; //index of the uservariabele MoonPicture

I declared correctly in the code but after a deep revision of the code I detected another declaration in the vars at the beginning of code with 0 value.

Just change this idx with the correct one and delete the new var declared by myself.
Now here is new moon and only show a black circle but it seems will be ok.

Re: Dashticz - Module Moonphases

Posted: Friday 22 September 2017 13:14
by marxkemp
Ah, yes. Found it.
We have a 5% moon today but i think the picture is wrong now (full black moon)..

Re: Dashticz - Module Moonphases

Posted: Monday 09 October 2017 10:10
by jimicek
I think there is an error in the moon script: "waardecheck" should be replaced by "is_waxing" to give the correct moon phase picture

Re: Dashticz - Module Moonphases

Posted: Monday 09 October 2017 23:59
by jvanthof
The Moon Phase module is not showing the images of the moon... I think I have followed all the instructions to the letter. The /var/tmp/phases.tmp file is filled with info. The dummy devices and user variables get filled with information (e.g. the MoonPicture variable contains "moon.89.png") but on the dashticz website: nada...

When I inspect the elements using the developer tools of Safari, it looks like the image is not properly set in the DOM:

Code: Select all

<div class="col-xs-12 transbg imgblock imgblock17610" data-id="buttons.UNKNOWN">
  <div class="col-xs-12">
    <div class="moon"></div>
  </div>
</div>
The "buttons.UNKNOWN" doesn't look right...

My CONFIG.js (I thinks there's a typo on the Wiki btw...) contains these lines:

Code: Select all

buttons.moon = {width:12, isimage:true, refreshimage:60000, image:'moon'}
and

Code: Select all

columns[1] = {}
columns[1]['blocks'] = ['garbage','s1',buttons.moon]
columns[1]['width'] = 5;
Anyone knows what I'm missing?

BTW, infinite credits to all that worked on Domoticz, Dashticz and plugins/addons... I bow to you all!!

Re: Dashticz - Module Moonphases

Posted: Tuesday 10 October 2017 8:46
by CaesarPL
Is

Code: Select all

config['idx_moonpicture'] = 7;
properly set?

Re: Dashticz - Module Moonphases

Posted: Tuesday 10 October 2017 10:20
by EdwinK
CaesarPL wrote: Tuesday 10 October 2017 8:46 Is

Code: Select all

config['idx_moonpicture'] = 7;
properly set?
Looks okay to me.

Re: Dashticz - Module Moonphases

Posted: Wednesday 11 October 2017 14:13
by jvanthof
Found it!!

It seems the Wiki is slightly outdated:

Code: Select all

var _IDXmoonpicture      = IDX_Number; //index of the uservariabele MoonPicture
does not work for me. Replacing it with

Code: Select all

config['idx_moonpicture'] = 1;
did the trick!

PS. I updated the wiki page...

Re: Dashticz - Module Moonphases

Posted: Wednesday 08 November 2017 21:39
by marxkemp
This is bugging me for some time. How do I show the Maanfase and Maanpercentage in the blocks beneath the moon image?
I guess its adding the IDX with a different icon?

Re: Dashticz - Module Moonphases

Posted: Thursday 09 November 2017 0:48
by htilburgs
jvanthof wrote: Wednesday 11 October 2017 14:13 Found it!!

It seems the Wiki is slightly outdated:

Code: Select all

var _IDXmoonpicture      = IDX_Number; //index of the uservariabele MoonPicture
does not work for me. Replacing it with

Code: Select all

config['idx_moonpicture'] = 1;
did the trick!

PS. I updated the wiki page...
Thnx for updating the wiki. Overlooked this one....

Re: Dashticz - Module Moonphases

Posted: Monday 04 December 2017 20:59
by PeJeWe
Dus this module works without a Wunderground API key?