Moon phase
Moderators: leecollings, remb0
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
@ wizjos,
Thanks for the support
I do not understand the uservariable..
Is this correct? Or what type do i need?
And this is ok?
Thanks for the support
I do not understand the uservariable..
Is this correct? Or what type do i need?
And this is ok?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
- wizjos
- Posts: 78
- Joined: Monday 07 March 2016 19:35
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Moon phase
It looks OK to me (except that my uservar is of type Time).Derik wrote:@ wizjos,
Thanks for the support
I do not understand the uservariable..
Is this correct?
Or what type do i need?
The uservar is a helper in determining if an update from WU is allowed. WU only lets you poll 10 times in an hour. I found that the script was running too many times in an hour. So with some help from the wiki (http://www.domoticz.com/wiki/Smart_Lua_ ... _Light_Off) I made a check that, when WU has been polled, updates the uservar with the current time (again, this is purely cosmetic).
By updating the uservar the 'lastupdated' property of this uservar is set. This is a Domoticz internal property. (see line 74: commandArray['Variable:'..checkvar]=time.hour..":"..time.min). Each time the value of the uservar changes this property is set by Domoticz to the current date and time (See the column 'Laatste aanpassing' in your picture).
When the script runs again this 'lastupdated' property is checked (line 60: if (may_update(checkvar,checktime)==true) ).
The function may_update checks the difference between the current time and the time the uservar was last updated. If this difference is 3600 seconds the script allows an other update.
I see you've created a uservar of type Text and set the value to 3600. That's OK, but the value 3600 is not important...
As far as I can see it is. Be a bit more carefull with displaying your API key by the way!Derik wrote:And this is ok?
I hope this helps!
-
- Posts: 169
- Joined: Wednesday 30 September 2015 11:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: v3.8975
- Location: United Kingdom
- Contact:
Re: Moon phase
Can you enlighten me please? How did you do that? I must admit I am a complete noob when it comes to interface and icons in Domoticz.wizjos wrote:I can confirm it isalexsh1 wrote:Good work @ wizjos!
Is your moon icon changing according to the moon phase? Very nice - now I'd like to implement it too
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
mmm Not working...
What can be the dombo error /mistake that i make?Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
got him:
shame... did not not have activated the srcipt funtion:
Only i think i changed the rise and set, is that correct??
And will you please tell me how you make the changing button with a moon icon...Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
- LouiS22
- Posts: 433
- Joined: Friday 27 February 2015 13:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Budapest, Hungary
- Contact:
Re: Moon phase
Brillinat, just two questions:
1. does anyone have the neat moon icon package?
2. according to the log the scripts runs in every minute. Is that normal? (I've not changed the 3600 value, so it's a bit odd for me).
1. does anyone have the neat moon icon package?
2. according to the log the scripts runs in every minute. Is that normal? (I've not changed the 3600 value, so it's a bit odd for me).
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
runs every minute ..
Because it is a lua time script...
should be great when this can be adjustable
Because it is a lua time script...
should be great when this can be adjustable
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
Should it not be better/nicer to us for rise and set custom sensors, with icons?
Rise:
https://www.google.nl/search?q=moonrise ... 0Q_AUIBigB
Set:
https://www.google.nl/search?q=moonrise ... &q=moonset
I cannot make this, it is just a idea
Rise:
https://www.google.nl/search?q=moonrise ... 0Q_AUIBigB
Set:
https://www.google.nl/search?q=moonrise ... &q=moonset
I cannot make this, it is just a idea
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
get a warning from wu..
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
other error:
Code: Select all
2016-10-29 22:00:00.906 LUA: Moonrise: 6:46
2016-10-29 22:00:00.906 LUA: Moonset: 18:08
2016-10-29 22:00:00.906 LUA: Percent: 1%
2016-10-29 22:00:00.906 LUA: Age: 29
2016-10-29 22:00:10.311 Error: EventSystem: Warning!, lua script /home/pi/domoticz/scripts/lua/script_time_maan.lua has been running for more than 10 seconds
2016-10-29 22:00:02.892 (D.M.: RFLink) Temp (OregonV1)
2016-10-29 22:00:15.721 Hardware Monitor: Fetching data (System sensors)
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
- LouiS22
- Posts: 433
- Joined: Friday 27 February 2015 13:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Budapest, Hungary
- Contact:
Re: Moon phase
That's why I tried to refer with my post above. IMHO the script is buggy in a way as it shouldn't run in every minute - that's 60 request from WU in an hour.Derik wrote:get a warning from wu..
ScreenShot086.jpg
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
Perhaps someonebcab make this script working as a lua with a crontab.... In steat op lua time
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 169
- Joined: Wednesday 30 September 2015 11:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: v3.8975
- Location: United Kingdom
- Contact:
Re: Moon phase
You have to set it up according to your needs. Just think - why would need to know a moon phase every minute? I have my script (above) running every 10 minutes or so. It generates only 6 requests per hour or 144 per day. I think running it one an hour would not hurt either.LouiS22 wrote:Brillinat, just two questions:
2. according to the log the scripts runs in every minute. Is that normal? (I've not changed the 3600 value, so it's a bit odd for me).
-
- Posts: 169
- Joined: Wednesday 30 September 2015 11:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: v3.8975
- Location: United Kingdom
- Contact:
Re: Moon phase
This is not a bug, but happens occasionally due to internet connection issue or a delayed reply from the weather server.Derik wrote:other error:Code: Select all
2016-10-29 22:00:00.906 LUA: Moonrise: 6:46 2016-10-29 22:00:00.906 LUA: Moonset: 18:08 2016-10-29 22:00:00.906 LUA: Percent: 1% 2016-10-29 22:00:00.906 LUA: Age: 29 2016-10-29 22:00:10.311 Error: EventSystem: Warning!, lua script /home/pi/domoticz/scripts/lua/script_time_maan.lua has been running for more than 10 seconds 2016-10-29 22:00:02.892 (D.M.: RFLink) Temp (OregonV1) 2016-10-29 22:00:15.721 Hardware Monitor: Fetching data (System sensors)
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
dear i did set time to 4800 only i still get a warning..:
Or can i set the time of the lua script set to a other time to?Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
Strange thing happend
I did not make a change..: Only the script is not working after a update from yesterday...
edit:
My error:
I did not make a change..: Only the script is not working after a update from yesterday...
edit:
My error:
Code: Select all
2016-10-31 19:03:00.797 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_maan.lua: /home/pi/domoticz/scripts/lua/script_time_maan.lua:148: attempt to concatenate global 'moonPhaseIcon' (a nil value)
2016-10-31 19:04:00.519 Error: Webserver: File '/images/test.png': No such file or directory (2)
2016-10-31 19:04:00.980 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_maan.lua: /home/pi/domoticz/scripts/lua/script_time_maan.lua:148: attempt to concatenate global 'moonPhaseIcon' (a nil value)
2016-10-31 19:05:00.545 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_maan.lua: /home/pi/domoticz/scripts/lua/script_time_maan.lua:148: attempt to concatenate global 'moonPhaseIcon' (a nil value)
2016-10-31 19:06:00.916 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_maan.lua: /home/pi/domoticz/scripts/lua/script_time_maan.lua:148: attempt to concatenate global 'moonPhaseIcon' (a nil value)
2016-10-31 19:07:01.019 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_maan.lua: /home/pi/domoticz/scripts/lua/script_time_maan.lua:148: attempt to concatenate global 'moonPhaseIcon' (a nil value)
2016-10-31 19:08:00.677 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_maan.lua: /home/pi/domoticz/scripts/lua/script_time_maan.lua:148: attempt to concatenate global 'moonPhaseIcon' (a nil value)
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
did make no change to anything
Only a update.. working again...
Only in the log errors.. ...
Only a update.. working again...
Only in the log errors.. ...
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 169
- Joined: Wednesday 30 September 2015 11:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: v3.8975
- Location: United Kingdom
- Contact:
Re: Moon phase
Version 3.5837 (October 30th 2016)Derik wrote: Only the script is not working after a update from yesterday...
- Fixed: Blockly/Lua, FOR and RANDOM are now again in minutes
Additionally, please see this http://domoticz.com/forum/viewtopic.php?f=3&t=13942
Some people experience issues with the latest beta
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Moon phase
mmm'
The link to the other forum is not working..
Still my calls from wu are not enough...
Round 16.00 are my calls gone...
Is there a solution to make the calls not every minute, but 2 or 3 minutes?
Love this option
and the Moon picto's??
The link to the other forum is not working..
Still my calls from wu are not enough...
Round 16.00 are my calls gone...
Is there a solution to make the calls not every minute, but 2 or 3 minutes?
Love this option
and the Moon picto's??
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
- cyberclwn
- Posts: 103
- Joined: Thursday 20 August 2015 22:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Moon phase
I just tried use this script, and i almost got it working but i also got the error:Derik wrote:
Only in the log errors..
ScreenShot101.jpg
Code: Select all
EventSystem: in /home/pi/domoticz/scripts/lua/script_time_moon.lua: /home/pi/domoticz/scripts/lua/script_time_moon.lua:82: attempt to concatenate global 'moonriseMinute' (a nil value).
Code: Select all
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"astronomy": 1
}
}
, "moon_phase": {
"percentIlluminated":"52",
"ageOfMoon":"22",
"phaseofMoon":"Waning Gibbous",
"hemisphere":"North",
"current_time": {
"hour":"21",
"minute":"24"
},
"sunrise": {
"hour":"8",
"minute":"42"
},
"sunset": {
"hour":"16",
"minute":"27"
},
"moonrise": {
"hour":"",
"minute":""
},
"moonset": {
"hour":"12",
"minute":"34"
}
},
"sun_phase": {
"sunrise": {
"hour":"8",
"minute":"42"
},
"sunset": {
"hour":"16",
"minute":"27"
}
}
}
On the website of WU it says:
Code: Select all
Dec. 20, 2016 Opkomst Ondergang
Maan Geen maanopkomst 12:34 PM CET
3xPi 2B (Domoticz "live", Domoticz "sandbox", PhotoFrame)
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
Who is online
Users browsing this forum: No registered users and 1 guest