User Tools

Site Tools


sunriseset

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sunriseset [2014/06/11 10:27]
curlymo
sunriseset [2015/11/27 22:09] (current)
Line 45: Line 45:
   * When the sunrise time has been arrived.   * When the sunrise time has been arrived.
   * After midnight so all values can be updated for a new day.   * After midnight so all values can be updated for a new day.
 +
 +When using sunriseset in eventing, keep in mind of the following;
 +The output of sunriseset.sunset and sunriseset.sunrise is just a number, so the time 17:00 equals 17.00.
 +When using it in eventing make sure you get usable numbers.
 +For example the time for sunriseset.sunset is 16:30
 +
 +<​code>​
 +"IF ((sunriseset.sunset == (datetime.hour + (datetime.minute / 100))) AND datetime.second == 0) THEN .."
 +</​code>​
 +
 +
 +pilight will see this:
 +
 +<​code>​
 +"IF ((16.30 == (16 + (30 / 100))) AND 0 == 0) THEN ..."
 +</​code>​
 +
 +The math pilight will use:
 +16.30 == 16.30
 +
 +When you look at the result you will see that the datetime.minute 30 will give 0.30 in the used rule.
 +(in normal case devide minutes through 100) 
 +
 +Using the sunriseset.
 +
 +Example
 +<​code>​
 +"IF sunriseset.sun IS set THEN ...."
 +</​code>​
 +
 +<​code>​
 +"IF sunriseset.sun IS rise THEN ...."
 +</​code>​
 +
 +The above two rules speak for themselves, but keep in mind if not adding additional AND lines, when using the device.state it will keep overriding your own toggling of the devices.
sunriseset.txt ยท Last modified: 2015/11/27 22:09 (external edit)