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

Changing Siren/parameters with Scene


MattyO
 Share

Question

Hi guys I have bought a Dome Siren and it is capable of 10 sirens and 3 volumes. 

I can change these via parameters no problem. But ther is a section in the manual that suggests it can toggle between 2 sirens. This would be great to be able to use it as an alarm and door bell

Can anyone help what is meant by 

07 This Parameter toggles between the Primary and Secondary notification sound to be played when the Siren receives a BINARY_SWITCH_SET(FF) command.
01 Toggle Secondary Chime 01 (Primary Notification Will Play)
02 (Secondary Notification Will Play)

01 
(Primary Notification Will Play)

 

 

 Is this something that can be sent via a scene. I am not sure how I send a binary switch ????

 

Thanks Matt

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I am not sure, what is parameters will settled immediately if your device is battery powered.

You should keeping in mind what parameters always apply _only_ when device is awaken.

but about your question: please search. @petergebruers posts he have a nice trick solution here.

Link to comment
Share on other sites

  • 0

Dome Siren: Changing Parameters with Scene for HC2

All code credits to petergebruers whom helped extensively to resolve this issue.

Explanations for Lua code to help others execute script.

 

Parameters being set are those provided by Dome, and can be found under supplied OEM documentation with the device, or via an article posted in regards to Dome Siren Setup in Vera:  

Please login or register to see this link.

ProductInfo is the Dome Siren device  ProductInfo code found when accessing the Device data. This is explained in Fibaro Forum application notes, and using the Device Query:

http://<YOUR_HC_IP>/docs/#!/devices/getDevice HC2 query: 

·         In sample script below ProductInfo is “2,31,0,3,0,136,2,94

·         In sample script below, DeviceID  is “213”

In this case the parameter table of  (device.properties.parameters,parameter) are:

·         device properties = DeviceID  

·         parameters = Selected parameter number that is be changed

·         parameter = New numerical value to be written to the selected parameter

All the Dome Siren parameter bits are 1 byte dec

 Fibaro:Sleep (5000) between each parameter change is required as IIRC is slow to write.  

The time interval the Chime / Siren sound on period is changeable as per the sleep period  time allocated after the “turn on” command. This is shown as 15 seconds (15000) in script below.

================================================

 

Dome Siren Parameter changes to Secondary Sound Mode with Alarm sound and LED Flashing

 

fibaro:debug('I will modify the parameters on the Dome Siren with deviceID-213 to change from Doorbell Mode to  Alarm Siren Mode')

 

function modifyParameter(id,parameterID,targetValue)

  device=api.get("/devices/" .. id)

  productInfo = "2,31,0,3,0,136,2,94" -- This is a Dome Siren

 

  if device.properties.productInfo ~= productInfo then

    fibaro:debug(

      string.format(

        "Device %d property prodInfo %s differs from %s.\nNothing written to device.",

        id,device.properties.productInfo,productInfo))

    return

  end

 

  local parameter

 

  for _,v in pairs(device.properties.parameters) do

    if v.id==parameterID then

      parameter=v

      break

    end

  end

 

  if not parameter then

    parameter={id=parameterID,size=1}

    table.insert(device.properties.parameters,parameter)

  end

 

  local settings = {

    id=device.id,

    properties={

      parameters=device.properties.parameters

    }

  }

 

  parameter.value=targetValue

  local ok, result=pcall(api.put,"/devices/" .. id,settings)

 

  if not ok then

    fibaro:debug("api call failed: "..result)

    return

  end

end

 

 

-- Parameter 4: The Dome Siren offers three different volumes to use as the Siren (Secondary) notification.

fibaro:debug('This writes Dome Siren to High Volume in Secondary Sound Mode')

 

modifyParameter(213, 4, 3)

 

fibaro:sleep(5000)

 

-- Parameter 6: The Dome Siren offers ten different sounds to use as the Siren (Secondary) notification.

