I have a VeraPlus connected to my OpenHAB 1.8.3 via the MiOS binding and I’m trying to read and eventually write the house mode. I read the thread at MiOS Binding - House Mode but I don’t have a urn:micasaverde-com:serviceId:HouseModes1 (or any HouseModes) device anywhere in my user_data.xml, so I don’t know what deviceId to use.
Maybe I misunderstood how to access it, or maybe the format has changed. I DO see the mode in my user_data.xml, but it’s in the Mode attribute of my <root> tag and I’ve watched it change from Mode=“1” to 2, 3, and 4 as I cycle through the Home, Away, Night, and Vacation modes. I did try accessing it as:
2017-03-01 17:05:57.277 [WARN ] [ore.internal.items.ItemUpdater] - InstantiationException on org.openhab.core.library.types.StringType
Any ideas how to proceed from here?
(Note: I am running a beta build of the Vera firmware right now in order to get Alexa support, but it looks like the Mode was in the <root> tag instead of a HouseModes1 device even before I did that upgrade, as I still have the first user_data.xml file I worked on almost a year ago.)
Now, if you set the House-mode via Vera’s UI, then Vera’s logs will have the [URL] call they’re making to do that.
You’ll need to enable Verbose logging on your Vera prior to running through this exercise.
If you can grab me that section of Vera’s /var/log/cmh/LuaUPnP.log file then I might be able to work out how to add set capability to the System settings via the MiOS openHAB binding (or at least give you a work-around…
I did enable verbose logging on the VeraPlus and it looks like it’s using action=SetHouseMode: 12 03/04/17 16:04:00.450 luvd_get_info_data_request starting /data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=SetHouseMode&Mode=1&rand=0.5997565290129718 pMem 0x145e000/21356544 diff: 6074368 <0x7487b520>
Using that URL with my own generated random value (or, as it turns out, no rand at all) seems to work: I was able to trigger the mode change (including the arming delay that exists for everything but “Home”). Worst-case, you’ve given me enough clues that I could wrap a shell script around it at this point. I am curious as to the “right” way to use sendMiosAction() here so let me know what other info I can provide.
Number MiOSGateway "ID [%d]" {mios="unit:house,device:0/id"}
and then used the code snippet in rule:
rule "Test MiOSGateway"
when
Time cron "0/10 * * * * ?"
then
logInfo("test-miosgateway", "testing: ")
sendMiosAction(MiOSGateway, 'HAGateway/SetHouseMode',
newArrayList('Mode' -> '1'))
end
and I can see openHAB calling my Vera. In my case, it’s Vera3/UI5 so my Vera is returning an error response (the rand is only needed by the UI, to bypass browser-caching):