[userModule] SunriseSunset - No Longer Maintained

Tips, Tricks and Scripts to enhance your home automation and workaround known device bugs, limitations and incompatibilities
islipfd19
Posts: 126
Joined: 07 Jul 2014 03:35

Re: New Module SunriseSunset - ***Updated Module***

Post by islipfd19 »

ozgreg wrote:Loving this module..

If I can suggest an Option to disable the turning off the switch on sunrise (maybe have a Disable in the drop down list might be a good way to support this..

Thanks for your hard work.. :)
I updated the module, to disable turning on/off the switches or dimmers you'll have to select '0' in the drop down menu for how long before or after the switches or dimmers are set to be turned on. The updated module has been uploaded on the first post.
ozgreg
Posts: 7
Joined: 13 Apr 2014 03:47

Re: SunriseSunset Module - **20140908 v2.0.5**

Post by ozgreg »

Thankyou very much :-) For me I only turn on the lights in the morning when we are getting up for work.. Thus although you module was perfect for nights it did not quite match our morning routine.. What we would have needed was turn on the lights @ 6:30 if only before sunset and turn off the lights @ 7:30am.. Sadly I not seen this level of automation integration although I am hoping that will eventually be on the roadmap..
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: SunriseSunset Module - **20140908 v2.0.5**

Post by PoltoS »

@islipfd19: I would like to notify you that in v2.0 we have changed api slightly and you will need to adopt your modules. There are only few changes. I'll post a big ChangeLog within a week or two about all changes. You can also have a look on our github for changes in modules/*/* files.

Please stay tunned. Hope these changes will not harm you - them will make the engine better.
SubnetMask
Posts: 20
Joined: 06 Nov 2014 07:07

Re: SunriseSunset Module - **20140908 v2.0.5**

Post by SubnetMask »

I got a Razperry this week and some z-Wave modules. One of the lights I'm controlling are at the end of my driveway, which I want to come on at dusk and shut down at dawn, so your module fit the bill since dusk and dawn tend to move throughout the year... however, it didn't work for me.

I looked through the logs and what I found was:

Code: Select all

[2014-11-07 05:05:01.019] Callback execution error: ReferenceError: riseTime is not defined
    at SunriseSunset.fetchSunriseSunset (automation/modules/SunriseSunset/index.js:122:28)
    at AutomationController.onEpoch (automation/modules/SunriseSunset/index.js:159:14)
    at AutomationController.EventEmitter.emit (automation/lib/eventemitter2.js:310:21)
    at automation/modules/Cron/index.js:132:42
    at Array.forEach (native)
    at automation/modules/Cron/index.js:120:27
    at Array.forEach (native)
    at Function.<anonymous> (automation/modules/Cron/index.js:117:37)

[2014-11-07 16:40:00.905] Callback execution error: ReferenceError: riseTime is not defined
    at SunriseSunset.fetchSunriseSunset (automation/modules/SunriseSunset/index.js:122:28)
    at AutomationController.onEpoch (automation/modules/SunriseSunset/index.js:159:14)
    at AutomationController.EventEmitter.emit (automation/lib/eventemitter2.js:310:21)
    at automation/modules/Cron/index.js:132:42
    at Array.forEach (native)
    at automation/modules/Cron/index.js:120:27
    at Array.forEach (native)
    at Function.<anonymous> (automation/modules/Cron/index.js:117:37)
I tested the URL that gives the sunrise and sunset times - I took 'http://api.openweathermap.org/data/2.5/weather?q=" + this.config.city + "," + this.config.country' and replaced " + this.config.city + " with my city and " + this.config.country" with 'United States', and I got data back that included "sunrise" and "sunset".

Any thoughts on what I may have done wrong?
Vantskruv
Posts: 13
Joined: 06 Nov 2014 18:26

Re: SunriseSunset Module - **20140908 v2.0.5**

Post by Vantskruv »

I've been trying to make a SunriseSunset module also before seeing this thread. Though I've come quite far with the help of mourner:s library:
https://github.com/mourner/suncalc

This library mathematically calculates the sunset/sunrise with todays date and longitude and latitude given (no requirment of internet connection).

I was forced to integrate the code in the module as is have not found a way to import it (I'm a C++ guy and Javascript is new to me). Anyway, I started a test run now to see how it works in a couple of days. I'll add optional time values for user who wants offseto t the time backwards and forwards (i.e. turn on the lights 30 minutes before sunset). Also my module is controlling scenes, not individual switches.

Edit: If anyone are interested I can send to the code to you, but for now I first want to test everything.
ScheduleSun - a sunset/sunrise module
viewtopic.php?f=3424&t=20801
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: SunriseSunset Module - **20140908 v2.0.5**

Post by pz1 »

As a forum moderator I suggest you publish your code in a new topic under this Recipe forum, unless you and the original author can agree on a joint further development.
If you make a new recipe, please follow the instructions of the first post.
Since 29-12-2016 I am no longer a moderator for this forum
islipfd19
Posts: 126
Joined: 07 Jul 2014 03:35

Re: [userMODULE] SunriseSunset - **20140908 v2.0.5**

Post by islipfd19 »

This module may have incompatibility issues with the recent 2.0 version. Still looking into it.
islipfd19
Posts: 126
Joined: 07 Jul 2014 03:35

Re: [userMODULE] SunriseSunset - **20140908 v2.0.5**

Post by islipfd19 »

First test results seem positive. This module will work as is for the 2.0.0 release.
Zjohan
Posts: 9
Joined: 16 Dec 2014 21:29

Re: [userMODULE] SunriseSunset - **20140908 v2.0.5**

Post by Zjohan »

Hi,

Thx for this module it based on the description it does exactly what I need.
But I'm having problems to get it displayed in the gui

From the first Post in this thread

"In the Automation menu, you should now see the new module 'Sunrise / Sunset'. Fill in your City and Country and add the switches you'd like to control during these times of the day. I have two switches and a dimmer that are activated. I also provided two drop down selections that contain 10, 20, 30, 45 and 60 minute intervals. The first drop down will turn off your selected devices X number of minutes past sunrise and the second will turn your devices on X number of minutes prior to sunset."

What GUI is this referring to?
Is it the Z-way Home Automation UI?
If so I can't se the sunrise sunset module in there.
I see from the Z-way server log that it was loaded

"[2014-12-16 17:45:59.496] [core] Loading module SunriseSunset from userModules/SunriseSunset
[2014-12-16 17:45:59.501] [core] Executing script: /*** SunriseSunset Z-Way HA module ******************************************* ..."

I see no errors but still I can't see the module in the GUI
Any ideas on this?

I'm using a brand new Raspberry B+ with new Razberry Gen 5 card & running the v2.0.0 version of Z-way-server
islipfd19
Posts: 126
Joined: 07 Jul 2014 03:35

Re: [userMODULE] SunriseSunset - **20140908 v2.0.5**

Post by islipfd19 »

Though I found the module to work with 2.0.0, there is an update I need to make to the module.json file so that it can be selected in the new 2.0.0 version. I hope to do this some today.
Post Reply