We have moved at community.getvera.com

Author Topic: Custom Page Creation?  (Read 6776 times)

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Custom Page Creation?
« on: January 03, 2016, 04:24:35 am »
Goal: To create a page that I can bookmark for non-admin users that gives them control over certain devices in the home, but prevents them from making any damaging changes to the system.

1) I am trying to do this in Chrome, but after creating a new page, the drag & drop doesn't work at all.  Bug?  Not supported in Chrome?
2) Is there an easy way to drag and drop some controllers to my page so they appear just like on the Devices page? (the link to the usage guide for ALTUI is broken)
3) Is there a way to provide a link to this custom page (not the main AltUI dashboard) so they can bookmark it on their smartphones?

thanks!

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: Custom Page Creation?
« Reply #1 on: January 03, 2016, 10:42:18 am »
Goal: To create a page that I can bookmark for non-admin users that gives them control over certain devices in the home, but prevents them from making any damaging changes to the system.

1) I am trying to do this in Chrome, but after creating a new page, the drag & drop doesn't work at all.  Bug?  Not supported in Chrome?
2) Is there an easy way to drag and drop some controllers to my page so they appear just like on the Devices page? (the link to the usage guide for ALTUI is broken)
3) Is there a way to provide a link to this custom page (not the main AltUI dashboard) so they can bookmark it on their smartphones?

thanks!

for 1) we need to investigate. I need ALTUI version, VERA version and an extract of all the message you have in the console javascript log for that ALTUI page at the moment you open the "UsePages" and try the drag and drop
2) not yet, someone asked for this but it does not sound really simple so in the "thinking" queue
3) the closest possible is to use a different opening url like:
http://<yourip>/port_3480/data_request?id=lr_ALTUI_Handler&command=home&home=pageUsePages

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Re: Custom Page Creation?
« Reply #2 on: January 04, 2016, 10:36:02 am »
Goal: To create a page that I can bookmark for non-admin users that gives them control over certain devices in the home, but prevents them from making any damaging changes to the system.

1) I am trying to do this in Chrome, but after creating a new page, the drag & drop doesn't work at all.  Bug?  Not supported in Chrome?
2) Is there an easy way to drag and drop some controllers to my page so they appear just like on the Devices page? (the link to the usage guide for ALTUI is broken)
3) Is there a way to provide a link to this custom page (not the main AltUI dashboard) so they can bookmark it on their smartphones?

thanks!

for 1) we need to investigate. I need ALTUI version, VERA version and an extract of all the message you have in the console javascript log for that ALTUI page at the moment you open the "UsePages" and try the drag and drop
2) not yet, someone asked for this but it does not sound really simple so in the "thinking" queue
3) the closest possible is to use a different opening url like:
http://<yourip>/port_3480/data_request?id=lr_ALTUI_Handler&command=home&home=pageUsePages

Latest altUI version.
Is there any documentation at all on how to create a custom page?  The link to the PDF isn't working.
thanks!

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: Custom Page Creation?
« Reply #3 on: January 04, 2016, 11:16:10 am »

Latest altUI version.
Is there any documentation at all on how to create a custom page?  The link to the PDF isn't working.
thanks!

you should find it toward the end of that file. could be a bit old but still ok more or less.
http://code.mios.com/trac/mios_alternate_ui/export/1071/Docs/doc.pdf

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Re: Custom Page Creation?
« Reply #4 on: January 05, 2016, 03:25:35 am »

Latest altUI version.
Is there any documentation at all on how to create a custom page?  The link to the PDF isn't working.
thanks!

you should find it toward the end of that file. could be a bit old but still ok more or less.
http://code.mios.com/trac/mios_alternate_ui/export/1071/Docs/doc.pdf

I found the bug - the UI lets you enter a page name with a space, but if you do that, the grey canvas doesn't show up.

Now I have a different issue - I am trying to use the 2 state button tool to turn a heater on and off (thermostat device) but I can only succeed to get it to turn on.  The button also doesn't change color, so it seems the button thinks it is still off and keeps sending the On command only.  How is the button supposed to know the state of the device to know if it is on or off?  I see the place to specify Variable, but it doesn't seem to be comparing the value of the variable with the Off and On properties I set.  For a thermostat, I set on to 'AutoChangeOver' and Off is 'Off.' It send AutoChangeOver command and the device turns on, but the button stays the same and the next time I click it sends the same command again, never sends off.
« Last Edit: January 05, 2016, 04:23:07 am by MSW »

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: Custom Page Creation?
« Reply #5 on: January 05, 2016, 04:44:21 am »

Latest altUI version.
Is there any documentation at all on how to create a custom page?  The link to the PDF isn't working.
thanks!

you should find it toward the end of that file. could be a bit old but still ok more or less.
http://code.mios.com/trac/mios_alternate_ui/export/1071/Docs/doc.pdf

I found the bug - the UI lets you enter a page name with a space, but if you do that, the grey canvas doesn't show up.

Now I have a different issue - I am trying to use the 2 state button tool to turn a heater on and off (thermostat device) but I can only succeed to get it to turn on.  The button also doesn't change color, so it seems the button thinks it is still off and keeps sending the On command only.  How is the button supposed to know the state of the device to know if it is on or off?  I see the place to specify Variable, but it doesn't seem to be comparing the value of the variable with the Off and On properties I set.  For a thermostat, I set on to 'AutoChangeOver' and Off is 'Off.' It send AutoChangeOver command and the device turns on, but the button stays the same and the next time I click it sends the same command again, never sends off.

thx for the bug,  i will check


2 states button is a bit touchy to setup and this happens when the variable state value is inverted compared to the red green color. it all depends on the underlying device action upnp and you may need the 'inverted'checkbox. 

here is an example where I needed it as I wanted it green when the phone was not muted ( Muted variable = 0 ) and red when it was.

To help the way to think about this is can you try to explain precisely :
- what variable value should represent ON  or OFF state
- what is the action to go from ON to OFF state =>
- what is the action to go from OFF to ON state =>
- if you want the OFF state to appear red or green

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Re: Custom Page Creation?
« Reply #6 on: January 05, 2016, 04:51:15 am »

Latest altUI version.
Is there any documentation at all on how to create a custom page?  The link to the PDF isn't working.
thanks!

you should find it toward the end of that file. could be a bit old but still ok more or less.
http://code.mios.com/trac/mios_alternate_ui/export/1071/Docs/doc.pdf

I found the bug - the UI lets you enter a page name with a space, but if you do that, the grey canvas doesn't show up.

Now I have a different issue - I am trying to use the 2 state button tool to turn a heater on and off (thermostat device) but I can only succeed to get it to turn on.  The button also doesn't change color, so it seems the button thinks it is still off and keeps sending the On command only.  How is the button supposed to know the state of the device to know if it is on or off?  I see the place to specify Variable, but it doesn't seem to be comparing the value of the variable with the Off and On properties I set.  For a thermostat, I set on to 'AutoChangeOver' and Off is 'Off.' It send AutoChangeOver command and the device turns on, but the button stays the same and the next time I click it sends the same command again, never sends off.

thx for the bug,  i will check


2 states button is a bit touchy to setup and this happens when the variable state value is inverted compared to the red green color. it all depends on the underlying device action upnp and you may need the 'inverted'checkbox. 

here is an example where I needed it as I wanted it green when the phone was not muted ( Muted variable = 0 ) and red when it was.

To help the way to think about this is can you try to explain precisely :
- what variable value should represent ON  or OFF state
- what is the action to go from ON to OFF state =>
- what is the action to go from OFF to ON state =>
- if you want the OFF state to appear red or green

explain precisely :
- what variable value should represent ON  or OFF state? On: 'AutoChangeOver' Off: 'Off'
- what is the action to go from ON to OFF state => SetModeTarget Off
- what is the action to go from OFF to ON state => SetModeTarget AutoChangeOver
- if you want the OFF state to appear red or green? Off should be Red (or no color).  On should be green.

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: Custom Page Creation?
« Reply #7 on: January 05, 2016, 12:02:00 pm »
explain precisely :
- what variable value should represent ON  or OFF state? On: 'AutoChangeOver' Off: 'Off'
- what is the action to go from ON to OFF state => SetModeTarget Off
- what is the action to go from OFF to ON state => SetModeTarget AutoChangeOver
- if you want the OFF state to appear red or green? Off should be Red (or no color).  On should be green.

it feels standard configuration so maybe there is a crash.

1/ can you share a print screen of your button configuration dialog.
2/ can you place a simple action button  for each action  (SetModeTarget Off) and (SetModeTarget AutoChangeOver) and play with them ? does it change the device variable ( mode ? )

3/ also
a) try to go in use page mode, 
b) open javascript console log ( Ctrl+Shift+J on chrome )
c) press on the on/off button  , see what happens
d) press again a few sec later , see what happens
get me your console log messages.
 
thx

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Re: Custom Page Creation?
« Reply #8 on: January 05, 2016, 12:03:51 pm »
explain precisely :
- what variable value should represent ON  or OFF state? On: 'AutoChangeOver' Off: 'Off'
- what is the action to go from ON to OFF state => SetModeTarget Off
- what is the action to go from OFF to ON state => SetModeTarget AutoChangeOver
- if you want the OFF state to appear red or green? Off should be Red (or no color).  On should be green.

it feels standard configuration so maybe there is a crash.

1/ can you share a print screen of your button configuration dialog.
2/ can you place a simple action button  for each action  (SetModeTarget Off) and (SetModeTarget AutoChangeOver) and play with them ? does it change the device variable ( mode ? )

