Author Topic: Time variable in message  (Read 1212 times)

Rip

  • Newbie
  • *
  • Posts: 23
Time variable in message
« on: September 07, 2009, 03:33:33 AM »
I'm using %%input%% in email messages from IOBridge actions to notify me of analog states.

I'm trying to track down the delay in receiving messages and also be notified of the time of state changes.

Is there a %%time%% variable, or similar, that I can use in message actions?

iobridge

  • Administrator
  • Hero Member
  • *****
  • Posts: 669
    • ioBridge Support
Re: Time variable in message
« Reply #1 on: September 07, 2009, 10:40:40 AM »
Here are three replacements you can make (either in the subject, message, or both):

%%input%%
%%condition%%
%%datetime%%

"condition" is the analog expression that caused the action to send a message.

"datetime" is the format of 2009-09-07 14:35:31 (GMT/UTC). I am working on re-writing the time with your timezone settings. Getting to work on all of the time zones plus day light savings adjustments has proved to be difficult. Once we get the local time zone adjusting the time, I will add it to the Wiki.
ioBridge Support
Community Team

whitehexagon

  • Full Member
  • ***
  • Posts: 118
    • SunshineApps
Re: Time variable in message
« Reply #2 on: September 07, 2009, 01:15:18 PM »
do these variables also work for the LCD?  would be nice to specify format %%HH:mm:ss%% etc :)

http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
Home Automation via a native iPhone application.  Search for HomeWatch in iTunes.

Rip

  • Newbie
  • *
  • Posts: 23
Re: Time variable in message
« Reply #3 on: September 08, 2009, 04:01:42 AM »
I've tried that and just get '%%datetime%%' in the message rather than the variable time.

Here's my action:

Subject: Garage Open %%datetime%%
Message: Garage Open %%datetime%%
Module 24xxxxxxx / Channel 1 / Digital Input On


iobridge

  • Administrator
  • Hero Member
  • *****
  • Posts: 669
    • ioBridge Support
Re: Time variable in message
« Reply #4 on: September 08, 2009, 07:59:17 AM »
Whoops, I only added that to analog actions. I just updated it for analog and digital message actions.
ioBridge Support
Community Team

iobridge

  • Administrator
  • Hero Member
  • *****
  • Posts: 669
    • ioBridge Support
Re: Time variable in message
« Reply #5 on: September 08, 2009, 08:05:57 AM »
I can add this to the serial LCD actions as well. Let me work on that.
ioBridge Support
Community Team

iobridge

  • Administrator
  • Hero Member
  • *****
  • Posts: 669
    • ioBridge Support
Re: Time variable in message
« Reply #6 on: September 08, 2009, 08:19:19 AM »
I added it for the serial smart board and serial out widgets.

%%datetime%% is replaced with with the full date and time (GMT/UTC). I will add some additional parameters overtime.

Let me know if this is a start...
ioBridge Support
Community Team

Rip

  • Newbie
  • *
  • Posts: 23
Re: Time variable in message
« Reply #7 on: September 08, 2009, 08:39:44 AM »
Thanks for sorting that.

I'm just testing it now.

Does the time come from the IOBridge or is it when your servers see the change?

iobridge

  • Administrator
  • Hero Member
  • *****
  • Posts: 669
    • ioBridge Support
Re: Time variable in message
« Reply #8 on: September 08, 2009, 10:03:39 AM »
It is the server time, but both times are within a second of each other.

I will make it adjust to your timezone settings in a future update.
ioBridge Support
Community Team

whitehexagon

  • Full Member
  • ***
  • Posts: 118
    • SunshineApps
Re: Time variable in message
« Reply #9 on: September 09, 2009, 02:45:11 AM »
I can add this to the serial LCD actions as well. Let me work on that.

Works great!!  Nice to have ISO format for the default :)
To avoid supporting anything as big as simple date format, maybe you could use variables like:
%%HH%%
%%mm%%
%%ss%%
etc...

That would avoid having to parse format strings and should allow for flexible usage.  Just an idea.  But it already suits my needs, I just need more space on my LCD :)
Home Automation via a native iPhone application.  Search for HomeWatch in iTunes.

whitehexagon

  • Full Member
  • ***
  • Posts: 118
    • SunshineApps
Re: Time variable in message
« Reply #10 on: September 11, 2009, 07:05:13 AM »
Maybe we also need a UTC timezone offset - per module. [edit: i found the UTC offset in 'Edit Profile' now:)]
Just messing around trying to fit it all on my LCD now, the edit stuff seems to be non functional for actions?
« Last Edit: September 14, 2009, 05:44:42 AM by whitehexagon »
Home Automation via a native iPhone application.  Search for HomeWatch in iTunes.