Rollershutter Alexa STOP-Command - please Help

Hello,
I’m on OpenHAB 2.2.0 and I have the following problem. I want to control my Roller blinds. For that I have created the following two items:

Rollershutter WZ_Rollo_01 "WoZi_kleines_Fenster_links" <rollershutter> (gWoZiEG, gEGRollos, gHausRollos) {lcn="[DOWN:myhome:RELAYS.0.13.------11], [UP:myhome:RELAYS.0.13.------10], [STOP:myhome:RELAYS.0.13.------0-]"}
Switch WZ_Rollo_01_Alexa "Wohnzimmer_Rollo_kleines_Fenster" ["Switchable"]

and a corresponding rule:

rule "WZ_Rollo_01_Alexa"
when
    Item WZ_Rollo_01_Alexa received command
then
switch(receivedCommand)
{
    case ON : WZ_Rollo_01.sendCommand(UP)
    case OFF : WZ_Rollo_01.sendCommand(DOWN)
    case STOP : WZ_Rollo_01.sendCommand(STOP)
}
end

That works pretty fine except the “STOP” command. When I say “ALEXA Wohnzimmer_Rollo_kleines_Fenster AN” (remark: "AN"in German = “ON” in English) the blind goes up and when I say “ALEXA Wohnzimmer_Rollo_kleines_Fenster AUS” (remark: “AUS” in German = “OFF” in English) the blind goes down. So everything is fine.
What I also would like to have is the possibility to stop the running blind at any positon by STOP command. Therefore I have also included the STOP command in my rule. But when I say “ALEXA Wohnzimmer_Rollo_kleines_Fenster STOP” nothing happens, The blind does not stop but is moving on.

When I use the OpenHAB console and test the commands, eyerything runs fine and as it should:
smarthome:send WZ_Rollo_01 UP --> blind is moving up
smarthome:send WZ_Rollo_01 STOP --> blind stops at current postion.

The other way around is exactly the same;
smarthome:send WZ_Rollo_01 DOWN --> blind is moving down
smarthome:send WZ_Rollo_01 STOP --> blind stops at current postion.

What am I doing wrong that it does not work by voice command too? I would be very happy if someone could give me guidance how to make the STOP command work by Alexa.

Jens

unfortunately Alexa doesn’t know Rollershutter commands THAT much… :wink:

I have Rollershutters (KNX actuators to be specific), which are defined:

Rollershutter 	Shutter_EG_ges	"Jalousien Wohnzimmer [%d %%]" 	(EG_WoZi, gShuttersEG)	[ "Switchable" ] 	{knx="4/3/0, 4/3/1, 4/3/2+4/3/6", autoupdate="false"}

With that I can tell Alexa three Things:

  • Alexa Jalousien Wohnzimmer AN (will result in DOWN)
  • Alexa Jalousien Wohnzimmer AUS (will result in UP)
  • Alexa Jalousien Wohnzimmer 10% (will result in 10% DOWN)

unfortunately “Alexa Jalousien Wohnzimmer STOP” won’t work, Alexa will tell me, that the device won’t support it.

So, my advice is, expose the “Rollershutter”-item to Alexa directly (no Need for that Proxy item here) and tell Alexa percentages. - If needed, you can have a proxy item, which in a rule will stop the blinds - but you have to have two Alexa items then…

Rollershutter WZ_Rollo_01 “WoZi_kleines_Fenster_links” (gWoZiEG, gEGRollos, gHausRollos) [“Switchable”] {lcn="[DOWN:myhome:RELAYS.0.13.------11], [UP:myhome:RELAYS.0.13.------10], [STOP:myhome:RELAYS.0.13.------0-]"}
Switch WZ_Rollo_01_Alexa “Wohnzimmer_Rollo_kleines_Fenster” [“Switchable”]
rule "WZ_Rollo_01_Alexa"
when
	Item WZ_Rollo_01_Alexa changed to ON
then
	WZ_Rollo_01.sendCommand(STOP)
end

Hello Thomas.
Thank you for your feedback. The proposed direct exposure to Alexa and telling Alexa percentages doesn’t work for me. Maybe that’s a limitation with my actuators (LCN actuators to be specific) or the LCN-Binding respectively, Insofar the 2nd item (proxy) seems to be mandatory for me because it “switches” the commands towards Alexa. That means, my blinds can only be controlled via Alexa with the following combination of 2 items and a rule:

Rollershutter WZ_Rollo_01 “WoZi_kleines_Fenster_links” (gWoZiEG, gEGRollos, gHausRollos) {lcn="[DOWN:myhome:RELAYS.0.13.------11], [UP:myhome:RELAYS.0.13.------10], [STOP:myhome:RELAYS.0.13.------0-]"}
Switch WZ_Rollo_01_Alexa “Wohnzimmer_Rollo_kleines_Fenster” [“Switchable”]

rule "WZ_Rollo_01_Alexa"
when
    Item WZ_Rollo_01_Alexa received command
then
switch(receivedCommand) {
    case ON : WZ_Rollo_01.sendCommand(UP)
    case OFF : WZ_Rollo_01.sendCommand(DOWN
}
end

How do I have to include the STOP-rule you proposed? When I directly copy it into my .rules file together with the already existing rule then the voice-command to move the blind UP doesn’t work anymore…

Jens

Ok. First of all a switch only has two states (ON/OFF). There’s no STOP here. Unfortunately the LNC binding won’t translate Alexa’s command into LNC commands. (The KNX binding obviously does).
So I also don’t see at first sight a functionality in LNC for percentages, so you have to decide:

  1. one (proxy) Rollershutter item, which you expose to Alexa. Obviously you can use “An”, “Aus” and then I would add the “50%” - so you’ll only have to remember one item name. In a rule you then map Alexa’s commands into LNC and move your blinds accordingly: AN: DOWN, AUS: UP and 50%: DOWN XX seconds, then STOP
  2. You define two proxy switch items, one for up/down (as you have already), one for STOP. Downside: you’ll have to remember to names. But: you have more than one state in between

I can help you, if you decided for one option

OK, then I would prefer option1. Would be really great if you could help me. :+1:Looking forward to hearing from you :grinning:

Kind regards,
Jens

no Problem.
first a bit of Prosa:

  1. Proxy item means it’s a empty one (like you already did with your “WZ_Rollo_01_Alexa” item)
  2. we use that item for Alexa and I’ll keep its name
  3. we track, what Alexa gives us back and use that in a rule to trigger the “real” LNC-item

so, ready? go:

Rollershutter WZ_Rollo_01 “WoZi_kleines_Fenster_links” (gWoZiEG, gEGRollos, gHausRollos) {lcn="[DOWN:myhome:RELAYS.0.13.------11], [UP:myhome:RELAYS.0.13.------10], [STOP:myhome:RELAYS.0.13.------0-]"}
Rollershutter WZ_Rollo_01_Alexa “Wohnzimmer_Rollo_kleines_Fenster” [“Switchable”]

(perhaps you have to reset Alexa smarthome devices, I’m not sure, how she will react with a different item-type, but try rescanning - could work)

rule "WZ_Rollo_01_Alexa"
when
	Item WZ_Rollo_01_Alexa received command
then
	logInfo("Rollo Alexa", "Alexa command: " + receivedCommand) // you'll need this for comparison
	switch(receivedCommand) {
		case 0: WZ_Rollo_01.sendCommand(UP)
		case 100: WZ_Rollo_01.sendCommand(DOWN)
		case 50: {
			WZ_Rollo_01.sendCommand(DOWN)
			timer = createTimer(now.plusSeconds(20), [|
				logInfo("Rollo Alexa", "Timer expired and Rollo set to STOP")
				WZ_Rollo_01.sendCommand(STOP)
			])
	}
end

That’s it. Perhaps you have to play around with the “receivedCommand” a bit. I think, Alexa gets “50” back (at least that’s in my KNX Environment - but then again, I get 0 and 100 for ON and OFF)
And also you have to change the time-settings accordingly.
and as a bonus: if you like, you can of course add more than one position, let’s say 30% and 80%…?

1 Like

Hello Thomas,

Thank you very much. I will give it a try and will give feedback. Question: will the Stop command work in both directions i.e. the blind will stop while it is moving down and also when it is moving up or will it work only if the blind is moving down?

Jens

Hi Thomas,

unfortunately it doesn’t work. The blinds do not move at all. What can we do next?

Remark: Problem solved, there was a missing “}” at ‘end’.

Hi Thomas,

have tested it right now. It works quite good, but only in the downward direction. Can we implement it also for the upward direction accordingly? That would be perfect.
Thank you very much so far!!!

You mean, you would like to have your blinds set to “50%” even though they’re > 50%?
Do you get the position of your blinds from the LNC binding?

if not, we could do it, but if you manually move your blinds (meaning without openHAB - with physical switches), it won’t work. So, getting the actual position is somewhat crucial. or - if you don’t mind for some delays, you could always first bring your blinds up to Position 0 - and then move them down again:

rule "WZ_Rollo_01_Alexa"
when
	Item WZ_Rollo_01_Alexa received command
then
	logInfo("Rollo Alexa", "Alexa command: " + receivedCommand) // you'll need this for comparison
	switch(receivedCommand) {
		case 0: WZ_Rollo_01.sendCommand(UP)
		case 100: WZ_Rollo_01.sendCommand(DOWN)
		case 50: {
			WZ_Rollo_01.sendCommand(UP)
			timer = createTimer(now.plusSeconds(40), [|
				logInfo("Rollo Alexa", "Blinds brought up everytime")
				WZ_Rollo_01.sendCommand(DOWN)
				timer = createTimer(now.plusSeconds(20), [|
					logInfo("Rollo Alexa", "Timer expired and Rollo set to STOP")
					WZ_Rollo_01.sendCommand(STOP)
				])
			])
	}
end

or (but this is, if you only use your blinds with openHAB and never with physical switches), you use the actual state of “WZ_ROLLO_01”, so depending on that, we’ll bring it up or down - (and we assume, the time for UP and DOWN until 50% is also equal).

rule "WZ_Rollo_01_Alexa"
when
	Item WZ_Rollo_01_Alexa received command
then
	logInfo("Rollo Alexa", "Alexa command: " + receivedCommand) // you'll need this for comparison
	switch(receivedCommand) {
		case 0: WZ_Rollo_01.sendCommand(UP)
		case 100: WZ_Rollo_01.sendCommand(DOWN)
		case 50: {
			if (WZ_Rollo_01.state == DOWN) {
				// if Rollo down - bring it UP
				WZ_Rollo_01.sendCommand(UP)
			} else {
				// if Rollo up - bring it DOWN
				WZ_Rollo_01.sendCommand(DOWN)
			}
			timer = createTimer(now.plusSeconds(20), [|
				logInfo("Rollo Alexa", "Timer expired and Rollo set to STOP")
				WZ_Rollo_01.sendCommand(STOP)
			])
	}
end

Hallo Thomas,

vielen Dank für die Antwort. Evtl. können wir auch in Deutsch kommunizieren, dann wird das Ganze etwas einfacher mit dem Erklären :slight_smile: Was ich gerne hätte, ist folgendes.
Wenn der Rollladen runter fährt, will ich ihn an jeder beliebigen Stelle stoppen können und wenn er hoch fährt genau so auch einfach an jeder beliebigen Position stoppen können. Die Möglichkeit, eine bestimmte Position gleich von vornherein gezielt anfahren zu können, benötige ich (zumindest erst einmal) nicht.
Lässt sich das so umsetzen?

VG, Jens

binderth Thomas Binder
February 5
You mean, you would like to have your blinds set to “50%” even though they’re > 50%?
Do you get the position of your blinds from the LNC binding?

if not, we could do it, but if you manually move your blinds (meaning without openHAB - with physical switches), it won’t work. So, getting the actual position is somewhat crucial. or - if you don’t mind for some delays, you could always first bring your blinds up to Position 0 - and then move them down again:

> rule "WZ_Rollo_01_Alexa" when Item WZ_Rollo_01_Alexa received command then logInfo("Rollo Alexa", "Alexa command: " + receivedCommand) // you'll need this for comparison switch(receivedCommand) { case 0: WZ_Rollo_01.sendCommand(UP) case 100: WZ_Rollo_01.sendCommand(DOWN) case 50: { WZ_Rollo_01.sendCommand(UP) timer = createTimer(now.plusSeconds(40), [| logInfo("Rollo Alexa", "Blinds brought up everytime") WZ_Rollo_01.sendCommand(DOWN) timer = createTimer(now.plusSeconds(20), [| logInfo("Rollo Alexa", "Timer expired and Rollo set to STOP") WZ_Rollo_01.sendCommand(STOP) ]) ]) } end

or (but this is, if you only use your blinds with openHAB and never with physical switches), you use the actual state of “WZ_ROLLO_01”, so depending on that, we’ll bring it up or down - (and we assume, the time for UP and DOWN until 50% is also equal).

> rule "WZ_Rollo_01_Alexa" when Item WZ_Rollo_01_Alexa received command then logInfo("Rollo Alexa", "Alexa command: " + receivedCommand) // you'll need this for comparison switch(receivedCommand) { case 0: WZ_Rollo_01.sendCommand(UP) case 100: WZ_Rollo_01.sendCommand(DOWN) case 50: { if (WZ_Rollo_01.state == DOWN) { // if Rollo down - bring it UP WZ_Rollo_01.sendCommand(UP) } else { // if Rollo up - bring it DOWN WZ_Rollo_01.sendCommand(DOWN) } timer = createTimer(now.plusSeconds(20), [| logInfo("Rollo Alexa", "Timer expired and Rollo set to STOP") WZ_Rollo_01.sendCommand(STOP) ]) } end

Visit Topic or reply to this email to respond.


In Reply To

jensilein Jens
February 4
Hi Thomas, have tested it right now. It works quite good, but only in the downward direction. Can we implement it also for the upward direction accordingly? That would be perfect. Thank you very much so far!!!


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

-------- Originalnachricht --------

english is the language of choice in the forum and it’s international here, so everyone can follow the discussion and contributing or learning from it.

yesterday we talked about two ways: for having the ability to tell your blinds to go UP, DOWN and STOP in Alexa in conjunction with your LNC Binding, you’ll need two Alexa items. (that was possibility 2. in Rollershutter Alexa STOP-Command - please Help)

so, for this it’s that config:

  • your Rollershutter item for LNC binding (not exposed to Alexa)
  • one item for UP and DOWN (exposed to Alexa)
  • one item for STOP (exposed to Alexa)
    the expire 1s is optional and reverts the state to OFF after 1s (you have to install expire-binding for it)
Rollershutter WZ_Rollo_01 "WoZi_kleines_Fenster_links" (gWoZiEG, gEGRollos, gHausRollos) {lcn="[DOWN:myhome:RELAYS.0.13.------11], [UP:myhome:RELAYS.0.13.------10], [STOP:myhome:RELAYS.0.13.------0-]"}
Switch WZ_Rollo_01_AlexaUPDOWN "Wohnzimmer_Rollo_kleines_Fenster hoch runter" ["Switchable"]
Switch WZ_Rollo_01_AlexaSTOP "Wohnzimmer_Rollo_kleines_Fenster stop" ["Switchable"] { expire="1s,command=OFF"}
rule "WZ_Rollo_01_Alexa UP/DOWN"
when
	Item WZ_Rollo_01_AlexaUPDOWN received command
then
	logInfo("Rollo Alexa", "Alexa command: " + receivedCommand)
	switch(receivedCommand) {
		case ON: WZ_Rollo_01.sendCommand(UP)
		case OFF: WZ_Rollo_01.sendCommand(DOWN)
	}
end

rule "WZ_Rollo_01_Alexa STOP"
when
	Item WZ_Rollo_01_AlexaSTOP changed to ON
then
	logInfo("Rollo Alexa", "Alexa command: STOP")
	case OFF: WZ_Rollo_01.sendCommand(STOP)
end

you’ll have to Change the names of the two Alexa items accordingly as you have to remember them! :wink:

Hi Thomas,

Thank you for your excellent help. I will try it and give you feedback if it works. Last question; what voice command do I have to tell Alexa to stop the blind?
ALEXA “Wohnzimmer_Rollo_kleines_Fenster stop” AN?

1 Like

yes: Item WZ_Rollo_01_AlexaSTOP changed to ON
now, please learn from the given examples - that’s the basics of openHAB - items and rules…

I’m very eager to learn! But unfortunately I cannot get it to work. Please find below the extract from openhab.log Obviously there is something wrong with the “WZ_Rollo_01_Alexa STOP” rule? The “WZ_Rollo_01_Alexa UP/DOWN” rule works as it should… But when I copy the “WZ_Rollo_01_Alexa STOP” rule into my .rules file nothing works anymore and the following entry appears in openhab.log:

2018-02-05 21:56:57.925 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'meine.rules'
2018-02-05 21:56:57.942 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'meine.rules' is either empty or cannot be parsed correctly!
2018-02-05 21:56:58.023 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'meine.rules' has errors, therefore ignoring it: [38,2]: mismatched input 'case' expecting 'end'

I’m very eager to learn! But unfortunately I cannot get it to work.
Please find below the extract from openhab.log Obviously there is
something wrong with the “WZ_Rollo_01_Alexa STOP” rule? The
“WZ_Rollo_01_Alexa UP/DOWN” rule works as it should… But when I copy
the “WZ_Rollo_01_Alexa STOP” rule into my .rules file nothing works
anymore and the following entry appears in openhab.log:

2018-02-05 21:56:57.925 [INFO ] [el.core.internal.ModelRepositoryImpl] - 
Refreshing model 'meine.rules'
2018-02-05 21:56:57.942 [WARN ] [el.core.internal.ModelRepositoryImpl] - 
Configuration model 'meine.rules' is either empty or cannot be parsed 
correctly!
2018-02-05 21:56:58.023 [WARN ] [el.core.internal.ModelRepositoryImpl] - 
Configuration model 'meine.rules' has errors, therefore ignoring it: 
[38,2]: mismatched input 'case' expecting 'end'

Hello Thomas, I finally reached the goal :slight_smile: Now everything works as planned. I’m very happy!
Obviously the problem was the keyword “stop” in the “item name”:
Switch WZ_Rollo_01_AlexaSTOP “Wohnzimmer_Rollo_kleines_Fenster stop” [“Switchable”] { expire=“1s,command=OFF”}
That “stop” word “confused” Alexa, so I replaced it by “halt”. The 2nd change I did was a modification of the Alexa-Stop rule as follows (I deleted the “case” phrase here):

rule "WZ_Rollo_01_Alexa STOP"
when
	Item WZ_Rollo_01_AlexaSTOP changed to ON
then
	logInfo("Rollo Alexa", "Alexa command: STOP")
	WZ_Rollo_01.sendCommand(STOP)
end

Once again Thank you very much for your excellent help and your patience.

Hi Thomas,
I finally reached the goal :slight_smile: Now everything works as planned. I’m very
happy!

Obviously the problem was the keyword “stop” in the “item name”:

Switch WZ_Rollo_01_AlexaSTOP “Wohnzimmer_Rollo_kleines_Fenster stop” 
[“Switchable”] { expire=“1s,command=OFF”}

That “stop” word “confused” Alexa, so I replaced it by “halt”. The 2nd
change I did was a modification of the Alexa-Stop rule as follows (I
deleted the “case” phrase here):

rule "WZ_Rollo_01_Alexa STOP"
when
Item WZ_Rollo_01_AlexaSTOP changed to ON
then
logInfo(“Rollo Alexa”, “Alexa command: STOP”)
WZ_Rollo_01.sendCommand(STOP)
end

Once again Thank you very much for your excellent help and your patience
with me, the OpenHAB Newbie :wink:

Jens

1 Like

Glad it worked out in the end!

Hello Thomas, with your help I’m now able to move all blinds individually and that works very well so far.
The next step I want to realize is to move all blinds at once. I think the solution for that is the “Group”, correct? What I have done right now is:

I have defined two following items:

Group:Rollershutter:OR(ON,OFF) Rollos_EG "Alle Rollos im EG [(%)]" (gEGRollos)
Rollershutter EG_Alle_Rollos_Alexa "Rollos EG" ["Switchable"]

… and the following rule:

rule "Alle_Rollos_EG"
when
	Item EG_Alle_Rollos_Alexa received command
then
	var Timer timer = null
	logInfo("Rollo Alexa", "Alexa command: " + receivedCommand) // you'll need this for comparison
	switch(receivedCommand) 
	{
		case 0: Rollos_EG.sendCommand(UP)
		case 100: Rollos_EG.sendCommand(DOWN)
		case 50: 
		{
			Rollos_EG.sendCommand(DOWN)
			timer = createTimer(now.plusSeconds(1), [|
				logInfo("Rollo Alexa", "Timer expired and Rollo set to STOP")
				Rollos_EG.sendCommand(STOP)
			])
		}
	}
end

Unfortunately that doesn’t work. In the openhab.log the following message appears:

2018-02-11 20:33:31.418 [WARN ] [arthome.core.items.dto.ItemDTOMapper] - State 'ON' is not valid for a group item with base type 'Rollershutter'
2018-02-11 20:33:31.418 [ERROR] [arthome.core.items.dto.ItemDTOMapper] - Group function 'OR' requires two arguments. Using Equality instead.
2018-02-11 20:33:31.499 [WARN ] [arthome.core.items.dto.ItemDTOMapper] - State 'ON' is not valid for a group item with base type 'Rollershutter'
2018-02-11 20:33:31.500 [ERROR] [arthome.core.items.dto.ItemDTOMapper] - Group function 'OR' requires two arguments. Using Equality instead.
2018-02-11 20:34:34.458 [INFO ] [e.smarthome.model.script.Rollo Alexa] - Alexa command: 100

What am I doing wrong here and what can I do to make the Group-function work for my blinds?