Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Sauna control


krillev

Question

Is someone who can help me solve this.

Something like this, I want it to work.

To turn on the timer Timer On =(Timer pa) and the status of it, set what time you should take a sauna bath = (Badtid) and sauna starts 3 hours before

bath time and a delay time of 1h and when follow-up time has elapsed so goes the timer status to off, and that one can also

turn the timer manually Timer Off =(Timer Av).

That you can set to any temperature (50 - 100C Temp setpoint) you want the sauna to go to and even turn on when the temperature drops 5 ° C below temp setpoint,

That you also see the status of the sauna heater = (Bastuaggregat) and

sauna temp = (Bastu temp).

I have not really get a grips on with lua programming and virtual devices.

Is it possible to solve, thanks for any clue

Please login or register to see this image.

/emoticons/default_icon_rolleyes.gif" alt=":roll:" />

Please login or register to see this attachment.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0
Guest Charly

I have sent you a fully working script by PM

for other users it is attached here

You need in the variables panel the following variables

ScheduleDay

ScheduleHour

ScheduleMinute

ScheduleMonth

ScheduleTemp

ScheduleYear

leave them all 0

Please login or register to see this attachment.

Link to comment
Share on other sites

  • 0

Hey,

Is there anyway I can adapt this to work to control my heating? I would be great if I could get the average temperature from 3 devices and then control my relay on the boiler.

Danke!

tom

Link to comment
Share on other sites

  • 0
Guest Charly

Hello Tvs

This could do some heating controll

I have not tested it

Please login or register to see this code.

Link to comment
Share on other sites

  • 0

Charly, probably a stupid question, but how did you prevent the slider value from being shown? With some math I can now change it into a value that is useful for my purpose, but I can't figure out how to get rid of the 0-100 scale being shown...

Please login or register to see this image.

/emoticons/default_icon_curve.gif" alt=":-/" />

Link to comment
Share on other sites

  • 0
Guest Charly

I did nothing to make it dissapear. Maybe because of my browser Chrome.

Link to comment
Share on other sites

  • 0

Charly...

I am newbie with Fibaro and I would like very much to know how to control Sauna. What do you need to control the Sauna heater? I assume at least FGS211 Switch 3kW? Something else ... what? And how to connect those components?

Can you please give specific instructions for me or all who are interested of controlling Sauna heaters.

Thanks,

- Jan

Link to comment
Share on other sites

  • 0
  • Inquirer
  • This is how I solved the sauna control.

    After a lot of information and help on the forum, I got it to work as I want.

    I created a virtual device and a scene to the sauna control.

    You must have the timer on and set the time you want to take a sauna and what temp you want in the sauna, it regulates the sauna heater for the temperature, it is also a hysteresis of - 5 degrees between on and off at the sauna heater and the timer is running for 3 hours

    then it turns off.

    I am using a fibaro relay 2 * 1.5 kw where I use one output to control a built-in relay in the distribution box to the sauna heater and a universal sensor with temperature sensor to control the temperature in the sauna.

    Virtual device.

    --Timer On

    local virtualDeviceId = 87;

    fibaro:setGlobal("Timer", 1);

    fibaro:sleep(300);

    --Timer Off

    local virtualDeviceId = 87;

    fibaro:setGlobal("Timer", 0);

    fibaro:sleep(300);

    --H+

    local hour=tonumber(fibaro:getGlobalValue("StartHour"))+1;

    local mins=tonumber(fibaro:getGlobalValue("StartMinute"));

    if (hour>23) then hour=0 end

    fibaro:setGlobal("StartHour",hour);

    fibaro:call(87,"setProperty",'ui.Label2.value', string.format('%02d',fibaro:getGlobalValue("StartHour")) .. ':' .. string.format('%02d',fibaro:getGlobalValue("StartMinute")));

    --H-

    local hour=tonumber(fibaro:getGlobalValue("StartHour"))-1;

    local mins=tonumber(fibaro:getGlobalValue("StartMinute"));

    if (hour<0) then hour=23 end

    fibaro:setGlobal("StartHour",hour);

    fibaro:call(87,"setProperty",'ui.Label2.value', string.format('%02d',fibaro:getGlobalValue("StartHour")) .. ':' .. string.format('%02d',fibaro:getGlobalValue("StartMinute")));

    --m+

    local hour=tonumber(fibaro:getGlobalValue("StartHour"));

    local mins=tonumber(fibaro:getGlobalValue("StartMinute"))+1;

    if (mins>59) then mins=0 end

    fibaro:setGlobal("StartMinute",mins);

    fibaro:call(87,"setProperty",'ui.Label2.value', string.format('%02d',fibaro:getGlobalValue("StartHour")) .. ':' .. string.format('%02d',fibaro:getGlobalValue("StartMinute")));

    --m-

    local hour=tonumber(fibaro:getGlobalValue("StartHour"));

    local mins=tonumber(fibaro:getGlobalValue("StartMinute"))-1;

    if (mins<0) then mins=59 end

    fibaro:setGlobal("StartMinute",mins);

    fibaro:call(87,"setProperty",'ui.Label2.value', string.format('%02d',fibaro:getGlobalValue("StartHour")) .. ':' .. string.format('%02d',fibaro:getGlobalValue("StartMinute")));

    --slider

    local SetTemp=fibaro:getValue(87, "ui.Slider1.value");

    fibaro:setGlobal("BathTemp",SetTemp);

    --main loop

    local virtualDeviceId = 87;

    Hour = fibaro:getGlobalValue("StartHour");

    Mins = fibaro:getGlobalValue("StartMinute");

    local state = "On";

    if (tonumber(fibaro:getValue(42 , "value")) == 0) then

    state = "Off"

    end

    local status = fibaro:getGlobal("Timer")

    if

    tonumber(status) == 0

    then

    statuslog = "TimerOff"

    else

    statuslog = "TimerOn"

    end

    fibaro:log("" ..statuslog);

    fibaro:call(87, "setProperty", "ui.Label1.value", ""..statuslog);

    fibaro:call(87 , "setProperty", "ui.Label2.value", string.format("%02d:%02d", Hour, Mins));

    fibaro:call(87 , "setProperty", "ui.Label3.value", fibaro:getValue(16, "value") .. " C");

    fibaro:call(87 , "setProperty", "ui.Label7.value", state);

    fibaro:sleep(60*1000);

    Scene.

    --[[

    %% autostart

    %% properties

    %% globals

    --]]

    if (fibaro:countScenes()>1) then fibaro:abort()end;

    while true do

    local Timer = tonumber(fibaro:getGlobalValue("Timer"));

    local SaunaHeater = tonumber(fibaro:getValue(42, "value"));

    local StartHour = tonumber(fibaro:getGlobalValue("StartHour"));

    local StartMinute = tonumber(fibaro:getGlobalValue("StartMinute"));

    local SaunaTemp = tonumber(fibaro:getValue(16, "value"));

    local BathTemp = tonumber(fibaro:getGlobalValue("BathTemp"));

    local Hysteres = -5;

    local HeatingTime = 180;

    local Date = os.date("*t");

    local NowTime = tonumber(os.time());

    local BathTime = tonumber(os.time({year=Date.year, month=Date.month, day=Date.day, hour=StartHour, min=StartMinute}));

    local StopTime = tonumber(BathTime + HeatingTime*60);

    if(Timer ==1) and (SaunaHeater == 0)then

    if (NowTime >= BathTime)and (NowTime < StoppTid) and (BathTemp >= SaunaTemp - Hysteres ) then fibaro:call(42,"turnOn");

    end

    end

    fibaro:debug("NowTime: " ..NowTime);

    fibaro:debug("Timer: " ..Timer);

    fibaro:debug("SaunaHeater: " .. SaunaHeater);

    fibaro:debug("BathTime: " ..BathTime);

    fibaro:debug("StopTime: " ..StopTime);

    fibaro:debug("Hysteres: " ..Hysteres);

    fibaro:debug("SaunaTemp: " ..SaunaTemp);

    fibaro:debug("BathTemp: " ..BathTemp);

    fibaro:debug("-------------------------------------");

    if (SaunaHeater == 1) and (SaunaTemp >= BathTemp )then fibaro:call(42, "turnOff");

    else if (NowTime >= StopTime) then

    fibaro:setGlobal("Timer", 0);

    fibaro:call(42, "turnOff");

    end

    end

    fibaro:sleep(60*1000);

    end

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
    Guest Charly

    I have made an update on my sauna timer.

    The old one had some date issues. Now use the os.time function

    There is a need of 3 Global Variables.

    SaunaStart (Will be stored as Epoch)

    SaunaDuration (Set in Minutes 120 or 150)

    SaunaTemp

    Just set the date and time and the sauna will run for the set Duration on the Set Temperature.

    To Cancel press the Cancel button.

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...