It is currently April 20th, 2024, 9:40 am

Webserver Temp & Humidity Local Network

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16148
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Webserver Temp & Humidity Local Network

Post by balala »

itskamel wrote: August 9th, 2020, 4:47 pm i figured out how to add another temp. and name them but it looks very dull how can i make a clean border of some sort and also the boxes can be the same size.
I suppose you've added a second String meter to the code, right? If you did, you can edit this second String meter, modifying its FontColor, SolidColor or whatever option would you like in order to make it to look otherwise as the first one.
itskamel wrote: August 9th, 2020, 4:47 pm on the left is my temp and humididy but you can see the boxes are not the same size. i am possibly looking do do something clean like on the right. And even though i have duplicated them i have them pointing to differnt ip address but they seem to be looking at one temp.
The modified code is needed. Please post it. I suppose you didn't modify the MeasureName options of the second String meter, so it is showing the same values as the first one, but to be sure we(I)'d need the code, so please post it.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Webserver Temp & Humidity Local Network

Post by Yincognito »

itskamel wrote: August 9th, 2020, 4:47 pm i figured out how to add another temp. and name them but it looks very dull how can i make a clean border of some sort and also the boxes can be the same size. i will post a picture to show what i am talking about. on the left is my temp and humididy but you can see the boxes are not the same size. i am possibly looking do do something clean like on the right. And even though i have duplicated them i have them pointing to differnt ip address but they seem to be looking at one temp.Image
For a clean border and boxes, take a look at the Shape meters (Rectangle, in particular, and of course Attribute Modifiers). For putting the "values" on the right of the box (while still having the "labels" on its left side), you'd have to "break" the meter in balala's code (or similar meters in yours) into either 2 or 4 such meters, holding the individual parts of the strings (e.g. each of the 2 labels and each of the 2 values) and use the StringAlign option to align the contents of the value meters to the right (make sure you properly read and understand how alignment works from the manual)...

Original meter:

Code: Select all

[MeterTempHum]
Meter=STRING
MeasureName=MeasureTemp
MeasureName2=MeasureTempUnit
MeasureName3=MeasureHumidity
MeasureName4=MeasureHumidityUnit
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Temp: %1%2#CRLF#Humidity: %3%4
would become something like (adjust positions or padding if needed; the 100 in X=100r from the value meters should generally be set to the width of the box / rectangle shape I mentioned above):

Code: Select all

[MeterTempLabel]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Temp:

[MeterTempValue]
Meter=STRING
MeasureName=MeasureTemp
MeasureName2=MeasureTempUnit
X=100r
Y=0r
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Text=%1%2

[MeterHumLabel]
Meter=STRING
X=0
Y=0R
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Humidity:

[MeterHumValue]
Meter=STRING
MeasureName=MeasureHumidity
MeasureName2=MeasureHumidityUnit
X=100r
Y=0r
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Text=%1%2
P.S. This is untested code, presented only as a direction in which you should go, so it's possible that minor adjustments would be required.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
itskamel
Posts: 8
Joined: July 25th, 2020, 10:26 pm

Re: Webserver Temp & Humidity Local Network

Post by itskamel »

this is what i have so far, both are working showing temps. but not sure if i have done it correctly.

Code: Select all


[Rainmeter]
DynamicWindowSize=1

[Variables]

;rack temp below

[MeasureTempCapture]
Measure=WebParser
URL=http://192.168.1.35
RegExp=(?siU)<span class="dht-labels">Temperature</span>.*<span id="temperature">(.*)</span>.*<sup class="units">(.*)</sup>.*<span class="dht-labels">Humidity</span>.*<span id="humidity">(.*)</span>.*<sup class="units">(.*)</sup>
DynamicVariables=1
UpdateRate=600

[MeasureTemp]
Measure=WebParser
URL=[MeasureTempCapture]
StringIndex=1

[MeasureTempUnit]
Measure=WebParser
URL=[MeasureTempCapture]
StringIndex=2
DecodeCharacterReference=1

