Rolling Shutters commanded by relays card plugin

Attached is the windows covering Imp files designed to work with the attached windows covering dev file.

This is designed to work with an IPX800v3 ([url=http://www.gce-electronics.com/fr/57-ipx800-v3.html]http://www.gce-electronics.com/fr/57-ipx800-v3.html[/url]) or similar relay webserver.
Modify I_ files with IPX800’s IP address.

Upload all the files to Vera through Mios Developers > Luup Files.
Check the box to restart luup after upload. Then, add a new device through Mios Developers > Create Device.

Under Description, name your new device.

Under UpnpDevFilename, enter D_WindowCovering1ipx.xml

Under UpnpImplFilename, enter I_WindowCovering1VR1.xml if you want to command your shutter 1. Use the first relay to command ON/OFF and the second to up/down

then click Create device. Save, then power cycle vera, and your rolling shutter device should now work like any other windows covering.
D_ & I_ files is the French user. But, easily, replace “OUVRIR” by “OPEN”, “FERMER” by “CLOSE”, “HAUT” by “UP”, “BAS” by “DOWN” and “STOP” by “STOP” :slight_smile:

It’s very WAF and works great. (Dimmer is disable)
Click on HAUT/UP or OUVRIR/OPEN to open your shutter
Click on BAS/DOWN or FERMER/CLOSE to close your shutter
Click on STOP/STOP to stop the shutter.

I have a few issues before saying “Work very fine!”

a) I want to animate the highlighting for OPEN & CLOSE buttons. The animation is in function to dimmer I think.
How can I use it?

b) I don’t understand the difference with Vera Mobile application (iOS). There is a switch & dimmer to command the shutter. How is animated this switch?

thank you for your help.

Hi,

I have an issue with my shutter’s command.

Since I have added my new virtual device for commanding my shutters by relays card, I can’t saving my scene’s changes.

If I want to change a setting (for example, want to move up instead of move down), Vera doesn’t save this settings.
Maybe the change has been saved but don’t appear in the graphical screen…

Do you have an idea?

thank you.

Hi,

This appears to be an UI issue. I wonder how it hasn’t been noticed until now. I notified the UI developers about this.

The workaround is to go to Advanced (in the scene editor) and remove the extra actions from there.

[quote]I wonder how it hasn’t been noticed until now.

Because it worked fine before…
Whenever, it work fine with lights… But not with window covering.

The workaround is to go to [b]Advanced[/b] (in the scene editor) and remove the extra actions from there.

I go to test this.

In Advanced setting, I have :

look attached file

obv, there is too many actions no?

Yes, every time you press one of the Up/Down/Stop buttons the command gets added to the list of commands. This is a bug, and we’re investigating why this happens right now.

Hi, thank you for your help ^^

Now, my scene works but the graphical display is always bad for my shutters commanded by relay card.

Look the attached file

In this scene, VR Cuisine & VR Salon are on UP but that’s not appear.

That’s maybe my Dev & Imp files where are a problem? D & I files can bug MiOS scenes display?

This is caused by the bug I told you about earlier. It’s not caused by your device file.

OK so I notice this problem appears only with windows covering devices.

Hi,

I’ve opened a post here :

[URL=http://forum.micasaverde.com/index.php/topic,10718.0.html]http://forum.micasaverde.com/index.php/topic,10718.0.html[/url]

In fact, I would to animate buttons of windowscovering graphic.

Button “OPEN” or “CLOSE” or “UP”… don’t be animated. If I click on, no animation but the command is gone.

My question :

How can I write a “status” for these buttons?

So, I would have button OPEN highlighted if my last click was OPEN.

Thank you so much

[quote=“fatal25, post:10, topic:171514”]How can I write a “status” for these buttons?

So, I would have button OPEN highlighted if my last click was OPEN.[/quote]

You need a variable that holds the last pressed button. Here is how the Display tags of the Away and Stay buttons of an alarm panel plugin look like. The Away button is highlighted when the value of the DetailedArmMode variable is “Armed”, and the Stay button is highlighted when the value of the DetailedArmMode variable is “Stay”.

"Display": {
	"Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
	"Variable": "DetailedArmMode",
	"Value": "Armed",
	"Top": 100,
	"Left": 200,
	"Width": 70,
	"Height": 20
}
"Display": {
	"Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
	"Variable": "DetailedArmMode",
	"Value": "Stay",
	"Top": 100,
	"Left": 280,
	"Width": 70,
	"Height": 20
}

Thx. That’s work :slight_smile:

Now, I try to compare 2 tonumber. When I do it in I_ file (job section), pop up says me “Device not ready”

[code]local positionOld = tonumber (luup.variable_get (“urn:upnp-org:serviceId:Dimming1”, “LoadLevelTarget”, lul_device), 10)
luup.variable_set (“urn:upnp-org:serviceId:Dimming1”, “LoadLevelTarget”, lul_settings.newLoadlevelTarget, lul_device)
local positionNew = tonumber (luup.variable_get (“urn:upnp-org:serviceId:Dimming1”, “LoadLevelTarget”, lul_device), 10)
if (positionOld < positionNew) then
luup.inet.wget (IP_cde_mont)
luup.inet.wget (IP_cde_marche)
else
luup.inet.wget (IP_cde_desc)
luup.inet.wget (IP_cde_marche)
end

            luup.variable_set ("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", lul_settings.newLoadlevelTarget, lul_device)


			return 4, 5

[/code]

This code works :

[code]
luup.variable_set (“urn:upnp-org:serviceId:Dimming1”, “LoadLevelTarget”, lul_settings.newLoadlevelTarget, lul_device)

							if (tonumber (lul_settings.newLoadlevelTarget, 10) == 0 or tonumber (lul_settings.newLoadlevelTarget, 10) == 1 or tonumber (lul_settings.newLoadlevelTarget, 10) == 2) then
								luup.inet.wget (IP_cde_desc) 
								luup.inet.wget (IP_cde_marche)
								luup.variable_set ("urn:upnp-org:serviceId:Dimming1", "LoadLevelTarget", "0", lul_device)
								luup.variable_set ("urn:upnp-org:serviceId:SwitchPower1", "Status", "0", lul_device)
							else
								luup.inet.wget (IP_cde_mont) 
								luup.inet.wget (IP_cde_marche)
								luup.variable_set ("urn:upnp-org:serviceId:SwitchPower1", "Status", "1", lul_device)
							end
							
							
            luup.variable_set ("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", lul_settings.newLoadlevelTarget, lul_device)


			return 4, 5[/code]

I don’t understand why I can’t use “<” with tonumber.

Where is my error here pls?

In an XML file, < needs to be written as <

Edit by mcvflorin: replaced & with <

something like this?

if (positionOld &lt; positionNew) then
									luup.inet.wget (IP_cde_mont) 
									luup.inet.wget (IP_cde_marche)    
  else
  									luup.inet.wget (IP_cde_desc) 
									luup.inet.wget (IP_cde_marche)
  end

That doesn’t work. Maybe I have another problem…

Oops, typing too fast, yes I meant that < should be escaped as <

I will look at the rest shortly to see if all the parens match etc. any error here will make the plugin ‘not ready’ and errors occur down the line. The details of those errors are usually logged in the LuaUPnP.log file

Actually ‘<’ must be written as < and ‘&’ as &. You can leave ‘>’ as it is. Your code would look like this:

if (positionOld &lt; positionNew) then
    luup.inet.wget (IP_cde_mont) 
    luup.inet.wget (IP_cde_marche)    
else
    luup.inet.wget (IP_cde_desc) 
    luup.inet.wget (IP_cde_marche)
end

Yeah, I change my post before you :slight_smile:

I’ve tried < and >

I think I have another error(s)

thanks for your help

Also note that [tt]luup.variable_get(…)[/tt] returns [tt]value,timestamp[/tt] so you can’t just put it into [tt]tonumber(…)[/tt]

this is why all the sample code effectively does something like:

[tt] local foo = luup.variable_get(…)
foo = tonumber(foo)
[/tt]

[quote=“guessed, post:18, topic:171514”]Also note that [tt]luup.variable_get(…)[/tt] returns [tt]value,timestamp[/tt] so you can’t just put it into [tt]tonumber(…)[/tt]

this is why all the sample code effectively does something like:

[tt] local foo = luup.variable_get(…)
foo = tonumber(foo)
[/tt][/quote]

Thx Guessed but it’s not enough ^^

<job>
			positionOld = luup.variable_get ("urn:upnp-org:serviceId:Dimming1", "LoadLevelTarget", lul_device, 10)
			positionOld = tonumber (positionOld)
			luup.variable_set ("urn:upnp-org:serviceId:Dimming1", "LoadLevelTarget", lul_settings.newLoadlevelTarget, lul_device)
			positionNew = luup.variable_get ("urn:upnp-org:serviceId:Dimming1", "LoadLevelTarget", lul_device, 10)
			positionNew = tonumber (positionNew)
			
				if (positionOld &lt; positionNew) then
					luup.inet.wget (IP_cde_mont) 
					luup.inet.wget (IP_cde_marche)    
				else
					luup.inet.wget (IP_cde_desc) 
					luup.inet.wget (IP_cde_marche)
				end
									
	            luup.variable_set ("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", lul_settings.newLoadlevelTarget, lul_device)

				return 4, 5
			</job>

this code doen’t work, we are OK.

Your code local foo = luup.variable_get(...) foo = tonumber(foo)
is good. I can use < on tonumber now

But not on variable_get yet

this code doen't work, we are OK.
I'm a little confused, it is working or not-working?

My comment above was in relation to [tt]luup.variable_get(…)[/tt] returning multiple values ([tt], [/tt]). As a result of this, you cannot [ever] just slap a multi-input function (like [tt]tonumber(, )[/tt] because you won’t get the experience you’re looking for.

It looks like you’ve included this into your code now, but I can’t see what other problems you’re having. Can you post the full [tt]I_xxx.xml[/tt] and [tt]D_xxx.xml[/tt] files (as attachments) as it might be easier to review them in that form.