How to display 2 or 3 items on one sitemap line?

1,202 views
Skip to first unread message

Mark

unread,
Feb 8, 2015, 8:22:42 AM2/8/15
to ope...@googlegroups.com
Hopefully someone can point me in the right direction. I am looking to display 2 or 3 different data items on one line in sitemap. I mean, if I have a battery powered temp node - I would like to have this displayed for example:
Garage Temperature                            (67%)          68 F

where the % is battery remaining for that node, and 68 is the temperature. Or where there is a Temp/Humidity sensor:
Basement                                        (58%)            56 F      67%

Is this possible? Examples somewhere?

Right now each data items is a single line in the browser display which takes up a lot of space.

Have tried searching both text and screen shots and have not yet seen this done. I must be missing it.

Any help much appreciated. Thanks!

Davor Fikais

unread,
Feb 8, 2015, 8:38:48 AM2/8/15
to ope...@googlegroups.com
Hello!

I'm pretty sure you can't display more than one item in one line, but you could (in case all items are just text information) make one string item,which contents you could update with rule, and display it as text sitemap widget.

Best regards,
Davor

ge...@ge-volution.eu

unread,
Feb 9, 2015, 5:17:48 AM2/9/15
to ope...@googlegroups.com
To my knowledge this isn't possible (other than the strong concatenation approach).

An idea for you is to use the ValueColor attribute to show the temperature in a certain color depending on the sensors battery level (as in if it is getting low).  According to the documentation, you can use valuecolor on a sitemap entry with an item (and expression) different than the one being shown.  Check it out here...

https://github.com/openhab/openhab/wiki/Explanation-of-Sitemaps#dynamic-sitemaps

Thomas Eichstädt-Engelen

unread,
Feb 9, 2015, 6:31:24 AM2/9/15
to ope...@googlegroups.com
Hi,

To my knowledge this isn't possible (other than the strong concatenation approach).

that is true!

An idea for you is to use the ValueColor attribute to show the temperature in a certain color depending on the sensors battery level (as in if it is getting low).

Couldn’t have said it better :-)

Thanks,

Thomas E.-E.



--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab/b34a320c-c348-469e-af38-9eae428c0d77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

peter.h...@gmail.com

unread,
Mar 6, 2015, 8:15:33 AM3/6/15
to ope...@googlegroups.com

To display more then one value in one line use a rule like this:

Note:
TempAussen is temperature
LuftfAussen is humidity

rule:
rule "Klima Aussen"
       
when
               
TempAussen changed or
               
LuftfAussen changed or
               
Time cron "0 */5 * * * ?"
       
then
               
var Number Humi = LuftfAussen.state
               
var Number Temp = TempAussen.state
               
var Number Humi_r = (Math::round(Humi.floatValue))
               
var Number Temp_r = (Math::round(Temp.floatValue*10.0)/10.0)
               
// logInfo("Klima", "Aussen: " +Temp_r + " °C  " +Humi_r + " %")
                postUpdate
(Klima_Out, Temp_r + " °C  " + Humi_r + " %")
end


item:
String Klima_Out                "Temp Aussen [%s]"      <LEGtemperature>        (Out)
Number LuftfAussen     "Luftfeuchtigkeit Sitzplatz [%.0f %%]"  <LEGhumidity>   (Out, LuftfAussen)      {http="<[http://sens/meteolog.cgi?mode=data&sensor=th0:60000:REGEX([0-9]* th0 .*? (.*?) .*?)]" }
Number TempAussen      "Temperatur Sitzplatz [%.1f °C]"        <LEGtemperature>        (Out, TempAussen)       {http="<[http://sens/meteolog.cgi?mode=data&sensor=th0:60000:REGEX([0-9]* th0 (.*?) [0-9]* .*?)]" }


sitemap
Text item=Klima_Out label="Temperatur [%s]"

sitemap with colors (color based in TempAussen):
Text item=Klima_Out label="Temperatur [%s]" labelcolor=[TempAussen>=35="fuchsia",TempAussen>=30="darkviolett",TempAussen>=25="blueviolett",TempAussen>=20="darkblue",TempAussen>=15="mediumblue",TempAussen>=10="blue",TempAussen>=0="lightskyblue",TempAussen<0="lightsteelblue"]




Feel free to correct my bad java code,
Peter
Reply all
Reply to author
Forward
0 new messages