fibaro:debug('This writes Dome Siren to an ALARM sound within Secondary Sound Mode')

 

modifyParameter(213, 6, 7)

 

fibaro:sleep(5000)

 

-- Parameter 7: The Dome Siren offers two different options to use (Primary or Secondary) notification.

fibaro:debug('This writes Dome Siren to Secondary Sound Mode')

 

modifyParameter(213, 7, 2)

 

fibaro:sleep(5000)

 

-- Parameter 9: This Parameter enables or disables the Flashing LED Ring (strobe) accompanying the Secondary Notification.

fibaro:debug('This writes Dome Siren LED to Flash in Secondary Sound Mode')

 

modifyParameter(213, 9, 01)

 

fibaro:sleep(5000)

 

fibaro:debug('I will turn on the Dome Siren  with deviceID-213') -- 213 - deviceID of the Dome Siren

fibaro:call(213, 'turnOn')

 

fibaro:debug('Now I will turn off Dome Siren after 15 seconds')

fibaro:sleep(15000)

fibaro:call(213, 'turnOff')

 

fibaro:sleep(3000)

 

fibaro:debug('Siren Mode Complete')

================================================

 

Once the Dome Siren has been used for ALARM function and accepted or timed out depending on the script use, in my case I have a reset script write the Dome Siren to Doorbell mode for normal use.  I have done this as I don’t want the time delay of parameter writes to be executed during the normal doorbell mode use.

 

 

Dome Siren Parameter changes to Primary  Sound Mode with  Door Chime Alarm  and no LED Flashing

 

fibaro:debug('Now I will write the Dome Siren  parameters back to Doorbell mode')

 

function modifyParameter(id,parameterID,targetValue)

  device=api.get("/devices/" .. id)

  productInfo = "2,31,0,3,0,136,2,94" -- This is a Dome Siren

 

  if device.properties.productInfo ~= productInfo then

    fibaro:debug(

      string.format(

        "Device %d property prodInfo %s differs from %s.\nNothing written to device.",

        id,device.properties.productInfo,productInfo))

    return

  end

 

  local parameter

 

  for _,v in pairs(device.properties.parameters) do

    if v.id==parameterID then

      parameter=v

      break

    end

  end

 

  if not parameter then

    parameter={id=parameterID,size=1}

    table.insert(device.properties.parameters,parameter)

  end

 

  local settings = {

    id=device.id,

    properties={

      parameters=device.properties.parameters

    }

  }

 

  parameter.value=targetValue

  local ok, result=pcall(api.put,"/devices/" .. id,settings)

 

  if not ok then

    fibaro:debug("api call failed: "..result)

    return

  end

end

 

-- Parameter 1: The Dome Siren offers three different volumes to use as the Siren (primary) notification.

fibaro:debug('This writes Dome Siren to High Primary Chime Volume')

 

modifyParameter(213, 1, 3)

 

fibaro:sleep(5000)

 

-- Parameter 5: The Dome Siren offers ten different sounds to use as the Siren (primary) notification.

fibaro:debug('This writes Dome Siren Sound to a Chime Melody for doorbell  within Primary Mode')

 

modifyParameter(213, 5, 3)

 

fibaro:sleep(5000)

 

-- Parameter 7: The Dome Siren offers two different sounds (Primary or Secondary) notification.

fibaro:debug('This writes Dome Siren to Primary Sound Mode')

 

modifyParameter(213, 7, 1)

 

fibaro:sleep(5000)

 

-- Parameter 8: This Parameter enables or disables the Flashing LED Ring (strobe) accompanying the Primary Notification.

fibaro:debug('This writes Dome Siren to no LED flash in Primary Mode')

 

modifyParameter(213, 8, 0)

 

fibaro:sleep(5000)

 

fibaro:debug('Dome Siren is now in Doorbell mode')

 

 

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.

 Share

×
×
  • Create New...