New RFXcom device to Domoticz

Others (MiLight, Hue, Toon etc...)
Post Reply
Sushukka
Posts: 16
Joined: Sunday 11 December 2016 0:21
Target OS: -
Domoticz version:
Contact:

New RFXcom device to Domoticz

Post by Sushukka » Sunday 08 January 2017 1:04

Hello,
Had a discussion with RFXcom about Cotech/Kangtai remote wall plugs sold at least in ClasOhlson:
http://www.clasohlson.com/fi/Kaukokytki ... me/36-6010

They nicely implemented this protocl to the newest 1013 firmware of RFXtrx433E which probably will be available soon. Have tested it with RFXmngr and it works fine. Here is the log of all four on/off channels of one remote:

Code: Select all

================================================
Set Mode
================================================
Reset receiver/transceiver
================================================
Get Status
------------------------------------------------
Packettype        = Interface Message
subtype           = Interface Response
Sequence nbr      = 11
response on cmnd  = Get Status
Transceiver type  = 433.92MHz
Firmware version  = 1013
Firmware Type     = Ext2
Transmit power    = 10dBm
Hardware version  = 1.3
Undec             off
X10               disabled
ARC               disabled
AC                enabled
HomeEasy EU       disabled
Meiantech         disabled
Oregon Scientific disabled
ATI               disabled
Visonic           disabled
Mertik            disabled
AD                disabled
Hideki            disabled
La Crosse         disabled
FS20/Legrand      disabled
ProGuard          disabled
BlindsT0          disabled
BlindsT1          disabled
AE                disabled
Rubicson          disabled
FineOffset        disabled
Lighting4         enabled
RSL               disabled
Byron SX          disabled
Imagintronix      disabled
KeeLoq            disabled
Home Confort      disabled
RFU2              disabled
RFU3              disabled
RFU4              disabled
RFU5              disabled
RFU6              disabled
RFU7              disabled

------------------------------------------------
------------------------------------------------
------------------------------------------------
Packettype    = Lighting5
subtype       = Kangtai, Cotech
Sequence nbr  = 0
ID            = 22F6 decimal:8950
Unit          = 1
Command       = On
Signal level  = 2  -104dBm
------------------------------------------------
------------------------------------------------
Packettype    = Lighting5
subtype       = Kangtai, Cotech
Sequence nbr  = 1
ID            = 22F6 decimal:8950
Unit          = 1
Command       = Off
Signal level  = 3  -96dBm
------------------------------------------------
------------------------------------------------
Packettype    = Lighting5
subtype       = Kangtai, Cotech
Sequence nbr  = 2
ID            = 22F6 decimal:8950
Unit          = 2
Command       = On
Signal level  = 3  -96dBm
------------------------------------------------
------------------------------------------------
Packettype    = Lighting5
subtype       = Kangtai, Cotech
Sequence nbr  = 3
ID            = 22F6 decimal:8950
Unit          = 2
Command       = Off
Signal level  = 3  -96dBm
------------------------------------------------
------------------------------------------------
Packettype    = Lighting5
subtype       = Kangtai, Cotech
Sequence nbr  = 4
ID            = 22F6 decimal:8950
Unit          = 3
Command       = On
Signal level  = 3  -96dBm
------------------------------------------------
------------------------------------------------
Packettype    = Lighting5
subtype       = Kangtai, Cotech
Sequence nbr  = 5
ID            = 22F6 decimal:8950
Unit          = 3
Command       = Off
Signal level  = 3  -96dBm
------------------------------------------------
------------------------------------------------
Packettype    = Lighting5
subtype       = Kangtai, Cotech
Sequence nbr  = 6
ID            = 22F6 decimal:8950
Unit          = 4
Command       = On
Signal level  = 3  -96dBm
------------------------------------------------
------------------------------------------------
Packettype    = Lighting5
subtype       = Kangtai, Cotech
Sequence nbr  = 7
ID            = 22F6 decimal:8950
Unit          = 4
Command       = Off
Signal level  = 3  -96dBm
Transmission works with the newest RFXmngr version 18.0.0.17 by choosing Lightning5 and Type: Kangtai/Cotech. First level of ID field is grey so I need to only put my 22 and F6 to ID field and unit code + on/off --> transmit and it works like a charm.

However, I'm not sure if I'm a total noob with RFX or doesn't Domoticz fully support this new device addition because I can just register one button per channel. Here is one registration:
RFXCOM 433,92Mhz Transceiver 0022F6 2 Garden Light Lighting 5 Unknown
.
It shows like my other lightning switches, but when clicking it, it seems to send only the "on" command and doesn't update the lamp/switch icon to "on". It never sends the "off" command. When trying to register the off button of the same channel it says that this code is already registered to "Garden Light". The actual on command is sent correctly as the garden lights turn on. Seems that there are some very tiny problem somewhere but cannot find where.

Here is log from Domoticz:

Code: Select all

2017-01-08 00:39:40.745 RFXCOM: Using serial port: /dev/ttyUSB0
subtype = Interface Response
Sequence nbr = 45
response on cmnd = Get Status
Transceiver type = 433.92MHz
Firmware version = 1013
Firmware type = Ext2
Hardware version = 1.3
Undec off
X10 disabled
ARC disabled
AC enabled
HomeEasy EU disabled
Meiantech/Atlantic disabled
Oregon Scientific disabled
ATI disabled
Visonic disabled
Mertik disabled
AD disabled
Hideki disabled
La Crosse disabled
FS20/Legrand disabled
ProGuard disabled
BlindsT0 disabled
BlindsT1 disabled
AE disabled
RUBiCSON disabled
FineOffset disabled
Lighting4 enabled
Conrad RSL disabled
ByronSX disabled
IMAGINTRONIX disabled
KEELOQ disabled
2017-01-08 00:46:39.026 User: Admin initiated a switch command (79/Garden Light/On)
2017-01-08 00:46:39.027 (RFXCOM 433,92Mhz Transceiver) Lighting 5 (Garden Light)
2017-01-08 00:46:55.513 User: Admin initiated a switch command (79/Garden Light/On)
2017-01-08 00:46:55.513 (RFXCOM 433,92Mhz Transceiver) Lighting 5 (Garden Light)

Sushukka
Posts: 16
Joined: Sunday 11 December 2016 0:21
Target OS: -
Domoticz version:
Contact:

Re: New RFXcom device to Domoticz

Post by Sushukka » Monday 16 January 2017 12:09

Hmm, is this the right place to put this kind of requests? According to Domoticz wiki this should be one place to do that.

b_weijenberg
Posts: 687
Joined: Friday 12 July 2013 18:13
Target OS: -
Domoticz version:
Location: Netherlands
Contact:

Re: New RFXcom device to Domoticz

Post by b_weijenberg » Monday 16 January 2017 18:03

Use the latest Domoticz beta version.
For the RFXtrx433E use Ext2 firmware and enable the Lighting4 and AC protocols.
When you push a button on the Cotech remote it will be received as Kangtai in Domoticz.
RFXtrx433, RFXtrx433E

Sushukka
Posts: 16
Joined: Sunday 11 December 2016 0:21
Target OS: -
Domoticz version:
Contact:

Re: New RFXcom device to Domoticz

Post by Sushukka » Friday 27 January 2017 14:41

Thanks. :) I'll try this as soon as I get my current sensor project implemented to Domoticz.

User avatar
EdwinK
Posts: 1319
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Rhoon
Contact:

Re: New RFXcom device to Domoticz

Post by EdwinK » Saturday 21 October 2017 16:16

All of a sudden I notice this device in domoticz. As far as I know I don't have anything with Kangtai / Cotech subtype.
Running latest BETA on a Pi-3 | Toon Thermostat (rooted) | RFxcom | Dashticz V2 |

joostvanderlinde
Posts: 23
Joined: Tuesday 23 June 2015 23:06
Target OS: Raspberry Pi
Domoticz version: 3.5877
Contact:

Re: New RFXcom device to Domoticz

Post by joostvanderlinde » Monday 08 January 2018 22:49

In my quest for cheap but reliable KaKu clone switches (and because they are ofter sold out at the NL Action store), I recently bought a set of
"uniTEC 48110 Funkfernschalterset 3+1" from Amazon

For some reason I cannot get them to work with Domoticz V3.8153 (tried with latest beta as well, same result).
I upgraded my RFXtrxe to the latest (1022) Ext2 Firmware.
In RFXManager I can catch commands from the remote and the plugs react to a command.

Code: Select all

Lighting5 command
================================================
Packettype    = Lighting5
subtype       = Kangtai, Cotech
Sequence nbr  = 10
ID            = 0102 decimal:258
Unit          = 1
Command       = On
Signal level  = 0  -120dBm

Remote:
------------------------------------------------
Packettype    = Lighting5
subtype       = Kangtai, Cotech
Sequence nbr  = 32
ID            = 830B decimal:33547
Unit          = 1
Command       = On
Signal level  = 7  -64dBm
In Domoticz I activated both AC and Lighting4
Capture.PNG
Capture.PNG (19.69 KiB) Viewed 1985 times
For some reason, any command from the remote is not picked up by Domoticz
Also, sending a command from Domoticz (AC protocol, what else to choose as I do not see anything that resembles Kangtai or Cotech ) is not picked up by the plug (in learning mode).

I have the feeling I am missing something here.....

Note: I use two other types of plugs:
Promax from Action using IT protocol, working ok
Flamingo from Action using AC protocol, working ok

b_weijenberg
Posts: 687
Joined: Friday 12 July 2013 18:13
Target OS: -
Domoticz version:
Location: Netherlands
Contact:

Re: New RFXcom device to Domoticz

Post by b_weijenberg » Tuesday 09 January 2018 10:09

Kangtai is controlled by Lighting5 - Kangtai, Cotech in RFXmngr.
I guess you need to receive the remote to create the Kangtai device in Domoticz. Enable receive of new devices in Domoticz and try with only Lighting4 + AC enabled.
RFXtrx433, RFXtrx433E

joostvanderlinde
Posts: 23
Joined: Tuesday 23 June 2015 23:06
Target OS: Raspberry Pi
Domoticz version: 3.5877
Contact:

Re: New RFXcom device to Domoticz

Post by joostvanderlinde » Sunday 14 January 2018 23:08

OK, tried it with just a few protocols enabled, but on my NL Domoticz system and with another remote of the same kind.
This one is now recognized as PT2262 instead of Kangtai/Cotech.....
Difference between the two RFXtrx is the firmware: Not picking up the Unitec remote in Domoticz (but it does in RFXMgr as Kangtai/Cotech ): 1022
Picking up the Unitec remote in Domoticz (as PT2262): 1012

There is no way to manually add Kangtai/Cotech or PT2262 devices in Domoticz?
As I can now only remotely access my other Domoticz system (in our holiday home abroad), I would like to setup the device based on the codes I was able to learn the switch with RFXmngr...... Any tips on that?

joostvanderlinde
Posts: 23
Joined: Tuesday 23 June 2015 23:06
Target OS: Raspberry Pi
Domoticz version: 3.5877
Contact:

Re: New RFXcom device to Domoticz

Post by joostvanderlinde » Monday 15 January 2018 10:55

In my quest to be able to manually define addresses for receivers tried to open a backup of the Domoticz database.

The only table that seems to record the actual address and type of a device is "Devicestatus".
So my guess to solve my issue is to:
1. Catch a code in Domoticz from a remote that is compatible with my receiver
2. Change the address of the caught device in the Domoticz DB to my liking
3. Learn the new address of the device in Domoticz to the receiver

