more G-Labs products

Author Topic: Trying to get RFX433 Devices working  (Read 10724 times)

November 01, 2014, 08:29:41 AM
Reply #15

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
With all the information here, I was able to get my new RFXtrx433E to work with HomeGenie :)

Well... I've only got a single remote switch at the moment, but I managed to get HomeGenie to listen to it and switch a Hue light on and off , the code I've written is a mess though :P

Quote from: Gene
Anyway I was in the will of porting this https://github.com/opensourceautomation/Open-Source-Automation/blob/master/Plugins/OSAE.RFXCOM/OSAE.RFXCOM.cs to a MIG Interface class.

Has this already been ported to HomeGenie? I'd like to help but it's a little over my head, if anyone can give me any pointers as to where I should start I'd be very happy to hear from you.

November 02, 2014, 04:54:24 PM
Reply #16

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
Yay! I got two cheap! temperature sensors working, but it's a bit of a mess...:)

What would be the best way to incorporate something like this elegantly in HomeGenie? I've attached two files:

1003-Temp_Humidity_Sensor.hgx
Virtual modules for the Temp/Humidity widgets

132-Serial_Port_I-O_Test.hgx
A modified Serial Port IO test file.

As I said earlier, it's a bit of a mess. You need to name the widget with the cryptic Id of the RFX433 device, cause I don't know how to do it another way.

If anyone can show me how to get started with making a 'proper' MIG interface I'll be glad to get it into HomeGenie.


November 07, 2014, 04:21:55 PM
Reply #17

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
Still playing around with this, I bought three Siemens PIR and managed to get them working with HomeGenie. Also managed to get a remote control working as well.

Now to get the 433 MHz smoke alarms working. Have to wait until the family is doing something else though, I don't think they'll appreciate the noise...:)

September 13, 2015, 08:28:33 PM
Reply #18

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
Hy mvdarend do you have the oportunity to improve this code?
Yay! I got two cheap! temperature sensors working, but it's a bit of a mess...:)

What would be the best way to incorporate something like this elegantly in HomeGenie? I've attached two files:

1003-Temp_Humidity_Sensor.hgx
Virtual modules for the Temp/Humidity widgets

132-Serial_Port_I-O_Test.hgx
A modified Serial Port IO test file.

As I said earlier, it's a bit of a mess. You need to name the widget with the cryptic Id of the RFX433 device, cause I don't know how to do it another way.

If anyone can show me how to get started with making a 'proper' MIG interface I'll be glad to get it into HomeGenie.



September 14, 2015, 06:52:43 AM
Reply #19

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
Hy mvdarend do you have the oportunity to improve this code?

I did modify it slightly months ago, but then I sold the RFX device as I've moved over to MySensors .

I can't seem to find my backups from then, if I do I'll post the modified files. But basically you don't need a custom widget for sensors. Grab the given ID from the device and use it to create a virtual module. (See CptJacks MySensor code for an example.)

It also looks like domotica_user has some working code. http://www.homegenie.it/forum/index.php?topic=275.msg6500
« Last Edit: September 14, 2015, 08:42:49 AM by mvdarend »

September 14, 2015, 09:18:25 AM
Reply #20

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
When you tell unit id what you use for it?

I'm asking because i have multiple oregon scientific sensors, but tu read the information i use an arduino in the raspberry so i can go to the serial get the info, but me arduino have a code to decode the ook format and send it as string, what identify in me case is unit id (usally two numbers) and the channel.

What is yours?

