Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Fixing History Timezones

If for some reason the trends aren't showing up. Its likely that the his tz (timezone) doesn't match the point tz. To fix this, follow the below steps. Also, history is still being collected, its just not matching the same point timezone.

...

We want to set everything to Indianapolis tz. Since our his tz is already set to Indianapolis, we go to the site and select the tz to be Indianapolis. Then click on the Sync Time zones For All Points. Thats it, both should be matching now.Image Removed

...

Option 2: Setting all to Los Angeles

We want to set everything to Los Angeles tz. Currently the his tz is set to Indianapolis, so the user would need to match the point tz to the his tz. The user will follow Option 1 first to match the both his and point timezones. Once done doing Option 1, we'll need to rewrite the tz on the his data to Los Angeles. To do this, go to folio and run the query below for all points (if you have multiple sites with different tzs, we recommend using siteRef in the query).

Query: readAll readAll(point).each x=> hisRewrite(x->id) (val, ts) => [ts.toTimeZone("Los_Angeles"), val]

Note: Change "Los_Angeles" part to what timezone you want it to be. Look below on how to know which timezone to use.

...

If the query isn't working for you because your points have different timezones (e.g. half are Los_Angeles and half are Indianapolis) then use this query, it will return those that were in the previous timezone:

Query: readAll(point and his).findAll(x=> try do hisRewrite(x->id) (val, ts) => [ts.toTimeZone("Los_Angeles"), val] ; false end catch true)

Changing to new timezone

If for some reason the tz isn't what you want and you want to change it. The user would first change the his tz and then the point tz. This is for those that don't have the above issue and everything is working fine.

...

We'll need to rewrite the tz on the his data to Los Angeles (or whatever timezone you want). To do this, go to folio and run the query below for all points (if you have multiple sites with different tzs, we recommend using siteRef in the query).

Query: readAll readAll(point).each x=> hisRewrite(x->id) (val, ts) => [ts.toTimeZone("Los_Angeles"), val]

Note: Change "Los_Angeles" part to what timezone you want it to be. Look below on how to know which timezone to use.

...

Then run a hisRead query for that point to get the below error: read read(id==@1ffcb9fa-02e6aeba).hisRead(today)

...

That will let you know what which timezone its using. In this case its Indianapolis.

...

America/Indian/Know => Knox => Query: readAll readAll(point).each x=> hisRewrite(x->id) (val, ts) => [ts.toTimeZone("Knox"), val]

America/Lima => Lima => Query: readAll readAll(point).each x=> hisRewrite(x->id) (val, ts) => [ts.toTimeZone("Lima"), val]

America/Los_Angeles => Los_Angeles => Query: readAll readAll(point).each x=> hisRewrite(x->id) (val, ts) => [ts.toTimeZone("Los_Angeles"), val]

Image Removed

...