[MeasureHumidity]
Measure=WebParser
URL=[MeasureTempCapture]
StringIndex=3

[MeasureHumidityUnit]
Measure=WebParser
URL=[MeasureTempCapture]
StringIndex=4

[MeterTempHum]
Meter=STRING
MeasureName=MeasureTemp
MeasureName2=MeasureTempUnit
MeasureName3=MeasureHumidity
MeasureName4=MeasureHumidityUnit
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Rack Temp: %1%2#CRLF#Rack Humidity: %3%4


;Server Case temp below



[MeasureTempCapture2]
Measure=WebParser
URL=http://192.168.1.36
RegExp=(?siU)<span class="dht-labels">Temperature</span>.*<span id="temperature">(.*)</span>.*<sup class="units">(.*)</sup>.*<span class="dht-labels">Humidity</span>.*<span id="humidity">(.*)</span>.*<sup class="units">(.*)</sup>
DynamicVariables=1
UpdateRate=600

[MeasureTemp2]
Measure=WebParser
URL=[MeasureTempCapture2]
StringIndex=1

[MeasureTempUnit2]
Measure=WebParser
URL=[MeasureTempCapture2]
StringIndex=2
DecodeCharacterReference=1

[MeasureHumidity2]
Measure=WebParser
URL=[MeasureTempCapture2]
StringIndex=3

[MeasureHumidityUnit2]
Measure=WebParser
URL=[MeasureTempCapture2]
StringIndex=4

[MeterTempHum2]
Meter=STRING
MeasureName=MeasureTemp2
MeasureName2=MeasureTempUnit2
MeasureName3=MeasureHumidity2
MeasureName4=MeasureHumidityUnit2
X=0
Y=39
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Server Temp: %1%2#CRLF#Server Humidity: %3%4






Text=Temp: %1%2#CRLF#Humidity: %3%4
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Webserver Temp & Humidity Local Network

Post by Yincognito »

itskamel wrote: August 10th, 2020, 1:05 pm this is what i have so far, both are working showing temps. but not sure if i have done it correctly.
And you'll never know if you don't try the suggested advice. :confused:
Working example:

Code: Select all

[Variables]
BoxWidth=150

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

;rack temp below

[MeasureTempCapture]
Measure=WebParser
URL=http://192.168.1.35
RegExp=(?siU)<span class="dht-labels">Temperature</span>.*<span id="temperature">(.*)</span>.*<sup class="units">(.*)</sup>.*<span class="dht-labels">Humidity</span>.*<span id="humidity">(.*)</span>.*<sup class="units">(.*)</sup>
DynamicVariables=1
UpdateRate=600

[MeasureTemp]
Measure=WebParser
URL=[MeasureTempCapture]
StringIndex=1

[MeasureTempUnit]
Measure=WebParser
URL=[MeasureTempCapture]
StringIndex=2
DecodeCharacterReference=1

[MeasureHumidity]
Measure=WebParser
URL=[MeasureTempCapture]
StringIndex=3

[MeasureHumidityUnit]
Measure=WebParser
URL=[MeasureTempCapture]
StringIndex=4

[MeterBox]
X=0
Y=0
Meter=Shape
Shape=Rectangle 0.5,0.5,150,32 | StrokeWidth 1 | Stroke Color 255,255,255,255 | Fill Color 0,0,0,150

[MeterTempLabel]
Meter=STRING
X=0r
Y=0r
FontColor=220,220,220,255
FontEffectColor=0,0,0,255
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Padding=5,0,5,0
Text=Rack Temp:

[MeterTempValue]
Meter=STRING
MeasureName=MeasureTemp
MeasureName2=MeasureTempUnit
X=150r
Y=0r
FontColor=220,220,220,255
FontEffectColor=0,0,0,255
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Padding=5,0,5,0
;Text=%1%2
Text=000.00°C

[MeterHumLabel]
Meter=STRING
X=-150r
Y=0R
FontColor=220,220,220,255
FontEffectColor=0,0,0,255
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Padding=5,0,5,0
Text=Rack Humidity:

[MeterHumValue]
Meter=STRING
MeasureName=MeasureHumidity
MeasureName2=MeasureHumidityUnit
X=150r
Y=0r
FontColor=220,220,220,255
FontEffectColor=0,0,0,255
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Padding=5,0,5,0
;Text=%1%2
Text=000.00°C

;Server Case temp below



[MeasureTempCapture2]
Measure=WebParser
URL=http://192.168.1.36
RegExp=(?siU)<span class="dht-labels">Temperature</span>.*<span id="temperature">(.*)</span>.*<sup class="units">(.*)</sup>.*<span class="dht-labels">Humidity</span>.*<span id="humidity">(.*)</span>.*<sup class="units">(.*)</sup>
DynamicVariables=1
UpdateRate=600

[MeasureTemp2]
Measure=WebParser
URL=[MeasureTempCapture2]
StringIndex=1

[MeasureTempUnit2]
Measure=WebParser
URL=[MeasureTempCapture2]
StringIndex=2
DecodeCharacterReference=1

[MeasureHumidity2]
Measure=WebParser
URL=[MeasureTempCapture2]
StringIndex=3

[MeasureHumidityUnit2]
Measure=WebParser
URL=[MeasureTempCapture2]
StringIndex=4

[MeterBox2]
X=0
Y=35
Meter=Shape
Shape=Rectangle 0.5,0.5,150,32 | StrokeWidth 1 | Stroke Color 255,255,255,255 | Fill Color 0,0,0,150

[MeterTempLabel2]
Meter=STRING
X=0r
Y=0r
FontColor=220,220,220,255
FontEffectColor=0,0,0,255
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Padding=5,0,5,0
Text=Server Temp:

[MeterTempValue2]
Meter=STRING
MeasureName=MeasureTemp2
MeasureName2=MeasureTempUnit2
X=150r
Y=0r
FontColor=220,220,220,255
FontEffectColor=0,0,0,255
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Padding=5,0,5,0
;Text=%1%2
Text=000.00°C

[MeterHumLabel2]
Meter=STRING
X=-150r
Y=0R
FontColor=220,220,220,255
FontEffectColor=0,0,0,255
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Padding=5,0,5,0
Text=Server Humidity:

[MeterHumValue2]
Meter=STRING
MeasureName=MeasureHumidity2
MeasureName2=MeasureHumidityUnit2
X=150r
Y=0r
FontColor=220,220,220,255
FontEffectColor=0,0,0,255
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Padding=5,0,5,0
;Text=%1%2
Text=000.00°C
Your job (yes, you have one) is to uncomment (as in remove the starting ; from the line) the Text=%1%2 lines and comment (add a starting ; at the beginning of the line) or remove entirely my Text=000.00°C lines, since the latter are there just to be able to test your code without the meters being populated with the data that only works in your own local environment.

Take care to modify the X and Y options if you adjust the size of the rectangle shapes in the [Box] and [Box2] meters. Later on, when you'll know more, maybe you'll use the BoxWidth variable I created at the start of the code, so that you won't have to modify stuff like the ones mentioned above each time you adjust something they depend on.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16148
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Webserver Temp & Humidity Local Network

Post by balala »

itskamel wrote: August 10th, 2020, 1:05 pm this is what i have so far, both are working showing temps. but not sure if i have done it correctly.
Beside Yincognito's reply note that it's not possible to have duplicated options (nor duplicated section names, nor anything else). You've added two Text otions to the [MeterTempHum2] meter. The meter uses only the first one, so Text=Temp: %1%2#CRLF#Humidity: %3%4 is simply ignored.
Otherwise have Yincognito's reply helped?
itskamel
Posts: 8
Joined: July 25th, 2020, 10:26 pm

Re: Webserver Temp & Humidity Local Network

Post by itskamel »

Thank you guys. i will post back if i have some more trouble i am working out of town at the moment so i wont be back to my pc. until thursday. tahnk you both for the replys. I will look at the code on Thursday.