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


  • 1

Limit number umber of messages


Question

Posted

Hi Guys,

I created a scene witch will inform me about the temperature in my sun room. If the temperature is > 23 degrees it will activate my Sonos and tells me the actual temperature and lowers the setting temp of the heater as the door is open. So fa so good.

It will sounds this message several times as long the temperature is > 23.

How I can limit the number of messages by two or three times?

Its possible to narrow the range of temperature but in spring and autumn it will stay a longer time constantly.

Please advice

 

Recommended Posts

  • 0
Posted (edited)

Please login or register to see this code.

 

Edited by 10der
  • 0
  • Inquirer
  • Posted

    Hello 10der@,

    Thanks for this answer!! I need some more time to see if I understand it but working on it. At first I think I need to create a GV for the temperature and to insert that in your example.

    • 0
    Posted
    1 minute ago, Sjakie said:

    I need to create a GV for the temperature and to insert that in your example

    the script will create it if this var is absent.

     

    1) just replace 

     

    Please login or register to see this code.

    with (for example)

     

    Please login or register to see this code.

    2) and make a call this scene when the temperature is changed

     

    • 0
    Posted

    Hi, 

    I want to get only  If the temperature is > 23 degrees it will tells me the actual temperature with the notification mesaj. Can I  get LUA code abauth this. Can I do that ?

     

    thanks a lot

     

     

     

    • 0
    Posted
    Just now, malitan said:

    Hi, 

    I want to get only  If the temperature is > 23 degrees it will tells me the actual temperature with the notification mesaj. Can I  get LUA code abauth this. Can I do that ?

     

    thanks a lot

     

     

     

     

    omg. look like can you write me a full script for thanks :)  ha- ha-ha

    ok

     

     

     

    • 0
    Posted

    Thanks a lot my hero ;)

    • 0
    Posted

    Please login or register to see this code.

     

    1) please change 571 on your temperature sensor ID

    2) please change body of doIt() on your body for calling Sonos

     

    • 0
    Posted

    hi,

    I got this, How Can I fix it ?

    Please login or register to see this attachment.

    • 0
    Posted (edited)

    Fibaro forum added some garbage chars in copy-paste 

     

    @T.Konopka

     

     

     

    Edited by 10der
    • 0
    Posted

    I see. What we should do right now ?

    • 0
  • Inquirer
  • Posted

    Check line1

    should be    --[[

    if you copy you can forget one little tiny    -

     

    • Thanks 1
    • 0
    Posted

    Thanks it works 8-) 

    Now if t > 23 then  is fibaro send notification message to me ?

    • 0
    Posted
    1 minute ago, malitan said:

    Thanks it works 8-) 

    Now if t > 23 then  is fibaro send notification message to me ?

    notice

     

    Please login or register to see this code.

    once an hour

     

    Please login or register to see this code.

    once in half an hour

     

    etc

     

    • 0
  • Inquirer
  • Posted

    Just try!!

    my original scene gives more times the message see below:

    --[[
    %% properties
    348 value
    %% weather
    %% events
    %% globals
    Stookseizoen
    --]]

    --
    local startSource = fibaro:getSourceTrigger();--
    function debug(color, message)
         fibaro:debug(string.format('<%s style="color:%s;">%s</%s>', "span", color, message, "span"));
    end

    function traceFibaro(name)
      local orgFun=fibaro[name]
      fibaro[name]=function(f,...)
        local args={...}
        local res={orgFun(f,table.unpack(args))}
        print(string.format("fibaro:%s(%s)%s",name,json.encode(args):sub(2,-2),#res>0 and "="..json.encode(res):sub(2,-2) or ""))
        return table.unpack(res)
      end
    end

    traceFibaro("getValue")
    traceFibaro("getSourceTrigger")
    traceFibaro("getGlobalValue")

    local TempSensorSunroom = 348
    local DoorSunroom       = 351
    --------------- Use function----------------------------------------------------
    --
    debug("red", "Serre deur open en verwarming lager");
    -- Use colours like "white", "orange", "white, "green", "grey", "red", "blue".
    --
    --------------------------------------------------------------------------------
    debug("orange","scene start")

    local startSource = fibaro:getSourceTrigger();

    if
      ( tonumber(fibaro:getValue(348, "value")) > 22 )
     
     
    --------------------------------

    and ( tonumber(fibaro:getValue(351, "value")) > 0 )


    and

     ( fibaro:getGlobalValue("Stookseizoen") == "Ja" )


    then
        

     

    ------
      -- 279 is the Virtual Device ID
    -- 28 is the Process button ID
    local sid, bid = 249, 28
    -- Create TTS params object
    local params = {
      -- TTS Message
      message = "Hallo, Saartje zegt let op de temperatuur in de serre is boven de 22°C en zet de verwarming naar nachtstand",  
      duration = 'auto',    -- Duration: "auto", xx seconds
      language = "nl-nl",    -- Language: fr-FR
      volume = 50            -- Volume
    }
    local _f = fibaro
    local _x ={root="x_sonos_object",load=function(b)local c=_f:getGlobalValue(b.root)if string.len(c)>0 then local d=json.decode(c)if d and type(d)=="table"then return d else _f:debug("Unable to process data, check variable")end else _f:debug("No data found!")end end,set=function(b,e,d)local f=b:load()if f[e]then for g,h in pairs(d)do f[e][g]=h end else f[e]=d end;_f:setGlobal(b.root,json.encode(f))end,get=function(b,e)local f=b:load()if f and type(f)=="table"then for g,h in pairs(f)do if tostring(g)==tostring(e or"")then return h end end end;return nil end}
    -- Make a request to the remote to process params object instantly
    _x:set(tostring(sid), { tts = params })
    _f:call(sid, "pressButton", bid)
    ----
        --aanroepen http request to set the heater thermostat
    local http = net.HTTPClient()

    function call(url)
      http:request(url, {
          options = { method = 'GET' },
          success =function() fibaro:debug(url.." ,done.") end,
          error = function(errorcode) fibaro:debug("error=" .. errorcode) end
        })
        
        call("http://192.168.1.101/data.json?heater=0&setpoint=115&thermostat=0")
    --


    end
        ---------------------
          -- 249 is the Virtual Device ID
    -- 28 is the Process button ID
    local sid, bid = 249, 28
    -- Create TTS params object
    local params = {
      -- TTS Message
      message = "Hallo, Saartje ziet dat de serre deur open is en de temperatuur boven de 22°C is en zet de verwarmingsthermostaat naar slaapstand  ",  
      duration = 'auto',    -- Duration: "auto", xx seconds
      language = "nl-nl",    -- Language: fr-FR
      volume = 50            -- Volume
    }
    local _f = fibaro
    local _x ={root="x_sonos_object",load=function(b)local c=_f:getGlobalValue(b.root)if string.len(c)>0 then local d=json.decode(c)if d and type(d)=="table"then return d else _f:debug("Unable to process data, check variable")end else _f:debug("No data found!")end end,set=function(b,e,d)local f=b:load()if f[e]then for g,h in pairs(d)do f[e][g]=h end else f[e]=d end;_f:setGlobal(b.root,json.encode(f))end,get=function(b,e)local f=b:load()if f and type(f)=="table"then for g,h in pairs(f)do if tostring(g)==tostring(e or"")then return h end end end;return nil end}
    -- Make a request to the remote to process params object instantly
    _x:set(tostring(sid), { tts = params })
    _f:call(sid, "pressButton", bid)
    --
     
    end
    debug("orange","scene beeindigt")

    • 0
    Posted (edited)
    17 minutes ago, 10der said:

    notice

     

    Please login or register to see this code.

    once an hour

     

    Please login or register to see this code.

    once in half an hour

     

    etc

     

     

    For the notificitions message should I do something in the notifications panel ?

     

     

     

     

    11 minutes ago, Sjakie said:

     

     

     

     

    Edited by malitan
    • 0
    Posted (edited)
    5 minutes ago, malitan said:

    For the notificitions message should I do something in the notifications panel ?

    what?

     

    "notice" - mean - "pay attention here!" 

    Edited by 10der
    • 0
    Posted

    Hi 

    @Sjakie

     

    What is this devices ?

     

      -- 279 is the Virtual Device ID
    -- 28 is the Process button ID

    • 0
  • Inquirer
  • Posted

    Sonos from Kirkrof VD ID=279 28 button to start

    • 0
    Posted
    6 minutes ago, 10der said:

    what?

     

    "notice" - mean - "pay attention here!" 

     

    ok. I got it,

     

    also should I do something  in fibaro  variable panel ?

    • 0
  • Inquirer
  • Posted

    nope

     

    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...