Any experience with this?

joostvanderlinde
Posts: 23
Joined: Tuesday 23 June 2015 23:06
Target OS: Raspberry Pi
Domoticz version: 3.5877
Contact:

Re: New RFXcom device to Domoticz

Post by joostvanderlinde » Saturday 27 January 2018 14:44

I think I succeeded in changing the Domoticz DeviceID/Type/Subtype of a switch.
To avoid any risk with using eg. SQLite3 browsers, I created a small Python3 script to accomplish this. The script also runs on Python 2.7!
Note:
1. You can only trigger switches that are supported by your hardware. I use RFXCom, to the below is based on an up-to-date RFXCom.
2. If you use this, you still might end up wrecking you Domoticz db, so please be advised to make a good backup beforehand!!

Note: You need to have a switch defined in Domoticz beforehand, ie. you need to know the ' index' by which you can identify the switch. You can create a switch manually in Domoticz (Switches screen), make sure you link it to the correct hardware (e.g. RFXCom). The other parameters (Switch Type, Type, ID and Unit code) can be set now to "anything you like" as they will be set with the script provided in this post.

The script takes a number of parameters:
  • index: The IDX from the Devices screen, this is he key used identify the switch for which you want to set the new values. Mandatory
  • id: The device id that is (to be) recognized by your switch. Optional
  • unit: The unit that is (to be) recognized by your switch. Optional
  • type: The protocol type your switch responds to. Optional.
  • subtype: The protocol subtype your switch responds to. Optional
The script will (based on parameters provided) just retrieve values, or update any combination of device id, unit, type, subtype.

The exact formats of the id / unit are not known to me, but you can figure those out using RFXMgr.
From the Domoticz source I noted a few values for type/subtype (have to be provided as decimal (not in hex!)
As my issue focussed on Lighting 4/5 and PT2262/Kangtai, I only provide these values here, please check the domoticz source (RFXtrx.h) for other valid values:
  • Lighting5 = 0x14 (decimal 20) => Type
  • Lighting 4 = 0x13 (decimal 19) => Type
  • Kangtai = 0x11 (decimal 17) => sType
  • PT2262 = 0x0 (decimal 0) => sType
The script accepts all values as long as they comply to the datatype

Script attached in a rar archive.

Output example:

Code: Select all

pi@domoticz:~/domoticz$ python UpdateDevice.py -i 210 -t 20 -s 17 -d 0102
UpDateDevice.py v0.1
Non-Windows Mode
Python version 2.7.9
SQLite3 version 2.6.0
Control-C to abort

Startup parameters:
Device index to update : 210
Device ID to set       : 0102
Device Type to set     : 20
Device SubType to set  : 17

Database values at program start
Domoticz ID          : 210
Domoticz Hardware ID : 3
Domoticz Device ID   : 0000102
Domoticz Unit        : 1
Domoticz Name        : Bureau lampen achter (test)
Domoticz Type        : 17
Domoticz SubType     : 0

Type/SubType updated
DeviceID updated

Database values after update
Domoticz ID          : 210
Domoticz Hardware ID : 3
Domoticz Device ID   : 0102
Domoticz Unit        : 1
Domoticz Name        : Bureau lampen achter (test)
Domoticz Type        : 20
Domoticz SubType     : 17


Program succesfully completed
Attachments
UpdateDevice.rar
(1.94 KiB) Downloaded 37 times
Last edited by joostvanderlinde on Wednesday 14 February 2018 13:51, edited 6 times in total.

joostvanderlinde
Posts: 23
Joined: Tuesday 23 June 2015 23:06
Target OS: Raspberry Pi
Domoticz version: 3.5877
Contact:

Re: New RFXcom device to Domoticz

Post by joostvanderlinde » Wednesday 14 February 2018 13:40

Updated script, now also capable of updating the Unit.
Updated attachment in previous post

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests