We have moved at community.getvera.com

Author Topic: [_CODE_] ActiveRFID Plugin  (Read 41361 times)

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
[_CODE_] ActiveRFID Plugin
« on: July 05, 2010, 09:59:41 am »
Cheap RFID solution for Vera.  This is now working reliably in UI2 and UI4 beta.  Looking for people to test it.  

http://code.mios.com/trac/mios_activerfid/
« Last Edit: May 13, 2011, 08:48:00 am by woodsby »
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: [_CODE_] ActiveRFID Plugin
« Reply #1 on: July 05, 2010, 10:46:41 am »
This is very tempting. I'm going to hold off doing this for the time being as I have multiple other projects on the go and I fear with a new baby around at the moment, the poor thing wont get to know she has a Daddy around :)

I love home automation, but the irony of it is that despite whatever time it can save you in the long run, it really does suck up some time initially getting stuff working!

Have you tried to experiment with your scenes a bit to cover multiple transmitters? This is really a place where we need those conditional expressions in vera.

Have you got any other examples of things you are using this for? I think this would be most useful for people with Alarm panels etc that are tied to Vera.
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #2 on: July 05, 2010, 11:08:44 am »
Strangely, it's very minimal setup, and you being savvy with serial on vera, it should take you no time.

Currently, I am just using 2 40m transmitters on a receiver plugged directly into Vera.  I have two scenes triggered off either device to open and close the garage door.  I will be adding a luup "and" scene to enable thermostat energy save mode if both devices are gone - probably do that this evening.  The security system arm/disarm is probably the most productive concept.

I also have a keychain transmitter that I plan on using to play around with presence sensing around the house; hence my other posts about serproxy...
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: [_CODE_] ActiveRFID Plugin
« Reply #3 on: July 05, 2010, 01:49:44 pm »
Its not so much the serial ports I'm worried about time wise, its hours I would then spend tinkering with it :)

I also think this would be good for the garage door but I've been waiting nearly 3 months for ASI to get the relays back in stock :(
The other things I have on the go are:

Zwave Garage door opening / closing  (whenever I get the damn relay)
Patio awning to order, mount on the wall and hack it to work with zwave.
A Kwickset lock to fit.
Aeon energy monitor to fit to my Electrical panel
Etherrain sprinkler controller to install and then replace all my sprinklers (most are worn out), then re-seed my lawn.

After I've done all that, then I can see some RFID in my future :)
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #4 on: July 05, 2010, 03:35:01 pm »
Multiple transmitters on multiple receivers confirmed.  Tested with an RSSI receiver plugged directly into Vera, and a standard receiver plugged into another computer on my network via @guessed's IPSerial plugin.
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline Klunket

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #5 on: July 12, 2010, 10:37:07 am »
This looks superb - great work. Once I've bedded down a few things with my setup I may look at adding RFID.

One question about how you've done your setup as I have come across a similar problem planning my own plugin. I notice you manually create each child object for the transmitters, and then assign them based on the ids found in the logs. Instead would it be possible to dynamically create these child objects as they are seen by the serial device? Would save tailing the file, although you might want it to be a setting to stop it adding ones you aren't using.

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #6 on: July 12, 2010, 02:36:31 pm »
@Klunket - that's my next step - I've been considering different options - automatically adding child devices, or maybe just populating a parent (receiver) state variable with unassigned transmitters, and leaving it up to the user to add transmitters as needed.

But, until MCV adds built-in support for the pl2303, we are still stuck logging in ssh... or using the serial receivers and a supported IP-Serial device.
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #7 on: July 13, 2010, 03:37:10 pm »
I notice you manually create each child object for the transmitters, and then assign them based on the ids found in the logs. Instead would it be possible to dynamically create these child objects as they are seen by the serial device?

Automatic discovery of transmitters has now been added, tested in UI4, and committed on the code.mios.com page.  Now, we just need MCV to build in support for the PL2303 (hint, hint).  I'll update the wiki with UI4 screenshots when I get some free time.

The next step is to add a "known transmitters" state variable, so transmitters can be deleted without being automatically re-added. Be careful though, if you delete the parent device (RFID receiver) without deleting the child devices (transmitters), and save in UI4, it gets stuck - I don't think this has anything to do with the plugin.

Note, that the "Transmitters" state variable is no longer used, and has been removed.
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline Klunket

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #8 on: July 14, 2010, 08:14:49 am »
This is brilliant - looking at your code has been very insightful about what is possible in Luup.

Is there a luup reference I am missing, or have you just trawled through the built in objects to see what is possible?

Also, I am trying a gutted version of your plugin in UI4 and I can't see any of the variables you have defined - am I missing something? I was expecting them to just appear like in the UI2 screenshots.

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #9 on: July 14, 2010, 08:25:03 am »
The only state variable that should appear without actually installing the serial port device is ExpireTime. All other variables populate when you install the serial port device and link it to the RFID receiver device, and of course when new transmitters are found by the receiver. I have to make a change today that re-enumerates the id's of the child devices on startup - with yesterday's code mods, you'll have a problem if you delete any transmitters other than the last one added.  I will also add a time limit on addind unassigned transmitters - right now it's set up to add a transmitter if it receives 10 transmissions during a single "uptime" of Vera - I will restrict it to 10 transmissions in 2 minutes. 
Use the lua reference manual and the luup lua extensions on the wiki - that should give you all the info you need.
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #10 on: July 15, 2010, 06:23:03 pm »
I have to make a change today that re-enumerates the id's of the child devices on startup - with yesterday's code mods, you'll have a problem if you delete any transmitters other than the last one added.  I will also add a time limit on adding unassigned transmitters - right now it's set up to add a transmitter if it receives 10 transmissions during a single "uptime" of Vera - I will restrict it to 10 transmissions in 2 minutes.

Both of these changes were implemented, tested and committed last night.  I will update the wiki in the next couple days, and test exhaustively for the next week.
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline shady

  • Hero Member
  • *****
  • Posts: 1331
  • Karma: +11/-0
  • This monkey knows his Window Coverings!
Re: [_CODE_] ActiveRFID Plugin
« Reply #11 on: July 17, 2010, 04:02:59 pm »
Woodsby, I'd like to help test all of your hard work.  I'm still in the dark as to exactly how it is you're using it though.  Are the 40m transmitters mounted in your vehicles?  If so, then 40m might be too much for me, or does it take a while for the system to respond so you want as much early detection as you drive up as possible?

I need more experience with serial and Vera so this might be a good way to get it.  Can you explain some of your plans for using RFID, if not here then on your other post which I am having trouble finding, specifically range-wise, where the receivers get placed, smaller transmitters on key-chains possibly.  Like I said I'm still confused, but intrigued and ready to spend a bit on this.
Vera3 1.5.346, Schlage (3)DB (2)Lever, Kwikset (1)Lever, RCS TZ43 Thermo, (2) Vizia RZI06-1LX 600W Dimmers, (17) Monster (Leviton) Dimmers (6) Monster (Leviton) IWC Scene Controllers (1) Etherrain-8, (3) HSM 100's (1)GE 3-Way set

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #12 on: July 21, 2010, 09:12:40 am »
@shady, sorry for the delay - had a UPS blow-up to deal with the last five days...
Anyway, I bought a 40m transmitter for each car, opened them up, replaced the batteries with name-brand ones, wrapped the battery pack in electric tape to prevent them from becoming dislodged, and the sealed the transmitters using liberal amounts of liquid electrical tape ($5 at the hardware store).  I mounted the transmitters inside the front bumper (behind the plastic bumper, away from the metal frame).  In both cars, the bottom of the bumper has cutouts in it, so I was able to ty-rap the transmitters to the bottom of the inside of the bumper.  I stretched the antenna out (left-to-right across the bumper) and ty-rap or duct tape it down.  I wouldn't place it inside the car, since the metal frame really interferes.
The plugin doesn't take long at all when it finds transmitters, so the only delay i see is the z-wave delay opening the door.  I would stick with the 40m transmitters - you don't get nearly 40m with it through walls, and the RSSI receiver has shorter range if you go that route.  I have a keychain version, but I haven't played around with it much.
As for serial setup, I think the final release of UI4 will automatically find the USB version of the receiver.  I have not had a chance to update the wiki, but the latest version of the plugin automatically finds transmitters and creates devices for you, so we will soon be able to just plug-and-play.
I don't know what my plans are just yet.  I placed a receiver in the bedroom, but what's funny is the keychain is found by the RSSI receiver in the family room while standing outside, but is not found by the standard receiver when standing more than 10 feet away.  It also seems that the 40m is found by the stardard receiver before it is found by the RSSI receiver.  So, I have some playing around to do.  I don't know if the RSSI receiver will offer many benefits at this point, but I do intend to add "signal strength goes above/below" events... if I can.

One last note, I took @guessed advice, and bought a wiznet wiz112sr, and coincidentally enough, I can plug it right into the RFID board and fit it in the same enclosure - just a little bit of soldering involved.  I just need to cut out for the network jack and power supply, but when I do, I will post instructions/pictures.
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #13 on: July 26, 2010, 06:52:10 pm »
The wiki has been updated for UI4, with updated screenshots.  These instructions are compatible with version 1.1.1029 (or later).
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline shady

  • Hero Member
  • *****
  • Posts: 1331
  • Karma: +11/-0
  • This monkey knows his Window Coverings!
Re: [_CODE_] ActiveRFID Plugin
« Reply #14 on: July 27, 2010, 01:05:20 pm »
One last note, I took @guessed advice, and bought a wiznet wiz112sr, and coincidentally enough, I can plug it right into the RFID board and fit it in the same enclosure - just a little bit of soldering involved.  I just need to cut out for the network jack and power supply, but when I do, I will post instructions/pictures.

Is this so the receiver can link wirelessly via Wi-Fi to Vera?
Vera3 1.5.346, Schlage (3)DB (2)Lever, Kwikset (1)Lever, RCS TZ43 Thermo, (2) Vizia RZI06-1LX 600W Dimmers, (17) Monster (Leviton) Dimmers (6) Monster (Leviton) IWC Scene Controllers (1) Etherrain-8, (3) HSM 100's (1)GE 3-Way set