XTension Discussion
Re: X2Web smallunitstatus question
On Jun 22, 2009, at 9:51 PM, Randy Carson wrote:
> Hi,
>
> I am attempting to display an analog value using the smallunitstatus
> page in X2Web.
>
> When I enter the following: page=smallunitstatus&unit=DC
> Voltage&name=DC, the resulting display is only the on/off state, and
> not the value, even though the unit is set to dimmable in Xtension,
> and the unit of measure is set to "volts".
The small unit status module only displays the status, not the value.
But you can easily make your own module that can display it. If you
dive into the instantx folder, and then the modules folder and then
the units folder you'll find the "smallunitstatus.x10" file that is
loaded for that display. Make a copy of it inside that folder and
change the name. I might call it smallunitvalue.x10 but you may want
to call it smallunitvalueRC.x10 or something that shows it's a custom
file by you to make it easier to preserve your own additions as we add
updates in the future.
The file is all self contained, a little bit of HTML and a little bit
of applescript.
the very last line of the embedded applescript is:
replacePagetag {{"name", TheName}, {"status", TheLabel},
{"backcolor", ThisBackground}}
puts in the dynamic information that is gathered in the earlier part
of the script. "TheLabel" tag is what is replaced with the on or off
label, so all you have to do is insert the value there instead. The
script already pulls the value to see if the unit is on or off so you
can just use the local variable and it will probably work to just
change that one line to:
replacePagetag {{"name", TheName}, {"status", TheValue},
{"backcolor", ThisBackground}}
Then save the file and change your configuration string to point to
page=smallunitvalueRC.x10 or whatever you call it. Then when copying
in new versions of the template in the future though you do need to
remember to preserve your own work and not copy over the whole folder
with the new version! (so make a backup of your work somewhere!)
>
> Also, I am using the &OnColor=55FF66&OffColor=FF6666 tags to reverse
> the red and green colors for this unit only - however it seems to
> change all of the units on the page. A workaround is to manually set
> the tags for each unit, I guess these variables apply to more than one
> unit?
>
> Any ideas of what could be wrong?
I discovered this bug recently but haven't gotten a solution yet, once
you add a parameter it falls through for all the other units in that
module. So you can either set it back to normal after you change it in
the next line and that will carry through, or you can again edit the
file we already edited above. The very first thing in the file are the
default colors to use if no color is specified. the file starts with
this:
<!--
<OnColor>FF6666</OnColor>
<OffColor>55FF66</OffColor>
Those are used if no form variables are sent
-->
Just swap them and resave the file. Again I'd recommend saving the
files with your own custom names then so that future updates dont
overwrite your work.
Thanks,
James
James Sentman sentman.com MacHomeAutomation.com
_______________________________________________
XTensionlist mailing list
XTensionlist-AT-shed.com
lists.shed.com/mailman/listinfo/xtensionlist
> Hi,
>
> I am attempting to display an analog value using the smallunitstatus
> page in X2Web.
>
> When I enter the following: page=smallunitstatus&unit=DC
> Voltage&name=DC, the resulting display is only the on/off state, and
> not the value, even though the unit is set to dimmable in Xtension,
> and the unit of measure is set to "volts".
The small unit status module only displays the status, not the value.
But you can easily make your own module that can display it. If you
dive into the instantx folder, and then the modules folder and then
the units folder you'll find the "smallunitstatus.x10" file that is
loaded for that display. Make a copy of it inside that folder and
change the name. I might call it smallunitvalue.x10 but you may want
to call it smallunitvalueRC.x10 or something that shows it's a custom
file by you to make it easier to preserve your own additions as we add
updates in the future.
The file is all self contained, a little bit of HTML and a little bit
of applescript.
the very last line of the embedded applescript is:
replacePagetag {{"name", TheName}, {"status", TheLabel},
{"backcolor", ThisBackground}}
puts in the dynamic information that is gathered in the earlier part
of the script. "TheLabel" tag is what is replaced with the on or off
label, so all you have to do is insert the value there instead. The
script already pulls the value to see if the unit is on or off so you
can just use the local variable and it will probably work to just
change that one line to:
replacePagetag {{"name", TheName}, {"status", TheValue},
{"backcolor", ThisBackground}}
Then save the file and change your configuration string to point to
page=smallunitvalueRC.x10 or whatever you call it. Then when copying
in new versions of the template in the future though you do need to
remember to preserve your own work and not copy over the whole folder
with the new version! (so make a backup of your work somewhere!)
>
> Also, I am using the &OnColor=55FF66&OffColor=FF6666 tags to reverse
> the red and green colors for this unit only - however it seems to
> change all of the units on the page. A workaround is to manually set
> the tags for each unit, I guess these variables apply to more than one
> unit?
>
> Any ideas of what could be wrong?
I discovered this bug recently but haven't gotten a solution yet, once
you add a parameter it falls through for all the other units in that
module. So you can either set it back to normal after you change it in
the next line and that will carry through, or you can again edit the
file we already edited above. The very first thing in the file are the
default colors to use if no color is specified. the file starts with
this:
<!--
<OnColor>FF6666</OnColor>
<OffColor>55FF66</OffColor>
Those are used if no form variables are sent
-->
Just swap them and resave the file. Again I'd recommend saving the
files with your own custom names then so that future updates dont
overwrite your work.
Thanks,
James
James Sentman sentman.com MacHomeAutomation.com
_______________________________________________
XTensionlist mailing list
XTensionlist-AT-shed.com
lists.shed.com/mailman/listinfo/xtensionlist
Previous message in thread | Next message in thread
Thread
X2Web smallunitstatus question / Randy Carson / 22 Jun 2009
• Re: X2Web smallunitstatus question / James Sentman <james-AT-sentman.com> / 23 Jun 2009
Re: X2Web smallunitstatus question / Randy Carson <randycarson-AT-gmail.com> / 23 Jun 2009
