More dumb questions - RFX door bells, MiOS Binding & Vera scenes

I’ve just got a Nexa doorbell button and I was hoping to use it as a simple button to trigger an end-of-day script in OH. My Veralite is currently used to control both Z-Wavw & 433 devices and I talk to the Veralite using the excellent MiOS Binding.

The door bell appears in the veralite as a group controller - Bright/Dim/Group ON/Group OFF and immediately configures a trigger to run scene 100. I can also add a notification to send me an email on either activation/de-activation of scene 100.

How do I tell OH to monitor the switch and detect that it’s been pressed?

Current attempts include:

Switch    EndOfDay     "End Of Day" (Switches) {mios="unit:house,device:134/service/SwitchPower1/Status"}
Number    EndOfDayId     "End Of Day Scene ID"        (gScenes) {mios="unit:house,scene:100/id"}
Number    EndOfDayStatus    "End Of Day Scene Status"     (gScenes) {mios="unit:house,scene:100/status"}
String    EndOfDayActive  "End Of Day Scene Active"   (gScenes) {mios="unit:house,scene:100/active"}

Number   EndOfDayButtonID "End Of Day Button ID [%d]" {mios="unit:house,device:134/id"}
String   EndOfDayButtonStatus "End Of Day Button Status [MAP(miosDeviceStatusUI.map):%s]"  {mios="unit:house,device:134/status"}

None of which error, but don’t actually do anything either! I know this is going to be a full D’oh moment…… And no, I’m not in a rush to migrate the 433 stuff to OH… :smile:

N

This might be specific to the RFX, so we’ll need to gather some more details to get that working correctly.

The quickest way to do that is to have you send me a copy of your user_data.xml from Vera. The MiOS Item Generator tool does this extraction, and it’s listed here:

https://github.com/openhab/openhab/tree/master/bundles/binding/org.openhab.binding.mios/examples/scripts

But DONT post it here, as it often contains sensitive information. If you scrub that out, then you can send it to me (provide a link via PM)

Alternatively, and this will be slower, you can enable TRACE mode in the MiOS Binding, and then restart openHAB. When you do this, the Binding will emit a number of DEBUG and TRACE level log lines indicating NOT BOUND

To find these lines, use:

grep "NOT BOUND" logs/openhab.log

These are the things from MiOS that aren’t specifically bound to Items in openHAB, and the RFX information will likely be among them.

To enable the detailed logging, edit your configuration/logback.xml (or logback_debug.xml if you’re already running in DEBUG mode) and add:

<logger name="org.openhab.binding.mios" level="TRACE" />

then restart openHAB.

Once you’ve gathered the data (from logs/openhab.log) you’ll want to turn it off again.

Thanks for the PM with your Vera’s user_data.xml, it helped me better understand your setup (and also helped me tune up the MiOS Item Generator with a few more use-cases :blush: )

I’ll send you a version of the output from a [highly-revised] MiOS Item Generator to give you a sense of what it will generate (once I submit the PR for the changes) but it’ll act as a good template for you in the meanwhile.

Looking at that data, and the “device 134” reference you made above, I found this in the generator output:

Number   NexaDoorBellEoDSwitchId "ID [%d]" (GDevices) {mios="unit:house,device:134/id"}
String   NexaDoorBellEoDSwitchDeviceStatus "Nexa Door Bell - EoD Switch Device Status [MAP(miosDeviceStatusUI.map):%s]" (GDevices) {mios="unit:house,device:134/status"}
Number   NexaDoorBellEoDSwitchslSceneActivated "Nexa Door Bell - EoD Switch Scene Activated [%d]" (GDevices,GRoom14) {mios="unit:house,device:134/service/SceneController1/sl_SceneActivated"}
Number   NexaDoorBellEoDSwitchslSceneDeactivated "Nexa Door Bell - EoD Switch Scene Deactivated [%d]" (GDevices,GRoom14) {mios="unit:house,device:134/service/SceneController1/sl_SceneDeactivated"} 

So the Nexa is handled by Vera as a standard Scene Controller device (similar to an Aeon Labs MiniMote device)

For Scene Controller devices, Vera will automatically will change the content of the sl_SceneActivated and sl_SceneDeactived UPnP State Variables, depending upon how you interact with them.

In the Item declaration snippet above, this translates to the following Items getting update events:

  • NexaDoorBellEoDSwitchslSceneActivated
  • NexaDoorBellEoDSwitchslSceneDeactivated

eg

rule 'Next Activated'
when Item NexaDoorBellEoDSwitchslSceneActivated received update
then
   ...
end

Events from MiOS Scene Controllers are a little tricky since, in openHAB, they need to be processed with received update instead of changed. This happens because the user can do a keypress sequence like:

  1. Press Button 1
  2. Press Button 1
  3. Press Button 2

And openHAB will only deliver this as 1 changed even (Button 1 -> Button 2). To make life more interesting, when openHAB Boots up, it delivers these [same] received updated events, so you have to add logic to detect this (there’s no event-source information in what’s delivered)

For the MiniMote, and regular MiOS Scene Controllers (Leviton, GE, etc), there’s an extra “date” State Variable present that can be used to do this, but the RFXCOM device isn’t conforming to this MiOS Scene Controller convention for some reason.

For your devices, you should have something like the following Item generated, but the source StateVariable is missing, so I don’t generate the entry:

DateTime NexaDoorBellEoDSwitchLastUpdate "Nexa Door Bell - EoD Switch Last Update [%1$ta, %1$tm/%1$te %1$tR]" <calendar> (GDevices,GRoom14) {mios="unit:house,device:134/service/HaDevice1/LastUpdate"}

Might pay to circle back with the MiOS Plugin owner (Florin?) to see if they can add the standard convention for HADevice1/LastUpdate.

It looks like scene:100 doesn’t exist in Vera, so that wasn’t generated out. Instead you have these that might be of relevance:

String   SceneEndOfDay32 "EndOfDay Scene" <sofa> (GScenes,GRoom8) {mios="unit:house,scene:32/status", autoupdate="false"}
Contact  SceneEndOfDay32Active "Active [MAP(en.map):%s]" <sofa> (GScenes,GRoom8) {mios="unit:house,scene:32/active"}
String   SceneEndOfDay33 "EndOfDay Scene" <sofa> (GScenes) {mios="unit:house,scene:33/status", autoupdate="false"}
Contact  SceneEndOfDay33Active "Active [MAP(en.map):%s]" <sofa> (GScenes) {mios="unit:house,scene:33/active"}

These look similar from a calling standpoint, but one is in in "Whole house", and the other isn’t listed in a Room.

If you want a quick work-around to the problem outlined above, you can do the following:

  1. Create a bunch of Scenes in Vera that are bound to the Buttons of the Scene Controller
  2. Give them “no-op” style scene definitions (no content)
  3. Bind them to Items in openHAB, like the above defns are
  4. Write Rules when the scene becomes “active”

eg.

rule 'Nexa Button 1 Activated'
when Item SceneEndOfDay32 changed from NONE to PENDING
then
   ...
end

It’ll avoid dealing with the hastle of getting the RFXCOM MiOS Plugin Patches, as well as avoid the complexities of handling received update events in openHAB.

When debugging these, the logs/events.log will be your friend… at least it will be once the MiOS UPnP things are bound to their counterpart Items.

The Item Generator tweaks, derived from your user_data.xml file, have been submitted as this PR:

Mark

Thanks for this, I will try and look at implementing the suggestions tonight.

Interesting that all those scenes are listed - I’ve actually deleted all the scenes and moved them across to OH ages ago - I guess the Vera keeps them in it’s configs until more space is needed! The only scene that currently shows up in the UI5 is number 32 - whole house end-of-day.

Nick

@guessed: as you should know , I am the author of the RFxtrx Vera plugin. What date state variable should I set ?
I am already setting LastUpdate from service HADevice.

Sorry about that @lolodomo, I looked in apps.mios.com to find the owner instead of running a query against forums.micasaverde.com (I always get rfxcom and rfxtrx mixed up)

In this case @nick_wootton provided me with his Vera’s user_data.xml, and the device in question has the regular scene-controller entries, using the standard MiOS ServiceId’s:

  • sl_SceneActivated
  • sl_SceneDeactivated

Internally, these are associated with Device 134, which has these Device characteristics:

  • Device Type: urn:rfxcom-com:device:X10ChaconRemote:1
  • Device File: D_X10ChaconRemote1.xml

On regular Vera scene controllers, , Vera sets urn:micasaverde-com:serviceId:SceneController1/LastSceneTime (similar in nature to HaDevice1/LastUpdate) with an epoch equivalent to “now” each time a button is activated.

Users can use this to filter Rule execution, to avoid startup/Item state replay/restore issues from openHAB.

Anyhow, in the case of this device, it’s only got the following in the state block:

        <states>
                <state service="urn:micasaverde-com:serviceId:SceneController1" variable="sl_SceneActivated" value="100" id="0"></state>
                <state service="urn:micasaverde-com:serviceId:SceneController1" variable="sl_SceneDeactivated" value="100" id="1"></state>
        </states>

and when I read the code from trunk, there’s no reference to LastSceneTime.

Could you add it to the various cases where you’re translating the RFXTRX events into SceneController1? That’ll help make them a closer approximation to what Vera does.

I was not aware of this state variable.
I will try to add it. Thank you for the explanation.

1 Like