September 14, 2015, 09:23:44 AM
Reply #21

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
I used both codes as a unit Id, something like this: (untested code of the top of my head, you'll need to modify this.)
Code: [Select]
      string unitId = String.Format("{0}{1}", message[4], message[5]);

      var module = Modules.InDomain("RfxCom").WithAddress(unitId).Get();
      if (module.Instance == null)
      {
        Program.AddVirtualModule("RfxCom", unitId, "Sensor", "homegenie/generic/sensor");
        module = Modules.InDomain("RfxCom").WithAddress(unitId).Get();
      }
      if(module.Parameter(deviceType).Value != mpayload)
      {
        module.Parameter(deviceType).Value = mpayload;
        Program.RaiseEvent(module, deviceType, mpayload, "");
      }


September 14, 2015, 10:05:04 AM
Reply #22

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
Thank you for your help.
When i'm home i will try it.

I must understand first what methods i can use in c# because the string i get is something like
XXXXXXXXXXXXXXXXXXXXXXXXXX;Id:82;Channel:2;bate:90%;temp:17

I'm able to split the string whith ; char. If i can't find a better way i will do a split again with the :

Cheers

September 14, 2015, 04:55:00 PM
Reply #23

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I opted to use Acurite for my sensors, but they are functionally similar to those Oregon Scientific sans local temperature display.  I didn't use the RFX433 since I was looking at incorporating other sensors too.  Rather, I opted for an Arduino + 433MHz receiver.  MySensors is probably easier in that the code is designed to work this way rather than using the OEM sensors that require decoding.  Decoding the protocol and writing the code to receive is potentially difficult and time consuming unless the sensor is already decoded.

September 19, 2015, 10:35:28 AM
Reply #24

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
I 'm able to get the values.
I would love to replace the code so we can use the module name as sensor name and add a module parameter for de device id, but i can't find anything in the docs to add variables do the virtual module, i'm able to do it if it was a normal module...

ANy help will be welcome

September 21, 2015, 08:43:10 PM
Reply #25

DavZero

  • **
  • Information
  • Jr. Member
  • Posts: 48
Hi, not sure it help because I haven't change a lot from other previous snippets but find my version attached.
It will add new virtual module as soon as this module send data.
I've prepare code for adding other type of sensor.
I've too add a parameter for define the serial port.


If anyone know how to add entry in the event history without do a "Program.Notify" which show a popup please tell me.

Note :
1 - I've try to decode some additionnal data which doesn't appear in the widget, if anyone would made a new widget to handle this data, I could update the program for use it.
2 - I have only 3 THGN122 so I hope this works with other sensor but not tested
3 - I'm not sure if I correctly decode the HumidityStatus because I've seen some strange result (Humidity = 71%, HumidityStatus=Dry ^^)

January 03, 2016, 06:04:39 PM
Reply #26

Deggle

  • *
  • Information
  • Newbie
  • Posts: 11
Hello,

Firstly, thanks for the great work on HomeGenie. I'm just getting back into some HA projects (moving home, and the new place has loads of HA friendly stuff) and came across HomeGenie. It looks really ideal for me - well thought out and flexible model, and I'm very familiar with C#/.NET so great to be able to leverage that. You've done a great job!

Anyway - like many others, I've an RFXCom device (mine is the LAN model, but the underlying messages are the same as the USB/COM Port models and it can create a virtual COM port for it).

You mentioned:

Anyway I was in the will of porting this https://github.com/opensourceautomation/Open-Source-Automation/blob/master/Plugins/OSAE.RFXCOM/OSAE.RFXCOM.cs to a MIG Interface class.

Have you any more thoughts about doing this?

Wile I'm willing to develop my own program (I assume I'd have to do everything in one, background running 'program') to access this device, it does seem like it would be more fitting to create a proper MIG Interface for this. I've had a look at the MIG source, but I think it's something would take me some time to get working without being familiar with the system.

I think it would need something along the lines of the ZWave with device discovery perhaps? There is a long list of devices (and therefore modules) that the RFXCom transceivers can work with, and it would be great to have this working properly rather than bodging something.

On the other hand, the fact it works with so many different device types may make it very complex for you to integrate as a general interface? If you think this is the case, perhaps it's best for me to code a program that just interfaces with the devices/modules I need? Having said that, the OSAE.RFXCOM.cs code referred to above does seem to include all those that are of interest to me.

Sorry for dragging up an old thread!

Would be great to hear your thoughts?

Thanks again,

Tim

January 03, 2016, 06:30:44 PM
Reply #27

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Deggle,

as you said, I don't think that a MIG interface is really needed here, as this can be implemented with an automation program.
See DavZero's example in the previous message:

http://www.homegenie.it/forum/index.php?topic=296.msg6616#msg6616

I see that the supported device list/codes is very long, but can be possibly included with a little effort into a single automation program rather than a mig interface plugin. Or as you said, you can try to just implement the devices you need.

Cheers,
g.