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


Generic Fibaro HC3 Alarm system


ChristianSogaard

Recommended Posts

On 11/15/2020 at 4:05 PM, jgab said:

Examples in Lua if you don't want to use ER4 :-)

Please login or register to see this code.

 

If you want to list all devices that can be part of a alarm partition/zone you can do

Please login or register to see this code.

Guess fibaro uses that to populate the pop-up form when adding devices to partitions

 

Hi, This works great.

 

But what i don't understand is why can i arm an entire zone even when there is a single sensor in that zone breached?  I armed a zone with an breached sensor but the zone gets armed, no problem. 

only when i run your code from above it says there is a sensor breached. Appearently if you arm a zone the sensors in that zone are not checked, that is something that you have to do yourself.  Strange!

 

 

Link to comment
Share on other sites

  • 10 months later...
  • Topic Author
  • On 11/15/2020 at 8:02 PM, jgab said:

    Please login or register to see this code.

    There was a semicolon missing after the for-loop. No one seems to have tried it before... Fixed in original post too /thanks

    Hi @jgab

     

    what is bda and alarm.name kind of types?

    I tried to call a Text to speech - my mu rule keeps failing.

     

    rule([[#alarm{id='$id',property='breached',value=true} =>       -- Alarm partition breached
    --    user:msg = log("Alarm partition '%s' breached!",id:alarm.name);
    --    for i=1,5 do log("Tuut!") end
    local alarm = id:alarm;
         local bda = {};
         for _,id in ipairs(alarm.devices) do if id:breached then add(bda,id:name); end end;
         353:msg = log("Alarm partition '%s' has breached devices %s, ",alarm.name,bda);
         fibaro.call(1295, "say","følgende er åbent " .. alarm.name .. bda,"Badeværelse",60)
    ]])

    Link to comment
    Share on other sites

  • Topic Author
  • On 11/24/2021 at 6:10 PM, ChristianSogaard said:

    Hi @jgab

     

    what is bda and alarm.name kind of types?

    I tried to call a Text to speech - my mu rule keeps failing.

     

    rule([[#alarm{id='$id',property='breached',value=true} =>       -- Alarm partition breached
    --    user:msg = log("Alarm partition '%s' breached!",id:alarm.name);
    --    for i=1,5 do log("Tuut!") end
    local alarm = id:alarm;
         local bda = {};
         for _,id in ipairs(alarm.devices) do if id:breached then add(bda,id:name); end end;
         353:msg = log("Alarm partition '%s' has breached devices %s, ",alarm.name,bda);
         fibaro.call(1295, "say","følgende er åbent " .. alarm.name .. bda,"Badeværelse",60)
    ]])

    Hi ?

    I could still need some help why 

    fibaro.call(1295, "say","følgende er åbent " .. alarm.name .. bda,"Badeværelse",60)

    in the above rule wont work?

    it work if its called in a scene

     

     

    Edited by ChristianSogaard
    P
    Link to comment
    Share on other sites

    There is no '..' operator in rules to concatenate strings.

    Use fmt()

    fibaro.call(1295, "say",fmt("følgende er åbent %s %s",alarm.name,bda),"Badeværelse",60)

    Are you sending 4 arguments to 1295:say ?

     

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, jgab said:

    There is no '..' operator in rules to concatenate strings.

    Use fmt()

    fibaro.call(1295, "say",fmt("følgende er åbent %s %s",alarm.name,bda),"Badeværelse",60)

    Are you sending 4 arguments to 1295:say ?

     

     

     

     

    Yes - sending four arguments to 1295:say.

    fibaro.call(1295"say",fmt("HEJ følgende er åbent %s %s",alarm.name,table.unpack(bda)),"Badeværelse",60)
    Edited by ChristianSogaard
    P
    Link to comment
    Share on other sites

  • Topic Author
  • 54 minutes ago, ChristianSogaard said:

    Yes - sending four arguments to 1295:say.

    fibaro.call(1295"say",fmt("HEJ følgende er åbent %s %s",alarm.name,table.unpack(bda)),"Badeværelse",60)

    Hi @jgab

     

    it seems that this rule has stopped working.

    Do i remember correct that Fibaro changed some of the alarm commands recently  - could it be the reason that willArm dont trigger anymore?

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 19 hours ago, ChristianSogaard said:

    Hi @jgab

     

    it seems that this rule has stopped working.

    Do i remember correct that Fibaro changed some of the alarm commands recently  - could it be the reason that willArm dont trigger anymore?

     

    Please login or register to see this code.

     

    Hi @jgab

    Looking in 

    Please login or register to see this link.

     you have a function called activatedPartitions, is this replacing the EV4 "willArm" trigger ? 

    Above rule stopped triggering a little time ago. I could use a fix ?

    Link to comment
    Share on other sites

    I tested it this morning and it still works for me.

    Have you called 'watch' on the alarm? otherwise you will not get events.

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, jgab said:

    I tested it this morning and it still works for me.

    Have you called 'watch' on the alarm? otherwise you will not get events.

    Please login or register to see this code.

     

    Thank you Jan - It works now. I didnt know the Watch 

    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
    Reply to this topic...

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