Timezone in mycroft.conf


#1

I wanted to know the replacements to put into the “timezone” section of the mycroft.conf file in order to change it to my local time (dstoffset and offset values specifically) since the servers are not updating them currently for devices.

I am wanting to change the values to Jacksonville, FL, (Eastern Standard Time) and cannot find the references needed to substitute for the dstoffset and offset in particular.

As of now, the default looks this this (and I also know that I’ll have to change the city/state/country and GPS coords as well):

// Location where the system resides // NOTE: Although this is set here, an Enclosure can override the value. // For example a mycroft-core running in a car could use the GPS. // Override: REMOTE "location": { "city": { "code": "Lawrence", "name": "Lawrence", "state": { "code": "KS", "name": "Kansas", "country": { "code": "US", "name": "United States" } } }, "coordinate": { "latitude": 38.971669, "longitude": -95.23525 }, "timezone": { "code": "America/Chicago", "name": "Central Standard Time", "dstOffset": 3600000, "offset": -21600000 } }


#2

So, doing some checking here, it seems like the interesting part would be the offset parameter. It seems like it’s milliseconds from GMT.

Florida should be at -5 hours: −5×60×60×1000 = −18000000
dstOffset is simply how much time is changed for day light saving, in this case an hour.

Hmm, looking at the datetime skill it looks like it should just work if you set the code to “US/Eastern”

/Åke


#3

It’s not even recognizing my changes, just giving me a type error when I change it.

mycroft-audio failed to start. The log is below:

    config = ConfigurationManager.get().get("websocket")
  File "/home/aeryck/mycroft-core/mycroft/configuration/__init__.py", line 279, in get
    ConfigurationManager.load_defaults()
  File "/home/aeryck/mycroft-core/mycroft/configuration/__init__.py", line 248, in load_defaults
    RemoteConfiguration.load(ConfigurationManager.__config)
  File "/home/aeryck/mycroft-core/mycroft/configuration/__init__.py", line 147, in load
    RemoteConfiguration.validate(config)
  File "/home/aeryck/mycroft-core/mycroft/configuration/__init__.py", line 143, in validate
    raise TypeError
TypeError

I just reverted it to the default config, so I guess it’s just a matter of patience for the servers to recognize it once they come back up again.


#4

Where are you doing your changes? additions should be done in ~/.mycroft/mycroft.conf and needs to be valid json so for you

{
  location: {
    "timezone": {
      "code": "US/Eastern",
      "name": "Eastern Time",
      "dstOffset": 3600000,
      "offset": -21600000
    }
  }
}

Also there’s a program called jsonlint that you can use to check the config for errors.


#5

Yes it did recognize it when I entered just the timezone info like you have listed. What it failed to do was register any location when I changed it for the city/state and lat/long info. I just made those back to the default Lawrence once again and kept the timezone info and that part works fine.


#6

Just trying to follow what is shown above.
In this case is the ~ for /home/mycroft or /home/pi?
My /home/mycroft/.mycroft/mycroft.conf only has this information in it.

{ "tts": { "mimic": { "path":"/usr/local/bin/mimic" } }, "SkillInstallerSkill": { "path": "/usr/local/bin/msm" } }
I can’t seem find any other mycroft.conf files to update like the example shown above.
Thanks


#7

How do you change the time zone on a mark? Why are we changing a config file, shouldn’t this be dynamic?


#8

Hi,

The easiest way right now is to set the location for the device using https://home.mycroft.ai Goto device click on your mark-1 device and enter the location there. (The location service have been a bit flakey the last weeks hence the editing of local config file… but it should be pretty stable again)

I think the rationale for having this as a fixed setting and not a dynamic setting was due to the occasional failures and the fact that most Mycroft units doesn’t move a lot.

I know people are working on skills to automatically set the location.


#9

Hi,

I am new user of mycroft, testing it on a RPI with picroft.

My unit is registered on https://home.mycroft.ai, but I cannot enter the “Location” there. I try to type “Sweden” or “Stockholm, Sweden” but neither is possible to save.

Is the Location supposed to work?


#10

Hej Per!

The Location is supposed to work, I’ve got mine set to Eskilstuna.

However the UI is kind of quirky :confused:

This works for me (in Firefox and Chrome):
When you start typing Stockholm you should get a drop-down with suggestions.
Click the “Stockholm, Sweden” option.
At the top of the page you should now get a banner where you can save the changes.

Med vänliga hälsningar
/Åke


#11

Hej Åke,

I didn’t get any options when typing.
But i opened the site in a new browser and then it worked! Thanks for the tip!

Now, next issue…I asked Mycroft to configuration update and he did. But he still cannot tell the time or weather, because he doesn’t know the location.

What have I missed?

14:59:05.850 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {"session": "5fc7305a-9c05-451e-8793-0a9678e05207", "utterance": "hey mycroft"}, "type": "recognizer_loop:wakeword", "context": null}
14:59:07.709 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {"lang": "en-US", "session": "5fc7305a-9c05-451e-8793-0a9678e05207", "utterances": ["what is the time"]}, "type": "recognizer_loop:utterance", "context": null}
14:59:07.731 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {"confidence": 1.0, "target": null, "intent_type": "1017122086:SpeakIntent", "TimeKeyword": "time", "__tags__": [{"end_token": 0, "start_token": 0, "confidence": 1.0, "from_context": false, "entities": [{"confidence": 1.0, "data": [["what", "Give"], ["what", "QueryKeyword"], ["what", "GetKeyword"], ["What", "Concept"], ["what", "query"], ["what", "What"]], "match": "what", "key": "what"}], "key": "what", "match": "what"}, {"end_token": 2, "start_token": 2, "from_context": false, "entities": [{"confidence": 1.0, "data": [["time", "TimeKeyword"]], "match": "time", "key": "time"}], "key": "time", "match": "time"}], "QueryKeyword": "what", "utterance": "what is the time"}, "type": "1017122086:SpeakIntent", "context": {"target": null}}
14:59:07.753 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {"handler": "TimeSkill.handle_speak_intent"}, "type": "mycroft.skill.handler.start", "context": null}
14:59:07.761 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {"expect_response": false, "utterance": "I could not find the timezone for None"}, "type": "speak", "context": null}
14:59:07.769 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {"expect_response": false, "utterance": "None"}, "type": "speak", "context": null}
14:59:07.778 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {"expect_response": false, "utterance": "I could not find the timezone for None"}, "type": "speak", "context": null}
14:59:07.789 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {"expect_response": false, "utterance": "An error occurred while processing a request in Time Skill"}, "type": "speak", "context": null}
14:59:07.797 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {"exception": "'NoneType' object is not iterable", "handler": "Time Skill"}, "type": "mycroft.skill.handler.complete", "context": null}

#12

Update:

I checked web_config_cache.json, and it held information about city, country and timezone. Still mycroft couldn’t tell the time.

Then I did a reboot of the Pi, and mycroft knew where he was! I have no idea if this is the procedure or not, just letting you know!

/Per


#13

Thanks for letting us know, I’ll look at it. the intended behavior is that the device should be updated as soon as the “update config” intent is executed.

Glad that you have it working at least :slight_smile: