Dashticz - Module Moonphases

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

User avatar
htilburgs
Posts: 464
Joined: Tuesday 03 November 2015 11:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Dashticz - Module Moonphases

Post by htilburgs »

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
htilburgs
Posts: 464
Joined: Tuesday 03 November 2015 11:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Dashticz - Module Moonphases

Post 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"
		}
	}
}
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
htilburgs
Posts: 464
Joined: Tuesday 03 November 2015 11:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Dashticz - Module Moonphases - Empty Moonrise

Post 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" ???
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 - Module Moonphases

Post by EdwinK »

So ,that was the problem
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
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 - Module Moonphases

Post 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??
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
htilburgs
Posts: 464
Joined: Tuesday 03 November 2015 11:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Dashticz - Module Moonphases

Post 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....
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
Jmerino
Posts: 7
Joined: Monday 04 September 2017 0:37
Target OS: -
Domoticz version:
Contact:

Re: Dashticz - Module Moonphases

Post 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
marxkemp
Posts: 10
Joined: Sunday 17 January 2016 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module Moonphases

Post by marxkemp »

Same here. We must have done something wrong..

Verstuurd vanaf mijn SM-G930F met Tapatalk

Jmerino
Posts: 7
Joined: Monday 04 September 2017 0:37
Target OS: -
Domoticz version:
Contact:

Re: Dashticz - Module Moonphases

Post by Jmerino »

Solved
marxkemp
Posts: 10
Joined: Sunday 17 January 2016 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module Moonphases

Post by marxkemp »

What did you do?


Jmerino
Posts: 7
Joined: Monday 04 September 2017 0:37
Target OS: -
Domoticz version:
Contact:

Re: Dashticz - Module Moonphases

Post 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.
marxkemp
Posts: 10
Joined: Sunday 17 January 2016 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module Moonphases

Post by marxkemp »

Ah, yes. Found it.
We have a 5% moon today but i think the picture is wrong now (full black moon)..
jimicek
Posts: 6
Joined: Monday 09 October 2017 9:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dashticz - Module Moonphases

Post 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
jvanthof
Posts: 3
Joined: Monday 08 February 2016 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module Moonphases

Post 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!!
CaesarPL
Posts: 104
Joined: Tuesday 08 November 2016 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: Dashticz - Module Moonphases

Post by CaesarPL »

Is

Code: Select all

config['idx_moonpicture'] = 7;
properly set?
HW:Raspberry PiB+,Pi3,PiB,RFLink,FA20RF,DCS-930L,DCS-935L,Clarus switches,RF Temp sensors,Owl Micro+,Mi Flora,Kerui,Yeelight,Xiaomi,Broadlink RMM3,Alexa
SF:Jessie,Dmtcz 3.8153,Logitech Media srv,PiCorePlayers,Dashticz,Max2Play,InfluxDB,Grafana,HABridge
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 - Module Moonphases

Post by EdwinK »

CaesarPL wrote: Tuesday 10 October 2017 8:46 Is

Code: Select all

config['idx_moonpicture'] = 7;
properly set?
Looks okay to me.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
jvanthof
Posts: 3
Joined: Monday 08 February 2016 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module Moonphases

Post 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...
marxkemp
Posts: 10
Joined: Sunday 17 January 2016 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module Moonphases

Post 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?
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 - Module Moonphases

Post 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....
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
PeJeWe
Posts: 56
Joined: Monday 28 November 2016 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest
Location: Netherlands
Contact:

Re: Dashticz - Module Moonphases

Post by PeJeWe »

Dus this module works without a Wunderground API key?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest