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 )
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:
- Press Button 1
- Press Button 1
- 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
.