i´m using Rainmeter to show my tesla state.
querying teslafi.com by webparser i get all the needed information.
But 1st the meterTitle will only show %1
And 2nd measureodometerKmh will show Kilometer without leading Zeros. So sometimes it will show Kilometers like: 23.14,5 and should be 23.014,5
Is anyone able to help me?
thanks in advance und many regards
Enno
Code: Select all
; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------
[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Update=1000
Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
BackgroundMargins=0,34,0,14
[Metadata]
; Contains basic information of the skin.
Name=Teslafi.com
Author=Enno
Information=Shows the state of a Tesla using teslafi.com
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0
[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
[measureSite]
; This measure returns the overall status of the car
Measure=Plugin
Plugin=WebParser
URL=https://www.teslafi.com/feed.php?token=***TOKEN***
UpdateRate=300
RegExp=(?siU)"display_name":"(.*)",.*"time_to_full_charge":"(.*)",.*"charge_current_request":"(.*)",.*"charger_power":"(.*)",.*"usable_battery_level":"(.*)",.*"est_battery_range":"(.*)",.*"inside_temp":"(.*)",.*"odometer":"(.*)",
;1 = display_name
;2 = time to full charge
;3 = charge_current_request
;4 = charger_power
;4 = usable battery level
;5 = est_battery_range
;6 = inside temp
;7 = odometer
[measureName]
Measure=Plugin
Plugin=WebParser
URL=[measureSite]
StringIndex=1
Substitute="":"K.I.T.T. is sleeping"
[measureTimeToFullCharge]
Measure=Plugin
Plugin=WebParser
URL=[measureSite]
StringIndex=2
[measurehourToFullCharge]
Measure=Calc
Formula=Trunc(measureTimeToFullCharge)
[measureminuteToFullCharge]
Measure=Calc
Formula=Trunc(Frac(measureTimeToFullCharge)*60)
[measureChargeCurrentRequest]
Measure=Plugin
Plugin=WebParser
URL=[measureSite]
StringIndex=3
[measureChargePower]
Measure=Plugin
Plugin=WebParser
URL=[measureSite]
StringIndex=4
[measureactualSoC]
Measure=Plugin
Plugin=WebParser
URL=[measureSite]
StringIndex=5
[measureestBatteryRange]
Measure=Plugin
Plugin=WebParser
URL=[measureSite]
StringIndex=6
[measureestBatteryRangeKm]
Measure=Calc
Formula=((measureestBatteryRange)*1.60934)
[measureinsideTemp]
Measure=Plugin
Plugin=WebParser
URL=[measureSite]
StringIndex=7
[measureodometer]
;Kilometerstand
Measure=Plugin
Plugin=WebParser
URL=[measureSite]
StringIndex=8
[measureodometerKmt]
;Kilometerstand vor tausendertrennzeichen
Measure=Calc
Formula=Trunc(measureodometer*1.60934 / 1000)
[measureodometerKmh]
;Kilometerstand nach tausendertrennzeichen
Measure=Calc
Formula=Trunc(Frac(measureodometer*1.60934 / 1000)*1000)
[measureodometerKmk]
;Kilometerstand nach 1 Stelle nach Komma
Measure=Calc
Formula=Trunc(Frac(measureodometer*1.60934)*10)
[measureDisplayName]
Measure=measureName
Measure2=measureChargeCurrentRequest
Measure3=measureChargePower
IfCondition=(%3 > 0)
IfTrueAction=[!SetOption meterTitle Text "%1 lädt mit %2A/%3KW"]
; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------
[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1
[styleLeftText]
StringAlign=Left
; Meters using styleLeftText will be left-aligned.
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1
[styleRightText]
StringAlign=Right
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1
[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15
[styleSeperator]
SolidColor=255,255,255,15
; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------
[meterTitle]
Meter=String
MeterStyle=styleTitle
MeasureName=measureDisplayName
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=100
Y=12
W=190
H=18
Text=%1
[meterodometerKmLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40
W=190
H=14
Text=Kilometerstand:
[meterodometerKm]
Meter=String
MeterStyle=styleRightText
MeasureName=measureodometerKmt
MeasureName2=measureodometerKmh
MeasureName3=measureodometerKmk
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text="%1.%2,%3 km"
; %1 stands for the value of MeasureName (measureIP in this case).
[meterinsideTempLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=60
W=190
H=14
Text=Temperatur:
[meterinsideTemp]
Meter=String
MeterStyle=styleRightText
MeasureName=measureinsideTemp
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text="%1 °C"
; %1 stands for the value of MeasureName (measureIP in this case).
[meteractualSoCLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=80
W=190
H=14
Text=SoC:
[meteractualSoc]
Meter=String
MeterStyle=styleRightText
MeasureName=measureactualSoC
MeasureName2=measureestBatteryRangeKm
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text="%1 % = %2 km"
; %1 stands for the value of MeasureName (measureIP in this case).
[meterTimeToFullChargeLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=100
W=190
H=14
Text=Zeit bis Voll:
[meterTimeToFullCharge]
Meter=String
MeterStyle=styleRightText
MeasureName=measurehourToFullCharge
MeasureName2=measureminuteToFullCharge
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text="%1 h %2 min"
; %1 stands for the value of MeasureName (measureIP in this case).