[userModule] Daylight (updated 2015-07-05)

Tips, Tricks and Scripts to enhance your home automation and workaround known device bugs, limitations and incompatibilities
mhorst
Posts: 27
Joined: 30 Dec 2014 15:10

Re: [userModule] Daylight (updated 2015-07-05)

Post by mhorst »

Thanks. The first post of this thread has been updated with pz1's changes.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: [userModule] Daylight (updated 2015-03-13)

Post by pz1 »

pz1 wrote:I could not resist adding sunset/rise times to the virtual device
For those unfamiliar with Github here a short instruction on how to get sunrise/set times:

To get all the metrics (in json format) of a Daylight object do the following in a webbrowser

Code: Select all

http://raspberry_IP:8083/JS/Run/controller.devices.get("Daylight_78").get("metrics")
{"level":"on","title":"Daylight 78","sunrise":"5:14","sunset":"22:05"}
To only get the sunrise value with the JS interface:

Code: Select all

http://raspberry_IP:8083/JS/Run/controller.devices.get("Daylight_78").get("metrics:sunrise")
"22:04"
Or if you are using the OpenRemote Interface for sunrise:

Code: Select all

http://raspberry_IP:8083/OpenRemote/metrics/Daylight_78/sunrise
"5:16"
With the ZAutomation API I haven't been able yet to find out how to only get e.g. the sunrise value. I get to:

Code: Select all

http://raspberry:8083/ZAutomation/api/v1/devices/Daylight_78
{"data":{"creatorId":78,"deviceType":"sensorBinary","h":1812719142,"hasHistory":false,"id":"Daylight_78","location":0,"metrics":{"level":"on","title":"Daylight 78","sunrise":"5:16","sunset":"22:04"},"permanently_hidden":false,"tags":[],"visibility":true,"updateTime":1436238960},"code":200,"message":"200 OK","error":null}
Christian12
Posts: 33
Joined: 06 Jan 2016 10:00

Re: [userModule] Daylight (updated 2015-07-05)

Post by Christian12 »

Hi, firstly thanks for that work, really sad that such a module is not in z-way out of the box.

tested with v2.2.0 the sunrise and sunset works fine, but brokes all my instanceswitches from my binärysensors.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: [userModule] Daylight (updated 2015-07-05)

Post by pz1 »

It runs on my 2.2.0 test rig, no problem with the only switch I have. The only strange thing I noticed is that it does no longer show the logo for this device. Same is happening for some, but not all of my userModules
Christian12
Posts: 33
Joined: 06 Jan 2016 10:00

Re: [userModule] Daylight (updated 2015-07-05)

Post by Christian12 »

i ll try to verify my bad english ;)

i have some sensors, Doors per example, and that sensors have build remotes with on off likes switches ( ZWayVDev_zway_Remote_25-0-0-B) that ones i need for my logical rules, in the rules i can choose them as binärysensor, after installing daylight these remoteswitches i can't use in logical rules anymore, because i can't choose them anymore, only choosable binärysensor left is the daylight one.

My workaround was the creation of scenes for my sensors, but it seems to be not the cleanest way, so i m gone back without daylight.

i hope my problem is now even clearer.

Sorry for my english and my clueless.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: [userModule] Daylight (updated 2015-07-05)

Post by pz1 »

Were these "switches" created from a remote control with APP Trap events from Remotes and Sensors?
Christian12
Posts: 33
Joined: 06 Jan 2016 10:00

Re: [userModule] Daylight (updated 2015-07-05)

Post by Christian12 »

yes, exactly, from sensors
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: [userModule] Daylight (updated 2015-07-05)

Post by pz1 »

Thanks, now I understand your problem conditions. I do not have the opportunity to look into it right now, because my only WallController is tied up in an other long term stability test. But I will look into it later. I did have suspicions about the Daylight module, but never could nail it down.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: [userModule] Daylight (updated 2015-07-05)

Post by pz1 »

I still haven't been able to test because my WallController appeared to be broken. I haven't looked into App Daylight either. I stopped using it
reine73
Posts: 1
Joined: 20 Oct 2016 09:52

Re: [userModule] Daylight (updated 2015-07-05)

Post by reine73 »

I really like this module, but I noticed that I only can have one instance of Daylight active, if I have more than one only the last will work as it replaces each others cron records like this:

Code: Select all

[2016-10-22 17:41:10.720] [I] [core] Cron:daylight.newdate;{"minute":[1],"hour":[3],"day"...
[2016-10-22 17:41:10.785] [I] [core] Cron:daylight.sunrise removed
[2016-10-22 17:41:10.786] [I] [core] Cron:daylight.sunset removed
[2016-10-22 17:41:10.796] [I] [core] Cron:daylight.sunrise;{"minute":[3],"hour":[8],"day"...
[2016-10-22 17:41:10.803] [I] [core] Cron:daylight.sunset;{"minute":[51],"hour":[17],"day"...
[2016-10-22 17:41:10.827] [I] [core] Cron:daylight.newdate;{"minute":[1],"hour":[3],"day"...
[2016-10-22 17:41:10.832] [I] [core] Cron:daylight.sunrise removed
[2016-10-22 17:41:10.833] [I] [core] Cron:daylight.sunset removed
[2016-10-22 17:41:10.840] [I] [core] Cron:daylight.sunrise;{"minute":[22],"hour":[7],"day"...
[2016-10-22 17:41:10.846] [I] [core] Cron:daylight.sunset;{"minute":[31],"hour":[18],"day"...
Would it be a possibility to add the type to it as well? Like daylight.official.sunrise, daylight.civil.sunrise?

That would make it possible to have one instance per type for daylight. In my case I would like to turn on/off the light outside according to the civil sunrise/sunset and the lights inside according to the official sunrise/sunset as it is darker inside than outside.

Best regards
Reine
Post Reply