3/ also
a) try to go in use page mode, 
b) open javascript console log ( Ctrl+Shift+J on chrome )
c) press on the on/off button  , see what happens
d) press again a few sec later , see what happens
get me your console log messages.
 
thx

Are you certain your code is using the variables passed in to test state and not hard coded "On" and "Off"?  I know that you are sending the variables correctly, but the button itself must reflect the state of the device based on the value and perhaps there you hard coded a check with On and Off?

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: Custom Page Creation?
« Reply #9 on: January 05, 2016, 12:07:08 pm »
explain precisely :
- what variable value should represent ON  or OFF state? On: 'AutoChangeOver' Off: 'Off'
- what is the action to go from ON to OFF state => SetModeTarget Off
- what is the action to go from OFF to ON state => SetModeTarget AutoChangeOver
- if you want the OFF state to appear red or green? Off should be Red (or no color).  On should be green.

it feels standard configuration so maybe there is a crash.

1/ can you share a print screen of your button configuration dialog.
2/ can you place a simple action button  for each action  (SetModeTarget Off) and (SetModeTarget AutoChangeOver) and play with them ? does it change the device variable ( mode ? )

3/ also
a) try to go in use page mode, 
b) open javascript console log ( Ctrl+Shift+J on chrome )
c) press on the on/off button  , see what happens
d) press again a few sec later , see what happens
get me your console log messages.
 
thx

Are you certain your code is using the variables passed in to test state and not hard coded "On" and "Off"?  I know that you are sending the variables correctly, but the button itself must reflect the state of the device based on the value and perhaps there you hard coded a check with On and Off?

there are many years since I gave up in computer science to be certain of anything. and as I age, even less.

But my example that I shared with IPhone does not uses On Off but uses 1 or 0 and the url called when I press the button is correct so that should not be the problem.

http://192.168.1.16/port_3480/data_request?id=action&output_format=json&DeviceNum=94&serviceId=urn:upnp-org:serviceId:IPhoneLocator1&action=SetMute&newMuteStatus=1

but it is a good point to open Chrome Network page and check the url that is called at the time you press the button. it should start with
Code: [Select]
http://<yourip>/port_3480/data_request?id=action&output_format=json&DeviceNum=

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Re: Custom Page Creation?
« Reply #10 on: January 05, 2016, 02:00:21 pm »
explain precisely :
- what variable value should represent ON  or OFF state? On: 'AutoChangeOver' Off: 'Off'
- what is the action to go from ON to OFF state => SetModeTarget Off
- what is the action to go from OFF to ON state => SetModeTarget AutoChangeOver
- if you want the OFF state to appear red or green? Off should be Red (or no color).  On should be green.


1/ can you share a print screen of your button configuration dialog.
2/ can you place a simple action button  for each action  (SetModeTarget Off) and (SetModeTarget AutoChangeOver) and play with them ? does it change the device variable ( mode ? )

3/ also
a) try to go in use page mode, 
b) open javascript console log ( Ctrl+Shift+J on chrome )
c) press on the on/off button  , see what happens
d) press again a few sec later , see what happens
get me your console log messages.
 
thx

Are you certain your code is using the variables passed in to test state and not hard coded "On" and "Off"?  I know that you are sending the variables correctly, but the button itself must reflect the state of the device based on the value and perhaps there you hard coded a check with On and Off?

there are many years since I gave up in computer science to be certain of anything. and as I age, even less.

But my example that I shared with IPhone does not uses On Off but uses 1 or 0 and the url called when I press the button is correct so that should not be the problem.

http://192.168.1.16/port_3480/data_request?id=action&output_format=json&DeviceNum=94&serviceId=urn:upnp-org:serviceId:IPhoneLocator1&action=SetMute&newMuteStatus=1

but it is a good point to open Chrome Network page and check the url that is called at the time you press the button. it should start with
Code: [Select]
http://<yourip>/port_3480/data_request?id=action&output_format=json&DeviceNum=

A separate button sending Off works fine.

As I suspected, this combo button is only sending:
http://192.168.0.200/port_3480/data_request?id=action&output_format=json&DeviceNum=9&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=AutoChangeOver

It never sends Off.  The button never changes state to believe it is on.  BTW, the console doesn't record any messages after I clear away all the junk there from loading the page (I included that page load junk below) 

