This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Closed

Aeotec Recessed Door Sensor Gen 5 working on 0.9.1

Finding out only an app for Fibaro was available ate the release of 0.9.1 I decided to take a look at the app and see if I could make an Aeotec device working. The Aeotec Recessed Door Sensor (ZW089-C) seemed the easiest to me, so I started of with that and have it working now.


(Don't look at the images, I copied the Fibaro app to start with)

Can't say I really like the workflow needed to get a device working, can't wait for the app-building-app to be release for z-wave.

Never used github before, so have to find out how to post my code, If anybody likes to try it themselves, copy the Fibaro app and use the FGK-101 as the starting point and work some with this code below:

app.json:
    "drivers": [
     {
      "id": "ZW089-C",
      "name": {
       "en": "Aeotec Recessed Door Sensor Gen5"
      },
      "zwave": {
       "manufacturerId": 134,
       "productTypeId": 2,
       "productId": 89,
       "learnmode": {
        "image": "/drivers/ZW089-C/assets/learnmode.svg",
        "instruction": {
         "en": "Press the button on your Aeotec Recessed Door Sensor",
         "nl": "Druk op de knop op de Aeotec Recessed Door Sensor"
        }
    },
       "associationGroups": [ 1 ]
      },
      "class": "sensor",
      "capabilities": [ "alarm_contact", "measure_battery" ],
      "images": {
       "large": "/drivers/ZW089-C/assets/images/large.png",
       "small": "/drivers/ZW089-C/assets/images/small.png"
      },
   "settings": [
    {
     "id": "parameter-1",    
     "type": "dropdown",    
     "value": "0",
     "label": {
      "en": "Sensor Binary Report (1)",
      "nl": "Sensor Binary Report (1)"
     },
     "hint": {
      "en": "Which value of the Sensor Binary Report will be sent when the magnet switches to open/close.",
      "nl": "Welke waarde van de Sensor Binary Report wordt er gestuurd als de magneet schakelaar opent/sluit."
     },     
     "values": [      
      {
       "id": "0",
       "label": {
        "en": "Open=0xFF, Close=0x00",
        "nl": "Open=0xFF, Gesloten=0x00"
       }
      },
      {
       "id": "1",
       "label": {
        "en": "Open=0x00, Close=0xFF",
        "nl": "Open=0x00, Gesloten=0xFF"
       }
      }
     ]
    },
            {
     "id": "parameter-101",
              "type": "checkbox",
              "label": {
      "en": "Low battery warning (101)",
      "nl": "Lege batterij waarschuwing (101)"
              },
              "value": true,
              "hint": {
      "en": "Send Low Battery Report",
      "nl": "Stuur lege batterij waarschuwing"
              }
    },
    {
     "id": "parameter-121",
     "type": "text",
     "label" : {
      "en": "Command to send (121)",
      "nl": "Te sturen commando (121)"
     },
     "value": "8",
     "hint": {
      "en": "To set which command will be sent to the associated nodes when the magnet switch is triggered",
      "nl": "Configureer welk commando er gestuurd wordt naar de geassocieerde nodes als de magneetschakelaar van status wijzigt"
     }
    }
   ]
driver.js:
 settings: {
  "parameter-1": {
   "index": 1,
   "size": 1,
   "parser": function( input ) {
    return new Buffer([ parseInt(input) ]);
   }
  },
  "parameter-101": {
   "index": 101,
   "size": 1,
   "parser": function( input ) {
    return new Buffer([ parseInt(input) ]);
   }
  },
  "parameter-121": {
   "index": 121,
   "size": 4,
   "parser": function( input ) {
    return new Buffer([ parseInt(input) ]);
   }
  }
 }

Comments

  • pocpoc Member
    Thanks ,i will receive my Aeotec door sensor next week , this will come in handy ,if i can implement it all, i am not that good in programming stuff. But he , maybe somebody made an app at that time.
  • @DaneeDeKruyff ;
    Great! I've created a GitHub app with your code:

    https://github.com/ralfvd/nl.bevlogenheid.zw089c

    I understood Athom is working on a generic Aeotec app, so by then we could include your code in that app. But this helps for now.

  • Also with this app (as in previous versions where support was built-in to Homey) , to get the sensor to work, I first needed to set parameter-121 to 0,  wake-up the device, and then set it to 256 and wake-up the device again. Then it correctly sees door open/close.
  • @DaneeDeKruyff ;
    I see Athom is creating the Aeotec application ( https://github.com/athombv/com.aeotec ) , so I have added your code to that repository via a pull request, so @RobinBolscher can integrate the support for ZW089-C  ; Let's hope it gets released soon. 

  • DaneeDeKruyffDaneeDeKruyff Member
    edited August 2016
    @aloft, that's great news, can't wait for getting the app for all my other aeotec devices, thank you for adding the code!
  • Action is to find out if we can force the update of the parameter 121 to the correct working value. There is a 'default configuration' setting available in the app code , but so far, I need two updates, first to 0 and then to 256 .  Would be great that could be done automatically during pairing. That will ease installation for new devices.
  • DaneeDeKruyffDaneeDeKruyff Member
    edited August 2016

    Yes, I was wondering about that too. And the funny thing is, if you read the documentation, parameter 121 should be 8 on order to work. See the last page in the pdf file.

    Btw, I see you've created the svg's in your fork, what did you use to create them?

  • I need to look at the reporting that comes in when you pair it by default. Maybe with some changes in the way it processed the reports, we can make it work without updating the parameters twice.
This discussion has been closed.