ny_

OpenHab Meteorogramy

ny_
Aug 5th, 2020 (edited)
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rule "Utwórz link meteogramu 00"
  2. when
  3.     Time cron "0 50 6 ? * * *" // codziennie o 0610
  4. then
  5.  
  6.      val String currentDate = String::format( "20%1$ty%1$tm%1$td", new java.util.Date )
  7.  
  8.     val link = "http://new.meteo.pl/um/metco/mgram_pict.php?ntype=0u&fdate=" +  currentDate + "00" + "&row=342&col=208&lang=pl"
  9.  
  10.     postUpdate(MeteogramyLink, link)
  11.  
  12.     logInfo("Meteo", "Uaktualniono link do meteogramu " + currentDate + "00")
  13.    
  14. end
  15.  
  16. rule "Utwórz link meteogramu 06"
  17. when
  18.     Time cron "0 50 12 ? * * *" // codziennie o 1200
  19. then
  20.  
  21.      val String currentDate = String::format( "20%1$ty%1$tm%1$td", new java.util.Date )
  22.  
  23.     val link = "http://new.meteo.pl/um/metco/mgram_pict.php?ntype=0u&fdate=" +  currentDate + "06" + "&row=342&col=208&lang=pl"
  24.  
  25.     postUpdate(MeteogramyLink, link)
  26.  
  27.     logInfo("Meteo", "Uaktualniono link do meteogramu " + currentDate + "06")
  28.    
  29. end
  30.  
  31. rule "Utwórz link meteogramu 12"
  32. when
  33.     Time cron "0 50 19 ? * * *" // codziennie o 1910
  34. then
  35.  
  36.      val String currentDate = String::format( "20%1$ty%1$tm%1$td", new java.util.Date )
  37.  
  38.     val link = "http://new.meteo.pl/um/metco/mgram_pict.php?ntype=0u&fdate=" +  currentDate + "12" + "&row=342&col=208&lang=pl"
  39.  
  40.     postUpdate(MeteogramyLink, link)
  41.  
  42.     logInfo("Meteo", "Uaktualniono link do meteogramu " + currentDate + "12")
  43.    
  44. end
  45.  
  46. rule "Utwórz link meteogramu 18"
  47. when
  48.     Time cron "0 59 23 ? * * *" // codziennie o 2359
  49. then
  50.  
  51.      val String currentDate = String::format( "20%1$ty%1$tm%1$td", new java.util.Date )
  52.  
  53.     val link = "http://new.meteo.pl/um/metco/mgram_pict.php?ntype=0u&fdate=" +  currentDate + "18" + "&row=342&col=208&lang=pl"
  54.  
  55.     postUpdate(MeteogramyLink, link)
  56.  
  57.     logInfo("Meteo", "Uaktualniono link do meteogramu " + currentDate + "18")
  58.    
  59. end
Add Comment
Please, Sign In to add comment