FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: homer am 28 Mai 2013, 10:55:17

Titel: turning a lamp on at a fixed time, turning off with twilight
Beitrag von: homer am 28 Mai 2013, 10:55:17
Hello all,

I'm turning a lamp on at 6am and off using twilight (to take account of seasonal variations). This has been working well but now that Summer is approaching in the UK, the twilight turn off time (05:48) is earlier than my lamp turn on time (06:00). I have the following definitions:

define a12 at *06:00 set LOUNGELIGHT on
define a14 at *{ReadingsVal("myTwilight","sr_indoor","00:00:10")} set LOUNGELIGHT off

Can anyone suggest a way to fix this?

Thanks
Homer
Titel: Aw: turning a lamp on at a fixed time, turning off with twilight
Beitrag von: borsti67 am 28 Mai 2013, 11:29:11
Hello Homer,

may be you could use the "on-till" function of the SET command?

That would be something like

define a12 at *06:00 set LOUNGELIGHT on-till {ReadingsVal("myTwilight","sr_indoor","00:00:10")}

(I'm not familiar with these twilight functions, so eventually this turns on the light until the next morning, but I'm quite sure this can be avoided somehow)
Titel: Aw: turning a lamp on at a fixed time, turning off with twilight
Beitrag von: Zrrronggg! am 28 Mai 2013, 13:50:34
A somewhat crude idea: Check which month it is and turn the lamp not on in all months where you know that sunrise is earlier then 6. Somethinh like:

define a12 at *06:00  { if($month < 4 || $month >= 8) { fhem ("set LOUNGELIGHT on ")}}

(just by heart,not tested)
Titel: Aw: turning a lamp on at a fixed time, turning off with twilight
Beitrag von: herrmannj am 28 Mai 2013, 14:34:43
Hello Homer,

let me suggest to modify your "at" a12 to check if twilight state is less then 5 (indoor sr) or less then 6 (weather sr). only if true switch your lamp on.

define a12 at *06:00 {fhem "set LOUNGELIGHT on" if (Value("myTwilight") < 6)}

So if 6 no light is required it wont be switched on.

joerg