Timezone settings based on region?

Question here based on findings using the @Ap15e LSI plugin.
My scenes that are set using sunrise and sundown work fine give or take 10 or 15 minutes.

However, using the LSI plugin, Vera reports timezone set to 0

my questions are:

  1. can i doublecheck that somewhere and if so, where and how
  2. Does anyone know why Vera would report 0 when the regional set is there and works?
    Probably @Ap15e could answer this best, but if you have an idea, a hint is apreciated.
  3. If i were to set my timezone manually, how would i go about doing that?

@Henk,

LSI uses the Luup/Lua extensions to expose whatever internal data is available. It appears that the luup.timezone variable contains 0, rather than the promised timezone selected under ‘Location’.

Potentially the timezone stuff is managed here:

cat /etc/TZ
cat /etc/TZ-full

See also:

cat /mios/www/cgi-bin/cmh/timezone_apply.sh

@oTi@

I understand LSI is based on Luup and therefor uses Luup variables.
Sounds like a bug to me.

Anyway, I’ll check your suggestions and report back

Edit:
@Ap15e
If a bug is present and we know about it, maybe its a suggestion to (temporarily) not show the timezone in LSI as it could confuse users. Just util the big is fixed?

Also, what's the use of LSI if it doesn't give accurate system info?

Well, the question is:
What’s the use of the Luup Lua Extensions if the LLE don’t work as ‘specified’?

[quote=“Ap15e, post:4, topic:168442”]

Also, what’s the use of LSI if it doesn’t give accurate system info?

Well, the question is:
What’s the use of the Luup Lua Extensions if the LLE don’t work as ‘specified’?[/quote]

Hence my suggestion to file a bug so we can all benefit from the improvements MCV makes. After all, they can’t fix it if they don’t know it’s broken… Right?

OK, good. Although, I don’t understand the logic in your response. Question 2 must somehow have been rhetorical, or you didn’t click on the link.

Sounds like a bug to me. Also, what's the use of LSI if it doesn't give accurate system info?
Yep. That was @Ap15e's suspicion all along. A bug in the extensions (the provided library of pre-defined variables and calls), not LSI. LSI is as useful as can be.

[quote=“oTi@, post:2, topic:168442”]@Henk,

cat /etc/TZ cat /etc/TZ-full [/quote]

Ok that does return the correct timezone in both occasions, so Vera works with the timezone corresponding to my region… Good… so there IS a bug in the luup/lua variable set. Will check if @Ap15e had logged it, else i will.

See also: [code] cat /mios/www/cgi-bin/cmh/timezone_apply.sh [/code]

Now here it gets interesting… in Vera2 i think NTP wasnt supported anymore as Vera2 uses Rdate
referring to these threads:
http://forum.mios.com/index.php?topic=6400.0
http://forum.micasaverde.com/index.php?topic=5591.0

However, the script you mentions DOES set NTP. Wonder if its an old script thats remnant from the time only Vera1 hardware existed or some other reason…

Here’s the code part im referring to:

# Set the ntpdate servers
if [[ "$FORM_ntphostname" != "" ]] ;then
        Cfg=`uci show ntpclient | grep 'hostname=' | head -1 | cut -d'.' -f2`
        uci set ntpclient.$Cfg.hostname="$FORM_ntphostname"
fi

/etc/init.d/ntpclient restart

Sounds good.

Yeah, I did see the NTP stuff. Have not looked at it. I told Vera my timezone, and she has been showing the right time, so it is not high on my list of things to look at.

Sounds good.[/quote]

Bug logged:
http://bugs.micasaverde.com/view.php?id=1495

luup.timezone’s value is taken from the user_data. Check the timezone value in the user_data.

@mcvflorin
Sure, is that the user_data2 file?

–edit–
Here is my output for user_data2:

<?xml version="1.0"?>
<root timezone="0" firmware_version="1" TemperatureFormat="C" PK_City="xxxxx" longitude="x.yyyyyy" latitude="xx.yyyyyy" KwhPrice="" City_description="xxxxx" FirstSave="-1067418605" StartupCode="" ServerBackup="0" UpnpScanning="0" currency="€" PluginsSynced="1" DeviceSync="1306594621" zwave_heal="1306599871" energy_dev_log="" UnassignedDevices="0" AutomationDevices="0" BuildVersion="*1.1.1245*" SvnVersion="*Revision: 4489*" model="SERCOMM NA401" local_udn="uuid:xxxxxx-xxxxx-xxxx-0000-0000000xxxxx" PK_AccessPoint="2xxxxx
" RA_Server="fwd1.mios.com" RA_Server_Back="fwd2.mios.com" DataVersion="130796001" LoadTime="1307130796">
<devices>

So also my user data reports 0… incorrect!

On UI3 and UI4 user_data2 is the same as user_data (I never used user_data2 because I find it more convenient to write user_data).

Set your location again in the Location window to make sure it is saved. If this doesn’t work, try setting other timezone and see if that works.

[quote=“mcvflorin, post:12, topic:168442”]On UI3 and UI4 user_data2 is the same as user_data (I never used user_data2 because I find it more convenient to write user_data).

Set your location again in the Location window to make sure it is saved. If this doesn’t work, try setting other timezone and see if that works.[/quote]

Timezone set from Amsterdam to Melbourne, Canberra, Sydney, saved, refreshed and checked user_data:
Timezone set to 0

Timezone set back to “Amsterdam”, saved, refreshed and checked user_data again:
Timezone set to 0 (root timezone=“0”)

Any other suggestions?

Sounds good.[/quote]

Bug logged:
http://bugs.micasaverde.com/view.php?id=1495[/quote]

This is related to this probem:
http://bugs.micasaverde.com/view.php?id=931

It shouldn’t impact Vera itself, since it can work it out from the other data present, and looks up via the OS-based Timezone infrastructure (from what Javier indicated)

It will impact the Lua-based code that we write ('931 came out of some issues I was having with attempting to use CalDAV where I needed the TZ, Javier filed it for me). Work-arounds involve reading [tt]/etc/TZ[/tt] or [tt]/etc/TZ-full[/tt], and parsing it out.

Sounds good.[/quote]

Bug logged:
http://bugs.micasaverde.com/view.php?id=1495[/quote]

This is related to this probem:
http://bugs.micasaverde.com/view.php?id=931

It shouldn’t impact Vera itself, since it can work it out from the other data present, and looks up via the OS-based Timezone infrastructure (from what Javier indicated)

It will impact the Lua-based code that we write ('931 came out of some issues I was having with attempting to use CalDAV where I needed the TZ, Javier filed it for me). Work-arounds involve reading [tt]/etc/TZ[/tt] or [tt]/etc/TZ-full[/tt], and parsing it out.[/quote]

@Guessed

Workarounds are fine (but in this case sound quite complex) but are just a patch until the real bugs get fixed in my opinion. I got word from @mcvflorin yesterday that they would look into the problem and try to fix it. Maybe they can then also take into account bug 931.

Some of the stuff here done by the usercommunity and experienced guys like yourself far exceed the capabilities of a regular user who buys an “off the shelf product” and expects it to work with little more than a user guide and some hints and tips from a FAQ / Wiki.