RFXcom

General questions and comments.
cyberde
3 stars
3 stars
Posts: 61
Joined: Thu 11 Apr 2013, 08:00
Location: The Netherlands
Contact:

RFXcom

Post by cyberde » Mon 30 Mar 2015, 07:05

Now that the development of V4 has been frozen, is there any chance that the RFXcom becomes supported by SK by a plugin or by an update?
The reason that I'm asking is that the RFXcom has collision detection whereas the telldus doesn't, which theoretically should really improve reception/transmission of commands.

tomas
Administrator
Administrator
Posts: 419
Joined: Tue 09 Nov 2010, 20:41

Re: RFXcom

Post by tomas » Tue 31 Mar 2015, 20:26

Unfortunately we do not have plans to add support for RFXcom in Switch King.

In Switch King there are some settings under Tools > Options > Advanced that can be used to minimize collision impact.
Tomas | Switch King

krambriw
4 stars
4 stars
Posts: 336
Joined: Thu 19 Jul 2012, 19:41

Re: RFXcom

Post by krambriw » Wed 01 Apr 2015, 06:46

Another workaround is to use SwitchKing as base and integrate with Eventghost. EventGhost has full support for RFXtrx 433 devices and in this way you can leverage the best of both SwitchKing and EventGhost. To integrate SwitchKing with EventGhost there is a plugin available. In this way you can work with data sources in SwitchKing that are being updated on events originating from the RFXtrx device.

RFXtrx support in EventGhost:
http://eventghost.net/forum/viewtopic.php?f=9&t=3801

Integration of SwitchKing with EventGhost:
http://eventghost.net/forum/viewtopic.p ... switchking

cyberde
3 stars
3 stars
Posts: 61
Joined: Thu 11 Apr 2013, 08:00
Location: The Netherlands
Contact:

Re: RFXcom

Post by cyberde » Sun 05 Apr 2015, 19:58

Thanks!
I've just received my RFXcom and I'm currently working on a Plugin to bring support to SwitchKing :)

cyberde
3 stars
3 stars
Posts: 61
Joined: Thu 11 Apr 2013, 08:00
Location: The Netherlands
Contact:

Re: RFXcom

Post by cyberde » Mon 06 Apr 2015, 08:28

So far so good, I am able to send commands out from SK to the RFXcom device, I'm also able to update my datasources from RFXcom received commands.

Now the interesting part, and I think I need help from the developers of SK here. How do I get a event in the "TellStick Duo Event Log" to create new data sources from it? I'd rather do it like this than having the plugin create datasources.

tomas
Administrator
Administrator
Posts: 419
Joined: Tue 09 Nov 2010, 20:41

Re: RFXcom

Post by tomas » Sun 12 Apr 2015, 16:26

Hi cyberde,

There is support in Switch King for receiving events from RFXcom which is described in this thread:
http://www.switchking.se/forum/viewtopi ... 822&p=6115

(Let me know if you want it translated to English)

Are you utilizing that functionality? You may want to take a look at that and then use your own plugin to send commands using the RFXcom device.
Tomas | Switch King

cyberde
3 stars
3 stars
Posts: 61
Joined: Thu 11 Apr 2013, 08:00
Location: The Netherlands
Contact:

Re: RFXcom

Post by cyberde » Sun 12 Apr 2015, 18:16

Hi Thomas,

I was not using that functionality, I have extended my existing plugin to communicate with the RFXcom in order to receive (to a datasource) and send signals and use that plugin to create the datasources outside of SwitchKing.

This does look like a better way to implement the reception of the signals from the RFXcom, I'm gonna have a look at this :)
How would I access the RFXcom from my plugin when SwitchKing is already using the COM-port? Is there an instance of a class that I can use?

Thank you very much for your time, really appreciate it! :)

When I get it to work as a separate plugin (aside my other SK extensions) I will post it here for others to use.

cyberde
3 stars
3 stars
Posts: 61
Joined: Thu 11 Apr 2013, 08:00
Location: The Netherlands
Contact:

Re: RFXcom

Post by cyberde » Mon 13 Apr 2015, 06:49

I would like to use

Code: Select all

SwitchKing.Wrappers.RFXCom.RFXComWrapper.Instance.WriteCom(byte[] kar)

But it is a private method, the

Code: Select all

SendCommand(byte command, string message)
method is public, but only allows me to send one byte, in order to control lights I need to send a byte array. Any idea? Can you recompile by making the WriteCom method public?

The only thing I've noticed is when receiving the events from TempHumidity items through the RFXcom, it only allows you to register the Temperature and not Humidity (while the code does decodes the humidity message). Is this a known bug, it looks like the raw data string is too long? Other than that, the implementation of the RFXcom looks very sold already, good job!

If I decide to update/recreate the reception of the events itself to fix the humidity bug and support for other devices, what should exactly be done to get a raw event into SwitchKing so they appear in the TelldusLog and create datasources from it? As a plugin has full access to all BusinessInstances I assume this can be done :)

[edit]
Solved sending commands this way:

Code: Select all

            var rfxComWrapper = SwitchKing.Wrappers.RFXCom.RFXComWrapper.Instance;

            MethodInfo dynMethod = rfxComWrapper.GetType().GetMethod("WriteCom", BindingFlags.NonPublic | BindingFlags.Instance);
            dynMethod.Invoke(rfxComWrapper, new object[] { myCommand });
A bit nasty, but it does the trick.

[edit2]
Got the stand alone plugin working, SwitchKing can now function without a Telldus by enabling RFXcom reception with the SwitchKing SQL commands and by using my plugin it can also send commands :D

cyberde
3 stars
3 stars
Posts: 61
Joined: Thu 11 Apr 2013, 08:00
Location: The Netherlands
Contact:

Re: RFXcom

Post by cyberde » Fri 17 Apr 2015, 10:33

I've finished the plugin and it can be found here: http://www.switchking.se/forum/viewtopi ... =23&t=1712

Martin
Administrator
Administrator
Posts: 2655
Joined: Tue 09 Nov 2010, 20:25

Re: RFXcom

Post by Martin » Thu 23 Apr 2015, 10:20

Cyberde, since the RFXCom is in a separate assembly, we have no problem providing you with the source code for this so that you can make any changes directly in the core part.
The assembly publishes events to Switch Kings internal event store, and in order to get the events to show up in Switch King you need to connect to the event bus.
By getting access to the code, you can hook up any way you want.
Let me know if this is of interest. :wave:
Martin | Switch King

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest