current time in notifications Topic is solved

Moderator: leecollings

Post Reply
DennisBradenton
Posts: 4
Joined: Sunday 05 May 2019 13:07
Target OS: Linux
Domoticz version: BETA
Contact:

current time in notifications

Post by DennisBradenton »

Hi there,

is there an option to add the "current time" into a notification?
Or update a user variable with the "current time" (what could later be used in a notification) when Event was triggered?
Well, i got it to work the way i wanted it too with a dzvents script.

In case someone is looking for this as well:

First i created a user variable called "current time"

Then i created the dzvents script:

Code: Select all

local Time = require('Time')
local now = Time()
return {
   active = true,
   on = {
      devices = {'*'},
   },
   execute = function(domoticz, item, triggerInfo)
     domoticz.variables('current time').set(Time().raw)
   end
}
In my Blockly notification i used the user variable "current time" as message.
Thanks,
Dennis
Last edited by DennisBradenton on Sunday 05 May 2019 15:11, edited 2 times in total.
User avatar
gizmocuz
Posts: 2511
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: current time in notifications

Post by gizmocuz »

I only have experience with email and push notifications (pushover for example), and in those systems the time is already added
You see the time the email was received, you see the time a push notification is received in the notification application

What notification system are you using that does not display the received time somehow ?
Quality outlives Quantity!
DennisBradenton
Posts: 4
Joined: Sunday 05 May 2019 13:07
Target OS: Linux
Domoticz version: BETA
Contact:

Re: current time in notifications

Post by DennisBradenton »

i am using the domoticz for android. If i only have 1 notification it shows like ( x minutes ago) but as soon as i have 2 or more the time disappears.
Screenshot_20190505_140949_com.huawei.android.launcher.jpg
Screenshot_20190505_140949_com.huawei.android.launcher.jpg (192.77 KiB) Viewed 1769 times
Screenshot_20190505_140900_com.huawei.android.launcher.jpg
Screenshot_20190505_140900_com.huawei.android.launcher.jpg (194.92 KiB) Viewed 1769 times
DennisBradenton
Posts: 4
Joined: Sunday 05 May 2019 13:07
Target OS: Linux
Domoticz version: BETA
Contact:

Re: current time in notifications

Post by DennisBradenton »

Well, i got it to work the way i wanted it too with a dzvents script.
Screenshot_20190505_150405_com.huawei.android.launcher.jpg
Screenshot_20190505_150405_com.huawei.android.launcher.jpg (203.6 KiB) Viewed 1763 times
In case someone is looking for this as well:

First i created a user variable called "current time"

Then i created the dzvents script:

Code: Select all

local Time = require('Time')
local now = Time()
return {
   active = true,
   on = {
      devices = {'*'},
   },
   execute = function(domoticz, item, triggerInfo)
     domoticz.variables('current time').set(Time().raw)
   end
}
In my Blockly notification i used the user variable "current time" as message.


-Dennis
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest