UI7 Plugin Migration

[quote=“lolodomo, post:19, topic:182574”]Hi Rex

Can you please run this code with UI7 and give me the result ?

local url = require("socket.url") local str = "one two" luup.log(str .. " -> " .. url.escape(str))

The result in UI5 is:

luup_log:0: one two -> one%20two 

Any idea if lua version has changed ?[/quote]

I got this:

50 08/23/14 10:17:15.600 luup_log:0: one two -> one%20two <0x2d760680>

print(_VERSION) still reports 5.1

Interesting discovery. Is it working even with a JS tab ?

I tried that and it broke the whole UI for the device.

I have now discovered that this is not really an optional feature. If you don’t have one of your tabs flagged as top_navigation_tab, you don’t get the ability to change the device name and room assignment (other than through the Advanced tab). When used on the top tab, Input fields do not get sent as arguments with the action. The top_tab also has to be the one that contains the controls displayed on the front tile so using a dummy tab does not work.

My current workaround is to add a new tab called Top which contains the controls used on the front tile. I keep all the controls on the old Control tab but remove the ControlGroup and SceneGroup entries. Not ideal but it does work.

The old directory still exist ? If not, will it be created when installing from the store ?

The old directory is the parent of the new one so it will exist. It still has some files in it.

[quote=“RexBeckett, post:22, topic:182574”]

Interesting discovery.
Is it working even with a JS tab ?

I tried that and it broke the whole UI for the device.[/quote]

No chance.

I have now discovered that this is not really an optional feature. If you don't have one of your tabs flagged as [b]top_navigation_tab[/b], you don't get the ability to change the device name and room assignment (other than through the Advanced tab). When used on the top tab, Input fields do not get sent as arguments with the action. The top_tab also has to be the one that contains the controls displayed on the front tile so using a dummy tab does not work.

So it is almost the same contraint as with UI5 except that this flash mandatory tab can be not only the first one in the list ?

In UI5 there is a big bug as soon as you define several flash tabs. Some fields are not displayed or not at the right place in the second and next tabs. Do you know if it has been fixed ? Due to this bug, now I don’t use flash tab anymore…

My current workaround is to add a new tab called [b]Top[/b] which contains the controls used on the front tile. I keep all the controls on the old [b]Control[/b] tab but remove the [b]ControlGroup[/b] and [b]SceneGroup[/b] entries. Not ideal but it does work.

Why not just adding the flag “top_navigation_tab” on your old Control tab ?

[quote=“RexBeckett, post:21, topic:182574”][quote=“lolodomo, post:19, topic:182574”]Hi Rex

Can you please run this code with UI7 and give me the result ?

local url = require("socket.url") local str = "one two" luup.log(str .. " -> " .. url.escape(str))

The result in UI5 is:

luup_log:0: one two -> one%20two 

Any idea if lua version has changed ?[/quote]

I got this:

50 08/23/14 10:17:15.600 luup_log:0: one two -> one%20two <0x2d760680>

print(_VERSION) still reports 5.1[/quote]

Ok, thank you. So the problem reported by HaPe is elsewhere.

The field value “One two” is somewhere converted to “One+two”. The value I got from the ftext area is apparently ok in JavaScript. url.escape is ok in lua. So it would be the transmit of the parameter through Ajax.Request in JavaScript to the UPnP action that would be different ?

In UI5 there is a big bug as soon as you define several flash tabs. Some fields are not displayed or not at the right place in the second and next tabs. Do you know if it has been fixed ? Due to this bug, now I don't use flash tab anymore...

Yes I’ve seen that in UI5. I’m not certain that it is fixed in UI7 but I have two flash tabs working OK.

Why not just adding the flag "top_navigation_tab" on your old Control tab ?

Because then the Input controls don’t work. No value is sent with the button action. If you are not using flash Input controls, you should be OK dong this.

The field value "One two" is somewhere converted to "One+two". The value I got from the ftext area is apparently ok in JavaScript. url.escape is ok in lua. So it would be the transmit of the parameter through Ajax.Request in JavaScript to the UPnP action that would be different ?

I had a similar problem with LuaTest on UI5. When I sent a textarea from a form, js converted all the spaces to +. That was a problem because the plus sign is quite common in Lua code…

I solved it by using an onsubmit function in js that replaced all + signs with %1F. When I receive the request in the Vera handler, I replace all + characters with a space and then all %1F characters with a plus. Sometimes you have to do odd things to get through the minefield. ;D

I just “played” with HaPe’s Vera and UI7 interface.
There are few major (blocking) bugs in UI7 like Location and Serial port configuration pages displaying a blank page !
Without the reload button, it is hard to work. I have to search again the lua code to force a reload…

I will add the flag top_navigation_tab as I can see, as you mention, that there is not the fields to update name and room.

I have a big difficulty for changing variables in the advanced tab. When I set a variable and then leave the filed, a text is displayed in front of the field telling me that the value change is sent. Then I push Back button and enter again in the advanced tab. The value is not changed ! Shall I clear the WEB browser cache after setting my variable ?

In my JavaScript tabs, it looks like few buttons are not triggering the corresponding UPnP action. Strange as it works for few of them.

[quote=“RexBeckett, post:26, topic:182574”]

The field value “One two” is somewhere converted to “One+two”. The value I got from the ftext area is apparently ok in JavaScript. url.escape is ok in lua. So it would be the transmit of the parameter through Ajax.Request in JavaScript to the UPnP action that would be different ?

I had a similar problem with LuaTest on UI5. When I sent a textarea from a form, js converted all the spaces to +. That was a problem because the plus sign is quite common in Lua code…

I solved it by using an onsubmit function in js that replaced all + signs with %1F. When I receive the request in the Vera handler, I replace all + characters with a space and then all %1F characters with a plus. Sometimes you have to do odd things to get through the minefield. ;D[/quote]

But if I set in a label the value I extract from the text area, there is no + inside, the text looks good. Does it make sense for you ?
Plus I have no problem with the same code in UI5. I have no + replacing space.

Without the reload button, it is hard to work.

There is a Reload button. It is under Apps → Develop Apps → Serial Port configuration. Just where you would expect to find it…

I have a big difficulty for changing variables in the advanced tab. When I set a variable and then leave the filed, a text is displayed in front of the field telling me that the value change is sent. Then I push Back button and enter again in the advanced tab. The value is not changed ! Shall I clear the WEB browser cache after setting my variable ?

It appears to work like UI5. You have to Reload and refresh your browser when you change anything on the Advanced tab.

But if I set in a label the value I extract from the text area, there is no + inside, the text looks good. Does it make sense for you ? Plus I have no problem with the same code in UI5. I have no + replacing space.

I only saw the problem when I used the submit function in the js form. Inside the js nothing got substituted. This may well be a js version thing.

The problem is that the serial port configuration page is displaying nothing with HaPe’s environment ! This problem was mentioned by other users. Same for location page.

That’s interesting. I get both the Serial port and Locations pages displayed OK. I am running Chrome Version 36.0.1985.143 m.

There is also a Reboot button on Settings → Net & Wifi if you want a complete reboot.

I heard back from Support:

All UI5 features will be available in UI7 too.

Also there will be an announcement soon regarding some of the questions I raised about plugin migration. Let us hope it includes some documentation.

I was also informed that the next release candidate will include the ability to create another device for an installed plugin and also the ability to show the plugin’s help file.

So definitely heading in the right direction.

Good news.

I am not aware about the plugin help file. Can you point to the plugins that use this feature ?

[quote=“lolodomo, post:34, topic:182574”]Good news.

I am not aware about the plugin help file. Can you point to the plugins that use this feature ?[/quote]

Theoretically every released plugin should have a Help file. The url for this should be specified when the plugin is created on the App Store. It is displayed from the plugin’s entry in APPS → My Apps → → Help. For example, see MultiSwitch or PLEG.

[quote=“RexBeckett, post:35, topic:182574”][quote=“lolodomo, post:34, topic:182574”]Good news.

I am not aware about the plugin help file. Can you point to the plugins that use this feature ?[/quote]

Theoretically every released plugin should have a Help file. The url for this should be specified when the plugin is created on the App Store. It is displayed from the plugin’s entry in APPS → My Apps → → Help. For example, see MultiSwitch or PLEG.[/quote]

OK I see it now.

I found that a button on the UI7 dashboard for the Countdown Timer plugin was appearing in the log as service: undefined. This button didn’t have a Display variable (so it would never light up depending on a variable’s value), by design. In UI5 that was OK, but in UI7 the service ID comes from the “Display” section, not the “Command” section.

After adding

{ "ControlGroup": "1", "ControlType": "button", "top": 1, "left": 0, "Label": { "lang_tag": "cmd_set", "text": "Restart" }, "Display": { "Service": "urn:futzle-com:serviceId:CountdownTimer1", <== this line "Top": 20, "Left": 120, "Width": 80, "Height": 20 }, "Command": { "Service": "urn:futzle-com:serviceId:CountdownTimer1", "Action": "RestartTimer", "Parameters": [ ] } }, the button started working again.

Is it systematic for all buttons in a flash tab ?

Yes, I think so. You’ll probably need to do this for the Vol- and Vol+ buttons on the Sonos control tab, among others, because they don’t have that field already as the Play and Mute buttons do.

I can only imagine it’s a JavaScript programming bug, looking in the wrong object for the service ID. It makes no sense from a data model perspective to require the service ID but no variable name. But, that’s the reality.

That is certainly a bug to declare in the topic opened by Andrei.