Announcement

Collapse
No announcement yet.

Translation of Lua code if possible

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Translation of Lua code if possible

    I'm just upgrading from a veraplus, so bit of a steep learning curve.

    I have a zipato zwave siren, within Vera, the scripting language is LUA and if I wanted to change the siren sounnd (it can make 5 different sounds.

    I have treid in the control panel to send that but nothing happens and I get a syntax error in the log.

    Within Vera, a working line would be;
    luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='13',Data='0x7 1 0x5 0x0 0x0 0x0 0x0 0xA 0x5 0x0 0x0'},1)

    THis would make a door chime sound. To change the sound the 0x5 would be changed for an alternative, for example 0x2 is fire engine and ox1 is alarm siren.

    The code needed to be sent is in the above line and is of types;
    13 = Z-Wave Device ID
    0x71 = Notification Command Class
    0x5 = REPORT
    0x0
    0x0
    0x0
    0x0
    0xA = Type
    0x2 = Event
    0x0
    0x0

    So can anybody help me do this both in the CP instant command, but also how do I send a script as an action based on say, when a motion sensor in my porch senses motion, currently that tells me through the Sonos plugin, turns on lights if it's dark, etc. but I can't work out how to make my zipato siren make a different sound, turning it on and off would be easy but I need to change the tone depending on event with somthing like the line above.

    Thanks.

    #2
    Just create an event that do a "Set Configuration Parameter".

    Comment


      #3
      Originally posted by HaPe View Post
      Just create an event that do a "Set Configuration Parameter".
      Thank you, but I have no idea how to do that?

      Any pointers? and from that code which configuration parameter do I need to set? Presumably a decimal number, starting from 0 or 1?

      Comment


        #4
        I have attached a PDF file that contains the "Configuration Parameters" for the siren. You would need to send Parameter 31 to the device through the event "Set Configuration Parameter,
        Attached Files

        Comment


          #5
          Hmm, a bit different than the Aeotec Siren i have. Parameter 31 just sets the time. To trigger different sounds it looks like you have to treat it like a dimmer device (sort of). Try to use a "Control a device" in the event and set it to the value you want then another "Control a device" that sets it back to zero after the required time.

          Comment


            #6
            Thanks, I'll try both of those

            Comment


              #7
              Did anyone manage to get this working? My siren comes up with a binary switch and not dimmable. Also parameter 31 looks like it is the duration of alarm rather than siren type.

              Comment


                #8
                Originally posted by yuhaohuang View Post
                Did anyone manage to get this working? My siren comes up with a binary switch and not dimmable. Also parameter 31 looks like it is the duration of alarm rather than siren type.
                not a thing of any use sadly.

                Comment


                  #9
                  Originally posted by trevor-austin View Post
                  Thank you, but I have no idea how to do that?

                  Any pointers? and from that code which configuration parameter do I need to set? Presumably a decimal number, starting from 0 or 1?
                  I am also about to migrate from Vera, but am still in eval mode, so I'm just guessing; you should be able to create an event action (next to 'THEN') to do "Z-Wave Actions", and then select "Set a configuration parameter value", which is what @HaPe was suggesting.

                  You might want to search on how to use that particular command, specifically for how the rest of the boxes are filled in.

                  If I was going to guess I'd convert 0x71 (which is hex) into decimal, i.e. 113, and select that in the 'parameter number' drop-down. I'd then put the new value you want into the 'Value' box, again converted to decimal, which in your example of 0x5 is just 5.
                  For the 'Size' dropdown I'd guess at 1 byte.

                  Cheers,
                  Geoff

                  Comment

                  Working...
                  X