User Tools

Site Tools


examples

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
examples [2016/12/28 14:26]
creamers
examples [2016/12/29 15:08] (current)
creamers need extra brackets to make it work
Line 23: Line 23:
  "​dst":​ 1  "​dst":​ 1
 }, },
-"sunriseset": {+"sunrisesetdevice": {
  "​protocol":​ [ "​sunriseset"​ ],  "​protocol":​ [ "​sunriseset"​ ],
  "​id":​ [{  "​id":​ [{
Line 46: Line 46:
 <​code>​ <​code>​
 "​sunset":​ { "​sunset":​ {
- "​rule":​ "IF ((sunriseset.sunset == (currentdatetime.hour + (currentdatetime.minute / 100)) AND light.state IS off) AND currentdatetime.second == 0) THEN switch DEVICE light TO on",+ "​rule":​ "IF ((sunrisesetdevice.sunset == (currentdatetime.hour + (currentdatetime.minute / 100)) AND light.state IS off) AND currentdatetime.second == 0) THEN switch DEVICE light TO on",
  "​active":​ 1  "​active":​ 1
 }, },
 "​sunrise":​ { "​sunrise":​ {
- "​rule":​ "IF ((sunriseset.sunrise == (currentdatetime.hour + (currentdatetime.minute / 100)) AND light.state IS off) AND currentdatetime.second == 0) THEN switch DEVICE light TO on",+ "​rule":​ "IF ((sunrisesetdevice.sunrise == (currentdatetime.hour + (currentdatetime.minute / 100)) AND light.state IS off) AND currentdatetime.second == 0) THEN switch DEVICE light TO on",
  "​active":​ 1  "​active":​ 1
 } }
Line 57: Line 57:
 <​code>​ <​code>​
 "​sunset":​ { "​sunset":​ {
- "​rule":​ "​IF ​sunriseset.sunset == DATE_FORMAT(currentdatetime,​ %H.%M) AND light.state IS off AND currentdatetime.second == 0 THEN switch DEVICE light TO on",+ "​rule":​ "​IF ​(sunrisesetdevice.sunset == DATE_FORMAT(currentdatetime,​ %H.%M)) AND light.state IS off AND currentdatetime.second == 0 THEN switch DEVICE light TO on",
  "​active":​ 1  "​active":​ 1
 }, },
 "​sunrise":​ { "​sunrise":​ {
- "​rule":​ "​IF ​sunriseset.sunrise == DATE_FORMAT(currentdatetime,​ %H.%M) AND light.state IS off AND currentdatetime.second == 0 THEN switch DEVICE light TO on",+ "​rule":​ "​IF ​(sunrisesetdevice.sunrise == DATE_FORMAT(currentdatetime,​ %H.%M)) AND light.state IS off AND currentdatetime.second == 0 THEN switch DEVICE light TO on",
  "​active":​ 1  "​active":​ 1
 } }
Line 69: Line 69:
 <​code>​ <​code>​
 "​sunset":​ { "​sunset":​ {
- "​rule":​ "​IF ​sunriseset.sunset == DATE_FORMAT(DATE_ADD(currentdatetime,​ +1 HOUR), \"​%Y-%m-%d %H:​%M:​%S\",​ %H.%M) AND light.state IS off AND currentdatetime.second == 0 THEN switch DEVICE light TO on",+ "​rule":​ "​IF ​(sunrisesetdevice.sunset == DATE_FORMAT(DATE_ADD(currentdatetime,​ +1 HOUR), \"​%Y-%m-%d %H:​%M:​%S\",​ %H.%M)) AND light.state IS off AND currentdatetime.second == 0 THEN switch DEVICE light TO on",
  "​active":​ 1  "​active":​ 1
 } }
examples.txt ยท Last modified: 2016/12/29 15:08 by creamers