We have moved at community.getvera.com

Author Topic: Another plugin update  (Read 1638 times)

Offline tinman

  • Full Member
  • ***
  • Posts: 215
  • Karma: +16/-0
Another plugin update
« on: August 11, 2018, 11:59:01 am »
Added a new state variable: IPPort. This can be used by those who want to connect their RFXtrx transceiver using wifi adaptor. It can be set to the desired IP port. This setting does not appear in the RFXtrx settings dialog since it will probably not be used by many. When using the normal USB connection, setting the IPPort value will have no effect.
Added the signal strength to the data shown in the Managed Devices tab. Also removed signal strength and battery state from the Temperature and Humidity page.
Added ability to decode messages from Kangtai and Cotech devices. These will be seen as door sensors.
Lots of code changes to improve readability by implementing classes. Improved use of binary variables.
The attached zipfile contains all the files but only 4 are changed:
L_RFXtrx.lua
S_RFXtrx.xml
D_RFXtrx.json
J_RFXtrx.js

Offline Vinx

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +2/-0
Re: Another plugin update
« Reply #1 on: September 03, 2018, 02:27:04 pm »
Thank you tinman for the update. I've been on version 1.0 for a long time and was happy to find this upgrade. I was also happy to find that a problem I had with deleting devices is now resolved.

I have a new issue as well though. I'm no longer able to disarm my KAKU devices. Arming works, but disarming is simply ignored. The logs (with debug) implies that RFXtrx is trying to set "armed" to 0, but after that the value armed is set from 1 to 1.


Code: [Select]
08 09/03/18 20:15:49.553 JobHandler_LuaUPnP::HandleActionRequest device: 277 service: urn:micasaverde-com:serviceId:SecuritySensor1 action: SetArmed <0x71624520>
08 09/03/18 20:15:49.554 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=277 <0x71624520>
08 09/03/18 20:15:49.554 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:SecuritySensor1 <0x71624520>
08 09/03/18 20:15:49.554 JobHandler_LuaUPnP::HandleActionRequest argument action=SetArmed <0x71624520>
08 09/03/18 20:15:49.554 JobHandler_LuaUPnP::HandleActionRequest argument newArmedValue=0 <0x71624520>
08 09/03/18 20:15:49.554 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.46216635069513257 <0x71624520>
50 09/03/18 20:15:49.555 [b]luup_log:82: RFXtrx: dbg: setArmed DS/L2.0/0E19A26/10 target 0 <0x71624520>[/b]
06 09/03/18 20:15:49.555 Device_Variable::m_szValue_set device: 277 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: Armed was: 1 now: 1 #hooks: 5 upnp: 0 skip: 0 v:0x1237428/NONE duplicate:1 <0x71624520>

It's the same for all KAKU sensors. I've tried this with Z-wave sensors as well and those disarm normally.
I hope you can help me!

Offline tinman

  • Full Member
  • ***
  • Posts: 215
  • Karma: +16/-0
Re: Another plugin update
« Reply #2 on: September 04, 2018, 09:59:47 pm »
OK, I've found a problem in the code. I'll have a fix very soon.

Offline Vinx

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +2/-0
Re: Another plugin update
« Reply #3 on: September 05, 2018, 02:28:24 am »
That's awesome :). Meanwhile I've rolled back to 1.0 to get things working again.
For my curiosity and improving my own widget-writing skill: where should I have looked if I'd wanted to find the bug myself?

Offline tinman

  • Full Member
  • ***
  • Posts: 215
  • Karma: +16/-0
Re: Another plugin update
« Reply #4 on: September 05, 2018, 01:08:58 pm »
Attached is a zip file with all of the plugin files. Only two have changed:
L_RFXtrx.lua - fix a bug encountered when arming or disarming a security sensor
J_RFXtrx.js - only a small cosmetic change in displaying temperature readings.

Offline Vinx

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +2/-0
Re: Another plugin update
« Reply #5 on: September 05, 2018, 03:16:48 pm »
Works like a charm, thanks again for looking into this so quickly.

Offline tinman

  • Full Member
  • ***
  • Posts: 215
  • Karma: +16/-0
Re: Another plugin update
« Reply #6 on: September 05, 2018, 03:36:31 pm »
Glad I could fix it quickly. As for how to find problems - in general note the last time everything appears to be working properly and then when it isn't. Inspect the code in between. The debug output you posted shows the target as 0 but the setting became 1. The VAR_ARMED variable should be a boolean so the value received in setArmed should be checked and the appropriate boolean value sent to setVariable.

Offline Forzaalfa

  • Full Member
  • ***
  • Posts: 227
  • Karma: +5/-0
Re: Another plugin update
« Reply #7 on: September 07, 2018, 01:32:20 pm »
Good man! Thankyou!  :D
Vera Plus - RFXtrx433e

Offline madmaniac73

  • Newbie
  • *
  • Posts: 18
  • Karma: +1/-0
Re: Another plugin update
« Reply #8 on: September 15, 2018, 07:00:37 am »
Has anyone upgraded RFXTrx with firmware type Pro1 and got it to work properly with the current plugin version?

Offline tinman

  • Full Member
  • ***
  • Posts: 215
  • Karma: +16/-0
Re: Another plugin update
« Reply #9 on: September 15, 2018, 09:20:01 am »
I'm working on updating the plugin to recognize the new firmware types. It's going to be a few days until it's ready.

Offline madmaniac73

  • Newbie
  • *
  • Posts: 18
  • Karma: +1/-0
Re: Another plugin update
« Reply #10 on: September 15, 2018, 10:48:37 am »
Thanks for your commitment tinman, looking forward to this since the Pro firmwares really solves a lot of coexistence issues between different protocols.

Offline tinman

  • Full Member
  • ***
  • Posts: 215
  • Karma: +16/-0
Re: Another plugin update
« Reply #11 on: September 15, 2018, 11:11:31 am »
The changes I need to make only involve displaying the receiving protocol settings appropriate for the firmware type. The only problem with the current plugin version is thinking the firmware type is 'unknown'. I don't think it will impact the functionality of the plugin using the existing settings of the RFXtrx transceiver which you can make or view using the RFXmngr.
Can you give me some info about the improved coexistance you're describing? I'm just curious.

Offline Matsohl

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +4/-1
Re: Another plugin update
« Reply #12 on: October 28, 2018, 02:38:59 pm »
Nice work with this. Suddenly I can add new devices again. Thanks ! :)
Vera Plus and Vera Edge with (Hue, Fibaro, Qubino, IKEA, Nexa, Sonos, Telldus, Sensative, Imperihome etc.) and Arduino, ESP8266

Offline thomasx

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-1
Re: Another plugin update
« Reply #13 on: October 31, 2018, 07:30:14 pm »
Hi

I updated with the 1.51-version, and now when I go into "RFXtrx Settings", it just shows an empty window, all the protocols are gone. What happened? How do I get them back?
« Last Edit: October 31, 2018, 07:35:39 pm by thomasx »

Offline tinman

  • Full Member
  • ***
  • Posts: 215
  • Karma: +16/-0
Re: Another plugin update
« Reply #14 on: November 01, 2018, 09:08:55 am »
Have you checked the serial port settings? Go to Apps -> Develop Apps -> Serial port configuration and make sure the Used by device setting indicates your RFXtrx. And that the baud rate is 38400, data bits is 8, stop bits is 1 and parity is none.
« Last Edit: November 01, 2018, 09:11:34 am by tinman »