rule "Set value"
when
Member of SunBlinds received command
then
var command = receivedCommand
var item = triggeringItem
switch command {
case UP: {
item.postUpdate(new PercentType(0) as Number)
}
case DOWN: {
item.postUpdate(new PercentType(100) as Number)
}
case STOP: {
item.postUpdate(new PercentType(50) as Number)
}
}
end
This requires that the blinds are in the SunBlinds group, but can be altered to work with individual items as well.
Iâve been thinking about doing something like this as well, and i could certainly be done (with some margin of error). But IMO it costs more in terms of work than itâs worth. Where it gets most problematic is a case where you first set the blinds to 30% (down â wait 15 * 0.3 seconds â stop), then you want to change to 50% (down â wait 15 * (0.5 - 0.3) seconds â stop) etc. It would probably get out of sync eventually. Not to mention i someone uses the remote to set it to ~90%, then you want to change to 60%, but OH still thinks itâs at 50%.
If you only want to be able to see the percentage based on the moving time it might be easier (down â count time â stop â calculate percentage), but wonât work with the âmyâ-button (since OH only sees a stop command and then nothing more). And, again IMO, quite a lot of work for something I donât need to know that accurately anyway. YMMV of course.
Yes. You can periodically ârecalibrateâ by listening for commands and running a timer for just over max run time. If a STOP is issued by rule or UI, cancel the timer. Otherwise if the timer expires, you know the shutter must at the end of travel, and reset your position estimate to 0/100% as appropriate.
Thanks for the rule.
Yeah probably would be a lot of work, and have to hide the remotes from the wife and kids
Mine already returns 0 for up and 100 for down, just have to set the MY one.
Hi! Iâve been running my RFXtrx433XL on 433.92 MHz for quite a while now but now Iâd like to control a few 433.42 MHz Somfy devices as well. Is this possible with just one RFXtrx433XL?
I tried to define a second bridge (using the same serialPort) and passing both bridges their respective setMode values, hoping that they âautomagicallyâ switch between the two transceivers when a command is to be sent using one of them. That didnât really work out, presumably because setMode is being issued only once during bridge initialization and/or the serial port is being locked by the (first) bridge using itâŠ?
Is there any way I can make this happen, i.e. switch between the transceivers (e.g. via setMode) dynamically somehow?
I donât have an RFXtrx433XL myself, but what you want to do should be possible. I do think however, that you should be using only one bridge. The RFXtrx433XL will then automatically use the correct frequency depending on whether it needs to control a Somfy device or something else.
Are you able to control you Somfy devices using the RFXmngr program from RFXCOM? If not, then first make sure that you can control them using the RFXmngr before trying with openHAB.
Also, if you can control all your devices with the RFXmngr program then you donât need to use the setMode option.
I did part of this a while ago and canât remember the details. However you have to pair both somfy devices with the RFXtrx like decribed in the manual (i did this using the windows RFXmngr like Like marcel_erkel wrote). Use different ID/Unit Code. You will get different rfu codes for both.
I donât remember what i did in openHAB then and removed the item file some time ago.<\grrr>
Thanks guys, it does indeed work with a single bridge and without using setMode, nice! The two mistakes I made earlier were:
I missed to change the Rollershutter itemâs channel type from command to shutter, so things didnât work right away (despite everything working in RFXmngr).
Next I let RFXmngr trick me into thinking that the frequency/transceiver selection is mandatory, because of its frequency drop down menu that seemed to require some kind of confirmation before being effective. Thatâs when the idea for the second bridge and setMode was bornâŠ
Now (after fixing the channel type) it all works as expected!
One final related question: is there a way to have a state-bearing group item for a group of Rollershutter items in Basic UI? Iâd like to control said group of shutters as a whole and it works just fine using HABPanel. Yet I canât get that to work with a sitemap: Basic UI always just shows a normal group element, leading to a sub-view with the groupâs individual items and without the (default) Rollershutter controls on the group itself.
Hm, thatâs not the needed UX as a switch is an ON/OFF state control. The Rollershutter default control (for a single shutter) provides UP, DOWN and STOP buttons (stateless) per shutter. The group should be controlled in the same way, like HABPanel does it.
Never said that. I was talking about the Default control/widget for Rollershutter items.
When you use a Switch widget with a Rollershutter type Item, you get UP-DOWN. I think this maybe something you should try out, rather than insist that it doesnât work.
That is indeed correct, but all but intuitive. Anyway, this is the answer to my remaining question, so thanks a bunch for your patience
If your group is of a type Rollershutter then put it on the sitemap with Default type:
Default item=myRollerGroup
It should render the rollershutter controls (up down and stop)
This is what I had tried intuitively and what didnât work out. Thus, if others are looking for a solution to that problem: use a switch for that shutter group (see previous post)âŠ
Iâm pleased that it actually works! To spell it out âŠ
sitemap widget Switch item=myGroup ...
is smart enough to recognise Item Group:Rollershutter myGroup "blah" ...
as a Rollershutter âflavouredâ Item, and so the widget performs the special UP-DOWN version of its button rendering.
Sure, understood. Itâs pedantic but there is no actual Default widget, itâs just an instruction to look at the Item type and auto-choose the appropriate widget for it.
In the case of Rollershutter type Item, thatâs Switch widget.
In the case of Group Item, thatâs Group pop-up widget.