OpenHAB Binding for Multi-Switch

Howdy,

A clarification on the Vera/Binding support for the common MultiSwitch device/plugin on Vera.

When you have an item bound to one of the multi-switch buttons and do a ‘item.sendCommand(ON)’, is it actually executing an ON command on the Vera side?

I ask because in some Vera scenes I have now, I directly change the state of a MultiSwitch button using the command SetStatus = 1 (well, technically SetStatus2 = 1 for button #2). This appears to be different than sending an ON command to the button (the ON command seems to cause related triggers to fire where SetStatusN just changes the button state without firing related triggers).

If there is a difference, is there an existing way to just set the status of a MultiSwitch button instead of sending an ON to it?

(this is a temporary situation as I’ll eventually eliminate all my trigger code to OH, but I’m doing it in stages as I learn the environment)

Gerry

Multiswitch has no built in defaults in the MiOS Binding, so sending it an [tt]ON[/tt] Command does nothing.

If you work out what the defaults should be, then they can readily be added to the Binding. I don’t use Multiswitch, so it’s arduous to work it out.

The defaults are in [tt]openhab/binding/mios/internal/config/DeviceDefaults.properties[/tt], and typically go hand-in-hand with one or more [tt]OH/configuration/transform/mios*.map[/tt] files that actually turn the values into the required UPnP Action call.

Howdy,

Playing with it shows the sendCommand(ON) is a no-op , so that squares with what you say.

I’m just going to use an action like:
sendMiosAction(HomeModeId, “urn:dcineco-com:serviceId:MSwitch1/SetStatus2”, newArrayList(“newStatus2”, “1”))

(that sets Button 1 to on).

If you’re curious, here’s the lu_invoke data for the switch. (it appear to only understand the SetStatus# methods and not any other schemas (i.e. no explicity ON like a single-item switch):


urn:dcineco-com:serviceId:MSwitch1
*SetStatus1 (newStatus1)
*SetStatus2 (newStatus2)
*SetStatus3 (newStatus3)
*SetStatus4 (newStatus4)
*SetStatus5 (newStatus5)
*SetStatus6 (newStatus6)
*SetStatus7 (newStatus7)
*SetStatus8 (newStatus8)
*SetRadioBtns (newRadioBtns)
*SetPulseBtns (newPulseBtns)
*ButtonNames
*SetOptions (newOptions)
*SetText

urn:micasaverde-com:serviceId:HaDevice1
Reconfigure
StressTest
Remove
Poll
ToggleState
SetPollFrequency (PollingEnabled,PollMinDelay)

Thanks again – this is a great binding and I’m finding it + actions are letting me pretty much do everything I need!

Gerry

[quote=“guessed, post:2, topic:186394”]Multiswitch has no built in defaults in the MiOS Binding, so sending it an [tt]ON[/tt] Command does nothing.

If you work out what the defaults should be, then they can readily be added to the Binding. I don’t use Multiswitch, so it’s arduous to work it out.

The defaults are in [tt]openhab/binding/mios/internal/config/DeviceDefaults.properties[/tt], and typically go hand-in-hand with one or more [tt]OH/configuration/transform/mios*.map[/tt] files that actually turn the values into the required UPnP Action call.[/quote]

I’ve been using mutliswitch a lot. Mainly to put a bunch of buttons into my Vera that I can then use to trigger things in OpenHab. For example, I have 8 different “modes” for my heating and A/C. I use a multiswitch in Vera set as radio buttons. This way I can control them from both UI7 and from HomeWave, which is my preferred iPhone client.

I’ve mapped them like this, and it works fine.

Switch HVACModesMS_Manual "HVACModesMS Manual" (gMultiSwitch) {mios="unit:house,device:142/service/urn:dcineco-com:serviceId:MSwitch1/Status1,command:ON=urn:dcineco-com:serviceId:MSwitch1/SetStatus1(newStatus1=1)|OFF=urn:dcineco-com:serviceId:MSwitch1/SetStatus1(newStatus1=0),in:MAP(miosSwitchIn.map),out:MAP(miosSwitchOut.map)"} Switch HVACModesMS_Auto "HVACModesMS Auto" (gMultiSwitch) {mios="unit:house,device:142/service/urn:dcineco-com:serviceId:MSwitch1/Status2,command:ON=urn:dcineco-com:serviceId:MSwitch1/SetStatus2(newStatus2=1)|OFF=urn:dcineco-com:serviceId:MSwitch1/SetStatus2(newStatus2=0),in:MAP(miosSwitchIn.map),out:MAP(miosSwitchOut.map)"} Switch HVACModesMS_Auto_Heat "HVACModesMS Auto Heat" (gMultiSwitch) {mios="unit:house,device:142/service/urn:dcineco-com:serviceId:MSwitch1/Status3,command:ON=urn:dcineco-com:serviceId:MSwitch1/SetStatus3(newStatus3=1)|OFF=urn:dcineco-com:serviceId:MSwitch1/SetStatus3(newStatus3=0),in:MAP(miosSwitchIn.map),out:MAP(miosSwitchOut.map)"} Switch HVACModesMS_Steady_Heat "HVACModesMS Steady Heat" (gMultiSwitch) {mios="unit:house,device:142/service/urn:dcineco-com:serviceId:MSwitch1/Status4,command:ON=urn:dcineco-com:serviceId:MSwitch1/SetStatus4(newStatus4=1)|OFF=urn:dcineco-com:serviceId:MSwitch1/SetStatus4(newStatus4=0),in:MAP(miosSwitchIn.map),out:MAP(miosSwitchOut.map)"} Switch HVACModesMS_Auto_Cool "HVACModesMS Auto Cool" (gMultiSwitch) {mios="unit:house,device:142/service/urn:dcineco-com:serviceId:MSwitch1/Status5,command:ON=urn:dcineco-com:serviceId:MSwitch1/SetStatus5(newStatus5=1)|OFF=urn:dcineco-com:serviceId:MSwitch1/SetStatus5(newStatus5=0),in:MAP(miosSwitchIn.map),out:MAP(miosSwitchOut.map)"} Switch HVACModesMS_Steady_Cool "HVACModesMS Steady Cool" (gMultiSwitch) {mios="unit:house,device:142/service/urn:dcineco-com:serviceId:MSwitch1/Status6,command:ON=urn:dcineco-com:serviceId:MSwitch1/SetStatus6(newStatus6=1)|OFF=urn:dcineco-com:serviceId:MSwitch1/SetStatus6(newStatus6=0),in:MAP(miosSwitchIn.map),out:MAP(miosSwitchOut.map)"} Switch HVACModesMS_Away_Heat "HVACModesMS Away Heat" (gMultiSwitch) {mios="unit:house,device:142/service/urn:dcineco-com:serviceId:MSwitch1/Status7,command:ON=urn:dcineco-com:serviceId:MSwitch1/SetStatus7(newStatus7=1)|OFF=urn:dcineco-com:serviceId:MSwitch1/SetStatus7(newStatus7=0),in:MAP(miosSwitchIn.map),out:MAP(miosSwitchOut.map)"} Switch HVACModesMS_Away_Cool "HVACModesMS Away Cool" (gMultiSwitch) {mios="unit:house,device:142/service/urn:dcineco-com:serviceId:MSwitch1/Status8,command:ON=urn:dcineco-com:serviceId:MSwitch1/SetStatus8(newStatus8=1)|OFF=urn:dcineco-com:serviceId:MSwitch1/SetStatus8(newStatus8=0),in:MAP(miosSwitchIn.map),out:MAP(miosSwitchOut.map)"}

guessed, I don’t know if that will help you get those into the binding or not. If so, cool. If not, no big deal.

Thanks,

Doug

Thanks Doug, I’ll add it to the todo list!

I had a few moments, so I put in a Pull request against openHAB:
MiOS Item Generator: Add support for MultiSwitch by mrguessed · Pull Request #3440 · openhab/openhab1-addons · GitHub

[quote=“guessed, post:6, topic:186394”]I had a few moments, so I put in a Pull request against openHAB:
https://github.com/openhab/openhab/pull/3440[/quote]

Thanks!

I just left a comment on the pull request regarding the variable names.

Doug