Failed to decode downloaded font: https://maxcdn.bootstrapcdn.com/bootswatch/latest/fonts/glyphicons-halflings-regular.woff2
data_request?id=lr_ALTUI_Handler&command=home:1 OTS parsing error: Failed to convert WOFF 2.0 font to SFNT
data_request?id=lr_ALTUI_Handler&command=home:1 Failed to decode downloaded font: https://maxcdn.bootstrapcdn.com/bootswatch/latest/fonts/glyphicons-halflings-regular.woff
data_request?id=lr_ALTUI_Handler&command=home:1 OTS parsing error: incorrect file size in WOFF header
data_request?id=lr_ALTUI_Handler&command=home:1 Failed to decode downloaded font: https://maxcdn.bootstrapcdn.com/bootswatch/latest/fonts/glyphicons-halflings-regular.ttf
data_request?id=lr_ALTUI_Handler&command=home:1 OTS parsing error: incorrect entrySelector for table directory
« Last Edit: January 05, 2016, 02:22:02 pm by MSW »

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: Custom Page Creation?
« Reply #11 on: January 05, 2016, 06:37:04 pm »
explain precisely :
- what variable value should represent ON  or OFF state? On: 'AutoChangeOver' Off: 'Off'
- what is the action to go from ON to OFF state => SetModeTarget Off
- what is the action to go from OFF to ON state => SetModeTarget AutoChangeOver
- if you want the OFF state to appear red or green? Off should be Red (or no color).  On should be green.


1/ can you share a print screen of your button configuration dialog.
2/ can you place a simple action button  for each action  (SetModeTarget Off) and (SetModeTarget AutoChangeOver) and play with them ? does it change the device variable ( mode ? )

3/ also
a) try to go in use page mode, 
b) open javascript console log ( Ctrl+Shift+J on chrome )
c) press on the on/off button  , see what happens
d) press again a few sec later , see what happens
get me your console log messages.
 
thx

Are you certain your code is using the variables passed in to test state and not hard coded "On" and "Off"?  I know that you are sending the variables correctly, but the button itself must reflect the state of the device based on the value and perhaps there you hard coded a check with On and Off?

there are many years since I gave up in computer science to be certain of anything. and as I age, even less.

But my example that I shared with IPhone does not uses On Off but uses 1 or 0 and the url called when I press the button is correct so that should not be the problem.

http://192.168.1.16/port_3480/data_request?id=action&output_format=json&DeviceNum=94&serviceId=urn:upnp-org:serviceId:IPhoneLocator1&action=SetMute&newMuteStatus=1

but it is a good point to open Chrome Network page and check the url that is called at the time you press the button. it should start with
Code: [Select]
http://<yourip>/port_3480/data_request?id=action&output_format=json&DeviceNum=

A separate button sending Off works fine.

As I suspected, this combo button is only sending:
http://192.168.0.200/port_3480/data_request?id=action&output_format=json&DeviceNum=9&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=AutoChangeOver

It never sends Off.  The button never changes state to believe it is on.  BTW, the console doesn't record any messages after I clear away all the junk there from loading the page (I included that page load junk below) 

Failed to decode downloaded font: https://maxcdn.bootstrapcdn.com/bootswatch/latest/fonts/glyphicons-halflings-regular.woff2
data_request?id=lr_ALTUI_Handler&command=home:1 OTS parsing error: Failed to convert WOFF 2.0 font to SFNT
data_request?id=lr_ALTUI_Handler&command=home:1 Failed to decode downloaded font: https://maxcdn.bootstrapcdn.com/bootswatch/latest/fonts/glyphicons-halflings-regular.woff
data_request?id=lr_ALTUI_Handler&command=home:1 OTS parsing error: incorrect file size in WOFF header
data_request?id=lr_ALTUI_Handler&command=home:1 Failed to decode downloaded font: https://maxcdn.bootstrapcdn.com/bootswatch/latest/fonts/glyphicons-halflings-regular.ttf
data_request?id=lr_ALTUI_Handler&command=home:1 OTS parsing error: incorrect entrySelector for table directory
I see. I did not plan for textual values for the variable. I ll have a look.

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Re: Custom Page Creation?
« Reply #12 on: January 05, 2016, 11:42:08 pm »
Thanks. Should be easy enough to change the variable type.

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: Custom Page Creation?
« Reply #13 on: January 06, 2016, 04:47:09 am »
Thanks. Should be easy enough to change the variable type.
it is not a question of type, it is a question of which values means what, meaning I am going to have to ask the user to tell what text is considered a "on" value and what text is considred to be a 'off' value,  so 2 new parameters in the widget dialog box

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Re: Custom Page Creation?
« Reply #14 on: January 06, 2016, 06:19:42 am »
Thanks. Should be easy enough to change the variable type.
it is not a question of type, it is a question of which values means what, meaning I am going to have to ask the user to tell what text is considered a "on" value and what text is considred to be a 'off' value,  so 2 new parameters in the widget dialog box

No you don't - they already tell you when they tell you what value to set it with.  In my case Off means Off and AutoChangeOver means On. You don't have to ask me since I already have you those values. No change to the UI.
« Last Edit: January 06, 2016, 06:22:28 am by MSW »