From: <tho...@we...> - 2006-06-22 06:00:52
|
Ok, on "Mr House Home" -> "Browse Items" now i can see the defined states = for my generic items. Thanks for the Hint. But i cannot see the states on "Mr house home" -> "lights and appliances" = -> "Browse Groups "lueftung" " --> Buttons "SommerWinter" & "L=FCftung" there i only can set the states on/off by touching the buttons. maybe i have to define my own icons for every state??? When i am at home i will attach some pictures, so you can see what i mean. Thanks everyone for help, Thorsten. >Thorsten, > >I'm not sure why you are not seeing your desired behaviour. > >I tried out your Lueftung lines and they worked like a charm here. On whi= ch >web page are you not seeing the states change? I am using the "Generic >Items" page under "Mr House Home" -> "Browse Items" on the ia5 web interfa= ce. > >Matt > > >Thorsten Weiss wrote: >> Hello there, >>=20 >> this is my first post in this board, i hope i do everything right... >> First of all my name is Thorsten and I=B4m from germany. >>=20 >>=20 >> Now thats my problem: >>=20 >> I=B4ve tried to set own states with >>=20 >> $Lueftung =3D new Generic_Item; >> $Lueftung -> add_states('Stufe1','Stufe2','Stufe3','Aus') ; >> $Lueftung -> set_icon ('fan') ; >> $SommerWinter =3D new Generic_Item; >> $SommerWinter -> add_states('Sommer','Winter') ; >> $Lueftungsanlage -> add($Lueftung,$SommerWinter); >>=20 >> (Lueftung means some sort of Air-Condition without cooling function) >>=20 >> I can only toggle through the predefined states like on, off, dim and so= =20 >> on... >>=20 >> How I can set my own states for an Generic Item?? >>=20 >> The states should be shown on the buttons in the web-interface. >>=20 >> Thanks, >>=20 >> Thorsten. >>=20 >>=20 >> All the advantages of Linux Managed Hosting--Without the Cost and Risk! >> Fully trained technicians. The highest number of Red Hat certifications = in >> the hosting industry. Fanatical Support. Click to learn more >> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D107521&bid=3D248729&dat= =3D121642 >> ________________________________________________________ >> To unsubscribe from this list, go to:=20 >http://sourceforge.net/mail/?group_id=3D1365 >>=20 >>=20 > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around=20 >http://mail.yahoo.com=20 > > >All the advantages of Linux Managed Hosting--Without the Cost and Risk! >Fully trained technicians. The highest number of Red Hat certifications in >the hosting industry. Fanatical Support. Click to learn more >http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D107521&bid=3D248729&dat=3D= 121642 >________________________________________________________ >To unsubscribe from this list, go to:=20 >http://sourceforge.net/mail/?group_id=3D1365 > |
From: <tho...@we...> - 2006-06-23 05:43:39
|
Thank's. i didn't thought that creating own items is so simple. i will ty it at home at weekend , but first we had to do some barbeque with= our neighbours to celebrate our third year living in our new house. (it's called in german 1. Spatenstich) Everyone have a nice weekend, Thorsten. =20 >Oh, > >forget to mention that the web page to list your Lueftungs would be >/bin/list_buttons.pl?Lueftung_Item. You can add this link to any menu you >like. As a Lueftung is neither an X10_Appliance nor an X10_Item, it won't >appear in the default ia5 menus. > >Matt > >Matthew Williams wrote: >> Thorsten, >>=20 >> The page that you are talking about is generated by >> mh/web/bin/list_buttons.pl. If you want to have your custom states list= ed, >> then you will have to: >>=20 >> - create a new object type derived from Generic_Item >> - patch list_buttons.pl to recognize your new type of object and react >> accordingly >>=20 >> This isn't as difficult as it may appear. Just create a new file in you= r >> local code directory called Lueftung_Item.pm with the following text. = =20 >Then, >> just create a new Lueftung_Item instead of a new Generic_Item. >>=20 >> How to create a Lueftung_Item: >>=20 >> use Lueftung_Item; >> $foo=3Dnew Lueftung_Item; >>=20 >> -- start of Lueftung_Item.pm -- >> package Lueftung_Item; >>=20 >> @Lueftung_Item::ISA =3D ('Generic_Item'); >>=20 >> sub new { >> my ($class, $name)=3D@_; >> my $self=3D$class->Generic_Item::new(); >> bless $self, $class; >>=20 >> $self->set_states('Stufe1','Stufe2','Stufe3','Aus'); >> $self->set_icon('fan'); >> return $self; >> } >>=20 >> -- end -- >>=20 >> Now just edit list_buttons.pl so that it recognizes your new object type= . >> Copy the logic for Fan_Motor around line 36 of this file. Be sure to ma= ke >> comparisons to the lower case equivalent of your states (i.e. stufe1 not >> Stufe1) as misterhouse converts almost all states to lowercase. You wil= l >> also need to modify list_buttons.pl around line 27 so that it it knows h= ow >> to read the current state of your new object type. Just copy the E1B1_I= tem >> line and replace E1B1_Item with Lueftung_Item. >>=20 >> You will not need to create your own icons if you are using GD, as >> misterhouse will generate them on the fly, but they are pretty ugly so y= ou >> may want to. Look at the code around line 50 for the correct filename = to=20 >use. >>=20 >> Now, if you actually want this code to do anything useful, you'll have t= o >> create new methods within Lueftung_Item that know how to control the fan= . >> Hint: take a look at Fan_Control.pm and the names of the setstate_*=20 >methods. >>=20 >> Good luck! >> Matt >>=20 >> tho...@we... wrote: >>> Ok, on "Mr House Home" -> "Browse Items" now i can see the defined stat= es =20 >for my generic items. Thanks for the Hint. >>> >>> But i cannot see the states on "Mr house home" -> "lights and appliance= s" =20 >-> "Browse Groups "lueftung" " --> Buttons "SommerWinter" & "L=FCftung" >>> >>> there i only can set the states on/off by touching the buttons. >>> >>> maybe i have to define my own icons for every state??? >>> When i am at home i will attach some pictures, so you can see what i me= an. >>> >>> Thanks everyone for help, >>> >>=20 > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around=20 >http://mail.yahoo.com=20 > > >Using Tomcat but need to do more? Need to support web services, security? >Get stuff done quickly with pre-integrated technology to make your job eas= ier >Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 >________________________________________________________ >To unsubscribe from this list, go to:=20 >http://sourceforge.net/mail/?group_id=3D1365 > |
From: <tho...@we...> - 2006-06-28 11:17:36
|
>Hello there, > >my problem creating own items is solved now, thanks everyone for help- > >but now a new problem occured... > >Is it possible to tell the webinterface /bin/list_buttons.pl?$Lueftungsanlage >to use owm created buttons?? > >i have created several buttons (see attachment), but the buttons are displayd >as an icon in the Item Button (see attached wi.jpg) > >I like to see the Whole button as Item button, is it possible?? > >I created for every state an own button... > > >Thanks for help, > > >Thorsten. |
From: Matthew W. <mat...@us...> - 2006-06-28 14:41:51
|
The are two ways to make this happen, the easy way and the long way. Easy way: If your Lueftung item is called mylueftung (i.e. $mylueftung=new Lueftung;) then name your "aus" graphic web/graphics/light-mylueftung_aus.gif Use the same pattern for your other files. Slightly longer but more accurate way: list_buttons.pl currently assumes that everything is a light, as you can tell by the filenames above. You really should patch list_buttons.pl so that it uses a different prefix for non light objects. The function to figure out what an object is is "ref" or you can use the isa method to see if the object is a descendant of a certain class. At line 54 of list_buttons.pl, you can see that the prefix is always "light". You would want to change line 54 to this: my $prefix='light'; $prefix='lueftung' is $item->isa('Lueftung_Item'); my $image="/graphics/${prefix}".lc $item."_".$icon.gif Your images would now, more accurately, be called: web/graphics/lueftung_mylueftung_aus.gif. You can also place them in a private graphics folder (see mh.ini, search for html_alias2_graphics) which makes sense as it is easier to upgrade that way. Now, if you want mh to know that Lueftungs are really fans so that it can generate an icon for a Lueftung without a custom icon, then you should copy fan.jpg to lueftung.jpg in the graphics directory. Again, you should really copy it to a custom graphics directory to keep it around. Matt tho...@we... wrote: >> Hello there, >> >> my problem creating own items is solved now, thanks everyone for help- >> >> but now a new problem occured... >> >> Is it possible to tell the webinterface /bin/list_buttons.pl?$Lueftungsanlage >> to use owm created buttons?? >> >> i have created several buttons (see attachment), but the buttons are displayd >> as an icon in the Item Button (see attached wi.jpg) >> >> I like to see the Whole button as Item button, is it possible?? >> >> I created for every state an own button... >> >> >> Thanks for help, >> >> >> Thorsten. >> >> ------------------------------------------------------------------------ >> >> Using Tomcat but need to do more? Need to support web services, security? >> Get stuff done quickly with pre-integrated technology to make your job easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> >> ------------------------------------------------------------------------ >> >> ________________________________________________________ >> To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 >> __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Thorsten W. <tho...@we...> - 2006-06-28 17:17:58
|
Wow, that goes fast thanksfor the answer, i will try this today evening. Greetings from germany (probably the next football-World-Master ;_)) ) Matthew Williams schrieb: >The are two ways to make this happen, the easy way and the long way. > >Easy way: >If your Lueftung item is called mylueftung (i.e. $mylueftung=new Lueftung;) >then name your "aus" graphic web/graphics/light-mylueftung_aus.gif Use the >same pattern for your other files. > >Slightly longer but more accurate way: >list_buttons.pl currently assumes that everything is a light, as you can >tell by the filenames above. You really should patch list_buttons.pl so >that it uses a different prefix for non light objects. The function to >figure out what an object is is "ref" or you can use the isa method to see >if the object is a descendant of a certain class. > >At line 54 of list_buttons.pl, you can see that the prefix is always >"light". You would want to change line 54 to this: > >my $prefix='light'; >$prefix='lueftung' is $item->isa('Lueftung_Item'); >my $image="/graphics/${prefix}".lc $item."_".$icon.gif > >Your images would now, more accurately, be called: >web/graphics/lueftung_mylueftung_aus.gif. You can also place them in a >private graphics folder (see mh.ini, search for html_alias2_graphics) which >makes sense as it is easier to upgrade that way. > >Now, if you want mh to know that Lueftungs are really fans so that it can >generate an icon for a Lueftung without a custom icon, then you should copy >fan.jpg to lueftung.jpg in the graphics directory. Again, you should really >copy it to a custom graphics directory to keep it around. > >Matt > > > >tho...@we... wrote: > > >>>Hello there, >>> >>>my problem creating own items is solved now, thanks everyone for help- >>> >>>but now a new problem occured... >>> >>>Is it possible to tell the webinterface /bin/list_buttons.pl?$Lueftungsanlage >>>to use owm created buttons?? >>> >>>i have created several buttons (see attachment), but the buttons are displayd >>>as an icon in the Item Button (see attached wi.jpg) >>> >>>I like to see the Whole button as Item button, is it possible?? >>> >>>I created for every state an own button... >>> >>> >>>Thanks for help, >>> >>> >>>Thorsten. >>> >>>------------------------------------------------------------------------ >>> >>>Using Tomcat but need to do more? Need to support web services, security? >>>Get stuff done quickly with pre-integrated technology to make your job easier >>>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >>>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >>> >>>------------------------------------------------------------------------ >>> >>>________________________________________________________ >>>To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 >>> >>> >>> > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com > > >Using Tomcat but need to do more? Need to support web services, security? >Get stuff done quickly with pre-integrated technology to make your job easier >Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >________________________________________________________ >To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 > > > |
From: Thorsten W. <tho...@we...> - 2006-06-28 18:11:56
|
OK, i tried another solution: I only removed the prefix in line 54: my $image = "/graphics/light-" . lc $item . "_" . $icon . ".gif"; is now: my $image = "/graphics/" . lc $item . "-" . $icon . ".png"; it works fine! Every button now shows my own buttons with the right state.... Greetings, Thorsten. Thorsten Weiss schrieb: >Wow, that goes fast >thanksfor the answer, > >i will try this today evening. > >Greetings from germany (probably the next football-World-Master ;_)) ) > > >Matthew Williams schrieb: > > > >>The are two ways to make this happen, the easy way and the long way. >> >>Easy way: >>If your Lueftung item is called mylueftung (i.e. $mylueftung=new Lueftung;) >>then name your "aus" graphic web/graphics/light-mylueftung_aus.gif Use the >>same pattern for your other files. >> >>Slightly longer but more accurate way: >>list_buttons.pl currently assumes that everything is a light, as you can >>tell by the filenames above. You really should patch list_buttons.pl so >>that it uses a different prefix for non light objects. The function to >>figure out what an object is is "ref" or you can use the isa method to see >>if the object is a descendant of a certain class. >> >>At line 54 of list_buttons.pl, you can see that the prefix is always >>"light". You would want to change line 54 to this: >> >>my $prefix='light'; >>$prefix='lueftung' is $item->isa('Lueftung_Item'); >>my $image="/graphics/${prefix}".lc $item."_".$icon.gif >> >>Your images would now, more accurately, be called: >>web/graphics/lueftung_mylueftung_aus.gif. You can also place them in a >>private graphics folder (see mh.ini, search for html_alias2_graphics) which >>makes sense as it is easier to upgrade that way. >> >>Now, if you want mh to know that Lueftungs are really fans so that it can >>generate an icon for a Lueftung without a custom icon, then you should copy >>fan.jpg to lueftung.jpg in the graphics directory. Again, you should really >>copy it to a custom graphics directory to keep it around. >> >>Matt >> >> >> >>tho...@we... wrote: >> >> >> >> >>>>Hello there, >>>> >>>>my problem creating own items is solved now, thanks everyone for help- >>>> >>>>but now a new problem occured... >>>> >>>>Is it possible to tell the webinterface /bin/list_buttons.pl?$Lueftungsanlage >>>>to use owm created buttons?? >>>> >>>>i have created several buttons (see attachment), but the buttons are displayd >>>>as an icon in the Item Button (see attached wi.jpg) >>>> >>>>I like to see the Whole button as Item button, is it possible?? >>>> >>>>I created for every state an own button... >>>> >>>> >>>>Thanks for help, >>>> >>>> >>>>Thorsten. >>>> >>>>------------------------------------------------------------------------ >>>> >>>>Using Tomcat but need to do more? Need to support web services, security? >>>>Get stuff done quickly with pre-integrated technology to make your job easier >>>>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >>>>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >>>> >>>>------------------------------------------------------------------------ >>>> >>>>________________________________________________________ >>>>To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 >>>> >>>> >>>> >>>> >>>> >>__________________________________________________ >>Do You Yahoo!? >>Tired of spam? Yahoo! Mail has the best spam protection around >>http://mail.yahoo.com >> >> >>Using Tomcat but need to do more? Need to support web services, security? >>Get stuff done quickly with pre-integrated technology to make your job easier >>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >>________________________________________________________ >>To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 >> >> >> >> >> > > >Using Tomcat but need to do more? Need to support web services, security? >Get stuff done quickly with pre-integrated technology to make your job easier >Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >________________________________________________________ >To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 > > > |
From: Matthew W. <mat...@us...> - 2006-06-28 19:21:32
|
Thorsten Weiss wrote: > OK, i tried another solution: > I only removed the prefix in line 54: > my $image = "/graphics/light-" . lc $item . "_" . $icon . ".gif"; > is now: > my $image = "/graphics/" . lc $item . "-" . $icon . ".png"; > > it works fine! Every button now shows my own buttons with the right > state.... Keep in mind that your change won't survive an upgrade. > Greetings from germany (probably the next football-World-Master ;_)) ) By the way, although Canada isn't in the World Cup, I am originally from England, so I have to add: not bloody likely! :-) Matt __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Matthew W. <mat...@us...> - 2006-06-22 18:20:43
|
Thorsten, The page that you are talking about is generated by mh/web/bin/list_buttons.pl. If you want to have your custom states listed, then you will have to: - create a new object type derived from Generic_Item - patch list_buttons.pl to recognize your new type of object and react accordingly This isn't as difficult as it may appear. Just create a new file in your local code directory called Lueftung_Item.pm with the following text. Then, just create a new Lueftung_Item instead of a new Generic_Item. How to create a Lueftung_Item: use Lueftung_Item; $foo=new Lueftung_Item; -- start of Lueftung_Item.pm -- package Lueftung_Item; @Lueftung_Item::ISA = ('Generic_Item'); sub new { my ($class, $name)=@_; my $self=$class->Generic_Item::new(); bless $self, $class; $self->set_states('Stufe1','Stufe2','Stufe3','Aus'); $self->set_icon('fan'); return $self; } -- end -- Now just edit list_buttons.pl so that it recognizes your new object type. Copy the logic for Fan_Motor around line 36 of this file. Be sure to make comparisons to the lower case equivalent of your states (i.e. stufe1 not Stufe1) as misterhouse converts almost all states to lowercase. You will also need to modify list_buttons.pl around line 27 so that it it knows how to read the current state of your new object type. Just copy the E1B1_Item line and replace E1B1_Item with Lueftung_Item. You will not need to create your own icons if you are using GD, as misterhouse will generate them on the fly, but they are pretty ugly so you may want to. Look at the code around line 50 for the correct filename to use. Now, if you actually want this code to do anything useful, you'll have to create new methods within Lueftung_Item that know how to control the fan. Hint: take a look at Fan_Control.pm and the names of the setstate_* methods. Good luck! Matt tho...@we... wrote: > Ok, on "Mr House Home" -> "Browse Items" now i can see the defined states for my generic items. Thanks for the Hint. > > But i cannot see the states on "Mr house home" -> "lights and appliances" -> "Browse Groups "lueftung" " --> Buttons "SommerWinter" & "Lüftung" > > there i only can set the states on/off by touching the buttons. > > maybe i have to define my own icons for every state??? > When i am at home i will attach some pictures, so you can see what i mean. > > Thanks everyone for help, > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Matthew W. <mat...@us...> - 2006-06-22 19:08:24
|
Oh, forget to mention that the web page to list your Lueftungs would be /bin/list_buttons.pl?Lueftung_Item. You can add this link to any menu you like. As a Lueftung is neither an X10_Appliance nor an X10_Item, it won't appear in the default ia5 menus. Matt Matthew Williams wrote: > Thorsten, > > The page that you are talking about is generated by > mh/web/bin/list_buttons.pl. If you want to have your custom states listed, > then you will have to: > > - create a new object type derived from Generic_Item > - patch list_buttons.pl to recognize your new type of object and react > accordingly > > This isn't as difficult as it may appear. Just create a new file in your > local code directory called Lueftung_Item.pm with the following text. Then, > just create a new Lueftung_Item instead of a new Generic_Item. > > How to create a Lueftung_Item: > > use Lueftung_Item; > $foo=new Lueftung_Item; > > -- start of Lueftung_Item.pm -- > package Lueftung_Item; > > @Lueftung_Item::ISA = ('Generic_Item'); > > sub new { > my ($class, $name)=@_; > my $self=$class->Generic_Item::new(); > bless $self, $class; > > $self->set_states('Stufe1','Stufe2','Stufe3','Aus'); > $self->set_icon('fan'); > return $self; > } > > -- end -- > > Now just edit list_buttons.pl so that it recognizes your new object type. > Copy the logic for Fan_Motor around line 36 of this file. Be sure to make > comparisons to the lower case equivalent of your states (i.e. stufe1 not > Stufe1) as misterhouse converts almost all states to lowercase. You will > also need to modify list_buttons.pl around line 27 so that it it knows how > to read the current state of your new object type. Just copy the E1B1_Item > line and replace E1B1_Item with Lueftung_Item. > > You will not need to create your own icons if you are using GD, as > misterhouse will generate them on the fly, but they are pretty ugly so you > may want to. Look at the code around line 50 for the correct filename to use. > > Now, if you actually want this code to do anything useful, you'll have to > create new methods within Lueftung_Item that know how to control the fan. > Hint: take a look at Fan_Control.pm and the names of the setstate_* methods. > > Good luck! > Matt > > tho...@we... wrote: >> Ok, on "Mr House Home" -> "Browse Items" now i can see the defined states for my generic items. Thanks for the Hint. >> >> But i cannot see the states on "Mr house home" -> "lights and appliances" -> "Browse Groups "lueftung" " --> Buttons "SommerWinter" & "Lüftung" >> >> there i only can set the states on/off by touching the buttons. >> >> maybe i have to define my own icons for every state??? >> When i am at home i will attach some pictures, so you can see what i mean. >> >> Thanks everyone for help, >> > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |