• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


[Fully Supported] Kaku Door sensor (AMST-606)
#1
Lightbulb 
I have the KaKu Door sensor (AMST-606). When i use pilight-receive it says:
Code:
{
    "code": {
        "id": 10721910,
        "unit": 9,
        "dimlevel": 13,
        "state": "on"
    },
    "origin": "receiver",
    "protocol": "archtech_dimmers",
    "repeats": 26
}
And:
Code:
{
    "code": {
        "id": 10721910,
        "unit": 9,
        "state": "off"
    },
    "origin": "receiver",
    "protocol": "archtech_switches",
    "repeats": 29
}
{
    "code": {
        "id": 10721910,
        "unit": 9,
        "state": "down"
    },
    "origin": "receiver",
    "protocol": "archtech_screens",
    "repeats": 30
}
So, when disconnecting it just sends ON. When connecting, it sends both DOWN as OFF.
Tested it with these protocols with following settings:
Code:
"DoorSensor": {
            "name": "Deursensor",
            "protocol": [ "kaku_switch" ],
            "id": [{
                "id": 10721910,
                "unit": 9
            }],
            "state": "on"
        },
But, with this setting it only works on the off command. This because the ON command is the only one recognised as a switch.

So, i can post info, whatever you need. Hope you can build a slightly different protocol or something for this contact... Thanks!
 
Reply
#2
Have you've made any progress on the amst-606? Before i'm trying to make a new protocol for it?
 
Reply
#3
No, i'm working on other stuff.
 
Reply
#4
The problem is that the binlen/rawlen is different. Because the ON state has 4 digits more it's picked up as a dimmer.

ON 00101011101100100100010010 0 1 1001 0111
OFF 00101011101100100100010010 0 0 1001

My only question is, can i create or extend a protocol that has 2 different binary lengths

Code:
--[ON]--

hardware: 433gpio
pulse:    4
rawlen:   148
binlen:   37
pulselen: 294

Raw code:
294 2646 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 1176 294 294 294 294 294 1470 294 1176 294 294 294 1176 294 294 294 1176 294 294 294 294 294 1176 294 1176 294 294 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 1176 294 294 294 1176 294 294 294 1176 294 294 294 9996
Binary code:
0010101110110010010001001001100101111

--[OFF]--

hardware: 433gpio
pulse:    4
rawlen:   132
binlen:   33
pulselen: 294

Raw code:
294 2646 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 1176 294 294 294 1176 294 294 294 1176 294 294 294 294 294 1176 294 1176 294 294 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 294 294 1470 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 294 294 1176 294 294 294 1176 294 1176 294 294 294 9996
Binary code:
001010111011001001000100100010011


For now i have i temp solution by adding the pulsen to arctech_screen.c and define it in the config like this.
Downside is that it's seen as u button right now
Code:
"voordeur": {
                        "name": "Voordeur",
                        "protocol": [ "kaku_switch", "kaku_dimmer" ],
                        "id": [{
                                "id": 11454738,
                                "unit": 9
                        }],
                        "state": "off",
                        "dimlevel": 7
                }
 
Reply
#5
Create a new protocol based on the arctech_dimmer called arctech_door. Then let arctech_switch conflict with arctech_door. Then both pulses will be received by arctech_door.
 
Reply
#6
(01-10-2014, 06:18 AM)curlymo Wrote: Create a new protocol based on the arctech_dimmer called arctech_door. Then let arctech_switch conflict with arctech_door. Then both pulses will be received by arctech_door.

Thanks, i will do that this weekend!
 
Reply
#7
Got the protocol working, should i create a pull request or whats the best way to get it in the library.
 
Reply
#8
Preferrably a pull request.
 
Reply
#9
(01-13-2014, 04:24 PM)curlymo Wrote: Preferrably a pull request.

Ok will do that. I try to do it tonight.
 
Reply
#10
After CurlyMo's comments on github. i removed the sending capability. But this result in that the closed(off) state in not triggerd any more. I solved this in the past (and still) by creating a conflict with artech screen because, that protocol is picking of the closed state right now.

Am i missing something?

The protocol now looks like this:

Code:
/*
  Copyright (C) 2014 CurlyMo & lvdp

  This file is part of pilight.

    pilight is free software: you can redistribute it and/or modify it under the
  terms of the GNU General Public License as published by the Free Software
  Foundation, either version 3 of the License, or (at your option) any later
  version.

    pilight is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with pilight. If not, see <http://www.gnu.org/licenses/>
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "../../pilight.h"
#include "common.h"
#include "log.h"
#include "protocol.h"
#include "hardware.h"
#include "binary.h"
#include "gc.h"
#include "arctech_door.h"

void arctechDoorCreateMessage(int id, int unit, int state, int all) {
  arctech_door->message = json_mkobject();
  json_append_member(arctech_door->message, "id", json_mknumber(id));
  if(all == 1) {
          json_append_member(arctech_door->message, "all", json_mknumber(all));
  } else {
          json_append_member(arctech_door->message, "unit", json_mknumber(unit));
  }

  if(state == 1) {
          json_append_member(arctech_door->message, "state", json_mkstring("open"));
  } else {
          json_append_member(arctech_door->message, "state", json_mkstring("closed"));
  }
}

void arctechDoorParseBinary(void) {
  int unit = binToDecRev(arctech_door->binary, 28, 31);
  int state = arctech_door->binary[27];
  int all = arctech_door->binary[26];
  int id = binToDecRev(arctech_door->binary, 0, 25);

  arctechDoorCreateMessage(id, unit, state, all);
}

void arctechDoorInit(void) {

  protocol_register(&arctech_door);
  protocol_set_id(arctech_door, "arctech_doors");
  protocol_device_add(arctech_door, "kaku_door", "KlikAanKlikUit Door Sensor");
  protocol_plslen_add(arctech_door, 294);

  arctech_door->devtype = SWITCH;
  arctech_door->hwtype = RF433;
  arctech_door->pulse = 4;
  arctech_door->rawlen = 148;
  arctech_door->lsb = 3;

  options_add(&arctech_door->options, 'a', "all", no_value, 0, NULL);
  options_add(&arctech_door->options, 'u', "unit", has_value, config_id, "^([0-9]{1}|[1][0-5])$");
  options_add(&arctech_door->options, 'i', "id", has_value, config_id, "^([0-9]{1,7}|[1-5][0-9]{7}|6([0-6][0-9]{6}|7(0[0-9]{5}|10([0-7][0-9]{3}|8([0-7][0-9]{2}|8([0-5][0-9]|6[0-3]))))))$");
  options_add(&arctech_door->options, 't', "open", no_value, config_state, NULL);
  options_add(&arctech_door->options, 'f', "closed", no_value, config_state, NULL);


  protocol_setting_add_string(arctech_door, "states", "open,closed");
  protocol_setting_add_number(arctech_door, "readonly", 1);

  arctech_door->parseBinary=&arctechDoorParseBinary;
}
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Partially Supported] TFA / Conrad Weather Yves 184 9,292 03-31-2019, 05:22 PM
Last Post: curlymo
  gs-iwds07 window sensor Loggisch 46 11,907 01-02-2019, 09:11 PM
Last Post: curlymo
  [Fully Supported] DHT22 IcedEarth 86 30,480 11-18-2018, 09:33 AM
Last Post: curlymo
  Pearl weatherstation sensor for FWS-686 & FWS-665 chklump 13 4,295 08-12-2018, 05:34 PM
Last Post: fourty2
  TFA 30.3160 Pool Sensor wseifert 4 828 05-30-2018, 09:24 AM
Last Post: wseifert
  [Fully Supported] Arctech Old Martin 111 34,171 03-27-2018, 04:43 PM
Last Post: genfersee
  Digoo / Baldr / Nexus / Rubicson temperature/humidity sensor thielj 0 1,134 03-23-2018, 11:29 PM
Last Post: thielj
Lightbulb BH1750 i2c digital illuminance sensor marcm 14 3,261 02-25-2018, 08:40 PM
Last Post: morph027
  [Fully Supported] Clarus Switches Marcin 69 23,463 01-30-2018, 07:10 PM
Last Post: Niek
  [Fully Supported] Remote Control Socket (RC101-U/RC201) Sean 18 10,332 01-04-2018, 06:18 AM
Last Post: ettman8

Forum Jump:


Browsing: 1 Guest(s)