It is currently April 18th, 2024, 2:07 am

Trying to create TimeStamp from OnChangeValue

Get help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Trying to create TimeStamp from OnChangeValue

Post by Mor3bane »

Hi, so I have a weather meter and I wish to create a timestamp for when the meter last updated.

This is what I got - so far it only showing the actual %1 rather than the time value.

Not sure what's wrong, hopefully it is nice and obvious :P

Code: Select all

[MeterCondCurrent]
Meter=STRING
MeasureName=MeasureConditionsCurrent
FontFace=#Font#
FontColor=#Color#
FontSize=17
StringAlign=Center
X=167
Y=192
W=200
H=240
Text=%1
OnChangeAction=[!WriteKeyValue "Timestamp" "Text" "[StringTimestamp]"]
Antialias=1

[MeasureTimestamp]
Measure=Time
Format=%I:%M

[StringTimestamp]
Meter=String
MeasureName=MeasureTimestamp
Text=%1
Antialias=1

[Timestamp]
Meter=String
FontFace=#Font#
FontColor=#Color#
FontSize=20
StringAlign=Center
X=167
Y=86
Text=
Antialias=1
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to create TimeStamp from OnChangeValue

Post by balala »

The OnChangeAction options can't be used on meters, just on measures. You did use a such option on the [MeterCondCurrent] meter. Instead you could use the OnUpdateAction, which can be used on meters.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to create TimeStamp from OnChangeValue

Post by balala »

And one more: [StringTimestamp] is a meter. There is no reason to use a Text=[StringTimestamp] option in a String meter, because a String meter doesn't have a value which could be displayed by another String meter. Even if the above issue was fixed (so, the OnChangeAction option of the [MeterCondCurrent] meter was replaced with an OnUpdateAction), in the [Timestamp] meter you'll get the Text=[StringTimestamp] option, which is meaningless. In plus, even if it would be used correctly, a such option would require DynamicVariables=1 option, which is missing.
To be honest, for me it's not clear enough so far what you would like to do.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Trying to create TimeStamp from OnChangeValue

Post by Mor3bane »

balala wrote: To be honest, for me it's not clear enough so far what you would like to do.
I am attempting to have my weather meter display the time it last updated.

E.g.

3:40am
Windy and clear
27C
etc...

then on the next parse update: (where the time remains static)

4:00am
Calm
29C
etc...
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Trying to create TimeStamp from OnChangeValue

Post by fonpaolo »

Mor3bane wrote:I am attempting to have my weather meter display the time it last updated.
...
If you're using Weather.com, it's already in the data, you only need a WebParser measure. ;-)
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Trying to create TimeStamp from OnChangeValue

Post by eclectic-tech »

fonpaolo wrote:If you're using Weather.com, it's already in the data, you only need a WebParser measure. ;-)
Fonpaolo is correct if you want to know the time the data was updated.

Is that what you want?

Or do you want to know what time it was on your system the last time the webparser measure was updated?
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to create TimeStamp from OnChangeValue

Post by balala »

Mor3bane wrote:I am attempting to have my weather meter display the time it last updated.
I'm not quite sure I understood: do you want to show when the last data parse happened? Am I correct?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Trying to create TimeStamp from OnChangeValue

Post by jsmorley »

The time you "asked for" the weather is <tm> in:

<loc id="USVA0944">
<dnam>Fort Hunt, VA</dnam>
<tm>9:07 AM</tm>
<lat>38.73</lat>
<lon>-77.06</lon>
<sunr>7:17 AM</sunr>
<suns>5:27 PM</suns>
<zone>-5</zone>
</loc>

The time the weather was "observed" is <lsup> in:

<cc>
<lsup>1/29/18 8:56 AM EST</lsup>