Can't link rfid node item



  • Hi guys,

    I am having trouble linking an RFID node. So i thought i would pop down here to tikkle the software guys :smiling_imp:

    Here is my setup:

    Raspberry 3 + nRF24 as controller, running openhabian
    Arduino nano + nRF24 + RC532 + relays + "basic" sketch as per https://www.mysensors.org/build/rfid

    Gateway works fine with other nodes (motion, temp and hum)
    Node works fine, relay opens and closes when presented to the right rfid tag.

    I use PaperUi to discover nodes. Works like a charm :)

    I managed to link "last update" and "battery level" items . Both items were then included within .item and .sitemap files and showed-up nicely in Paper UI as well as in iOS app.

    But I got an error when linking "lock" item : error message at the bottom right hand corner of Paper UI
    Here is what i get when logged into Karaf console:

    16:20:33.171 [WARN ] [thome.io.rest.core.item.ItemResource] - Received HTTP PUT request at 'items/MySensorsDevice21_Lock' with an invalid item type 'Status'.
    

    Does it make any sense to you?
    "lock" item returns a status right?
    Child ID for that piece of kit is always "99" in sketches i have come accross... does it matter? (I have tried and didn't make a change in that particular case... will it matter later on? Is it like "battery level" that has to be 255?)
    Thanks for your help
    Regards
    Ben



  • The ID shouldn't matter..

    What is the lock item? Showing the status of the lock?

    Interesting that those get added to your files, for me the items that I add through Paper UI are not reflected in the folder structure, which is quite annoying...

    Checking https://www.mysensors.org/controller and https://www.mysensors.org/download/serial_api_20 it looks like the lock stuff should be fully supported by OH, weird. Did you ask in their forums? It's superactive actually...



  • Hi @pansen

    Thanks a lot for your reply. Ok for ID number.

    Yes lock item is supposed to show status of the rfid lock device.

    Here is the way it works for me :

    • discovery of node via Paper UI
    • i then "link" every relevant item of that node within PaperUI
    • include these items in "home.items", "home.sitemap" and rules (as text files with editor, old fashioned way)

    My item file

    
    Contact salonMotion01 "Présence Salon" <motion2> (gMotion,gSalon) { channel="mysensors:motion:65885f11:Motion_1_1:tripped" }
    Number salonBatt01 "Batterie [%.1f %%]" <battery> (gBattery,gSalon) { channel="mysensors:motion:65885f11:Motion_1_1:battery" }
    DateTime salonUpdate01 "Dernière MAJ: [%1$ta %1$tR]" <calendar> (gUpdate,gSalon) {channel="mysensors:motion:65885f11:Motion_1_1:lastupdate" }
    Switch activateAlarm "Alarme activée" <switch> 
    Contact hallLock01 "Verrou entrée" <door> (gLock,gHall) {channel="mysensors:lock:65885f11:Lock_2_99:lock" }
    DateTime hallUpdate01 "Dernière MAJ: [%1$ta %1$tR]" <calendar> (gUpdate,gHall) { channel="mysensors:lock:65885f11:Lock_2_99:lastupdate" }
    

    and sitemap file (for iOS)

    sitemap home label="Cheny" {
            Switch item=activateAlarm
            Frame label="Premier étage" {
                    Text label="Palier" icon="office" {
                            Text item=salonBatt01
                            Text item=salonMotion01
                            Text item=salonUpdate01
                    }
            }
    }
    

    Hope i got your question right...

    Thanks for links. Yes it does say that openhab fully support the "lock" device...

    I will have a go on openhab forum and report back here if success...

    Thank you again

    Best Regards

    Ben



  • Hi

    I found this... :
    https://github.com/eclipse/smarthome/pull/2033/commits/008b4871ef308ae67400fe039e51e104fa061d83
    But what can i do with that?
    Seems to me that the file in question is some kind of install file that doesn't exist on my gateway as it is, right?
    Thanks for your help


  • Hero Member

    Hi @ben999 !

    The fix you've mentioned was already merged into ESH and because of the date (23. Aug 2016) I'm pretty sure it is already merged into OpenHAB. So I suppose we need to search somewhere else.
    Please dump the complete log (in DEBUG mode) of the karaf console starting from the presentation messages arriving at the gateway till the message in your first post. I'll then try to reproduce the behaviour.

    Greetings
    Tim



  • Hi @TimO
    My digital Knight coming (once again) to save me :blush:

    I logged into karaf (mysensors debug).

    That is when powering my rfid node (nano 328+nRF+RC532+relays)

    21:37:09.617 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    21:37:19.543 [DEBUG] [rs.internal.protocol.MySensorsReader] - 2;255;0;0;17;2.1.1
    21:37:19.566 [DEBUG] [ternal.handler.MySensorsThingHandler] - Setting last update for node 2 to 2017-05-09T21:37:19.554+0200
    21:37:19.567 [DEBUG] [rs.internal.protocol.MySensorsReader] - 2;255;3;0;6;0
    21:37:19.570 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - I_CONFIG request received from M, answering: (is imperial?)false
    21:37:19.573 [DEBUG] [rs.internal.protocol.MySensorsWriter] - Sending to MySensors: 2;255;3;0;6;M
    21:37:19.589 [INFO ] [marthome.event.ItemStateChangedEvent] - MySensorsDevice21_LastUpdate changed from NULL to 2017-05-09T21:37:19.554+0200
    21:37:19.595 [DEBUG] [rs.internal.protocol.MySensorsReader] - 2;255;3;0;11;RFID Lock
    21:37:19.609 [INFO ] [marthome.event.ItemStateChangedEvent] - hallUpdate01 changed from NULL to 2017-05-09T21:37:19.554+0200
    21:37:19.618 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    21:37:19.627 [DEBUG] [rs.internal.protocol.MySensorsReader] - 2;255;3;0;12;07.05.2017
    21:37:19.629 [DEBUG] [rs.internal.protocol.MySensorsReader] - 2;1;0;0;19;
    21:37:22.698 [DEBUG] [rs.internal.protocol.MySensorsReader] - 2;1;1;0;36;0
    21:37:29.619 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    

    That is when playing with a valid tag :

    21:37:49.622 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    21:37:58.475 [DEBUG] [rs.internal.protocol.MySensorsReader] - 2;1;1;0;36;1
    21:37:59.624 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    21:38:02.988 [DEBUG] [rs.internal.protocol.MySensorsReader] - 2;1;1;0;36;0
    21:38:09.625 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    

    And this is when i am in paperUI trying to link the "lock" item:

    21:38:49.631 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    21:38:59.360 [WARN ] [thome.io.rest.core.item.ItemResource] - Received HTTP PUT request at 'items/MySensorsDevice21_Lock' with an invalid item type 'Status'.
    21:38:59.633 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    

    And lastly this is when i "unlink" the "lastupdate" item and link it again. Dunno if relevant...

    21:45:09.706 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    21:45:14.418 [INFO ] [smarthome.event.ItemRemovedEvent    ] - Item 'MySensorsDevice21_LastUpdate' has been removed.
    21:45:19.708 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    21:45:39.711 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    21:45:41.713 [INFO ] [smarthome.event.ItemAddedEvent      ] - Item 'MySensorsDevice21_LastUpdate' has been added.
    21:45:42.396 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link 'MySensorsDevice21_LastUpdate-mysensors:lock:65885f11:Lock_2_1:lastupdate' has been added.
    21:45:49.713 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
    

    Once again, thanks a lot Tim for taking the time to look at that :)


  • Hero Member

    Hey @ben999 !

    Thanks for reporting and your patience!
    There was a bug in the binding. Please update your binding via IoT Marketplace or by replacing the jar with THIS version.



  • @TimO
    Smashing !!! You're an ace!
    How did you manage to spot the bug? Was it just applying to "Lock"?
    Anyway thank you very very much


  • Hero Member

    @ben999

    It was a bug in the description of the lock thing. You seem to be the first one that is using this thing type. ;-)

    Here is the commit, I only had to change one word.

    It was easy to spot with your help!



  • @TimO

    Great job, thanks again :smiley:

    I'm sure we all have weird setups :stuck_out_tongue_winking_eye:



  • @TimO
    Dude, it's awesome :)
    I even get a slider in paperUI to control the lock as well !!!

    BUT... (there's alway's a "but")
    Auto-discovery doesn't work anymore :cry:
    Here is what i get from Karaf when clicking on "refresh" (in Inbox > MySensors Binding > Search )

    21:50:27.220 [DEBUG] [.discovery.MySensorsDiscoveryService] - Stopping MySensors discovery scan
    21:50:27.227 [DEBUG] [.discovery.MySensorsDiscoveryService] - Starting MySensors discovery scan
    

    No more hourglass... no searching...
    Doc, i think we've lost it...


  • Hero Member

    @ben999 :D

    Well thank you again! That's an old bug and was totally overdue.
    An internal cache that was only cleaned up on a restart of the binding was preventing a (re)discovery after a removal.

    https://github.com/tobof/openhab2-addons/issues/39



  • @TimO

    Thanks a lot :)

    Having grown-up together with Windows got me used to reboot many time a day :laughing:

    I think i did reboot a few times last night but not sure about the timing though... might have done so for other reasons. I just gave up on discovery and went on with "manual mode"

    I will check tonight.

    Thanks @TimO for looking after us so well ;)


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.