lampki w salonie: zapalanie wczesniej (2h przed zachodem) gdy pochmurno
This commit is contained in:
@@ -4,4 +4,5 @@ DateTime dtSunset_Time "Zachód Słońca [%1$tH:%1$tM]" <sun> {astro="planet=
|
||||
Switch sSunset_Event { astro="planet=sun, type=set, property=end"}
|
||||
Switch sSunset_Event_in_halfhour { astro="planet=sun, type=set, property=end, offset=-30"}
|
||||
Switch sSunset_Event_in_hour { astro="planet=sun, type=set, property=end, offset=-60"}
|
||||
Switch sSunset_Event_in_twohours { astro="planet=sun, type=set, property=end, offset=-120"}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
/* https://github.com/openhab/openhab1-addons/wiki/weather-binding */
|
||||
|
||||
Number wClouds "Clouds [%.0f %%]" {weather="locationId=domek, type=clouds, property=percent"}
|
||||
Number wClouds "Clouds [%.0f %%]" <sun_clouds> {weather="locationId=domek, type=clouds, property=percent"}
|
||||
|
||||
|
||||
@@ -27,7 +27,25 @@ then
|
||||
end
|
||||
|
||||
|
||||
rule "Zapal lampkę i kanapowe przez zmierzchem gdy pochmurno"
|
||||
when
|
||||
Item sSunset_Event_in_twohours received update ON
|
||||
then
|
||||
/* more than 60% cloud cover */
|
||||
if (wClouds.state > 60.0) {
|
||||
logInfo("stollampka", "Powyżej 60% chmur, zapalam")
|
||||
|
||||
sSONOFF02.sendCommand(ON)
|
||||
sSONOFF02_expected.postUpdate(ON)
|
||||
|
||||
sSONOFF01.sendCommand(ON)
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
|
||||
/* TODO: przerobic na espeasy pulse command.
|
||||
pulse 500ms, thread sleep 1s*/
|
||||
rule "Zapal lampkę i kanapowe przed zmierzchem"
|
||||
when
|
||||
Item sSunset_Event_in_halfhour received update ON
|
||||
|
||||
@@ -2,6 +2,7 @@ sitemap pbrk label="Szczegóły techniczne"
|
||||
{
|
||||
Frame {
|
||||
Text item=dtSunset_Time
|
||||
Text item=wClouds
|
||||
}
|
||||
|
||||
Group label="Łączność" {
|
||||
|
||||
Reference in New Issue
Block a user