• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


missing protocol of "date_and_time" in Wiki/Protocols
#1
hey there,

I can not find the protocol for "datetime" which is spoken in Examples
can you please update Protocols with full support for Gui and settings ?
 
Reply
#2
I was busy with the new release. Maybe i can find time to update the manual. In the meanwhile you can create a page yourself and put in a github PR? That would be even better Smile
 
Reply
#3
i found just this after a wile searching

Code:
Date & Time

Config

    "devices": {
       "date_and_time": {
            "protocol": [ "datetime" ],
            "id": [{
                "longitude": 6.9174,
                "latitude": 51.4681
            }],
            "year": 2015,
            "month": 2,
            "day": 11,
            "hour": 17,
            "minute": 50,
            "second": 40,
            "weekday": 1,
            "dst": 0
          }
      },
"gui": {
               "date_and_time": {
                       "name": "Date - Time",
                       "group": [ "Home" ],
                       "media": [ "all" ],
                       "format": "dd DD-MM-YYYY HH:mm:ss",
               }
          },

Optional Settings

Setting    Default    Format    Description
gui-show-datetime    1    1 or 0    Don't display the datetime values
gui-datetime-format    HH:mm:ss YYYY-MM-DD    see below    Datetime formatting

Notes

The ntp-server id is optional. The ntp server will be used to check if the time is in sync with the atomic clock. When using pilight nightly, remove “” at the longtitude and latitude numbers. Also the latest nightly has an extra option: “weekday”. (weekday 1 = sunday)

it was possible to get more than one information out of "date_and_time" in gui, you can use in "format" multiple artguments

Nightly example:

    "devices": {
               "date_and_time": {
                       "protocol": [ "datetime" ],
                       "id": [{
                               "longitude": 6.9174,
                "latitude": 51.4681
                       }],
                       "year": 2015,
                       "month": 5,
                       "day": 28,
                       "hour": 0,
                       "minute": 26,
                       "second": 37,
                       "dst": 1,
                       "weekday": 4
               }
    },
    "gui": {
               "date_and_time": {
                       "name": "Date - Time",
                       "group": [ "Home" ],
                       "media": [ "all" ],
                       "format": "dd DD-MM-YYYY HH:mm:ss",
               }
    },
       "settings": {
               "ntp-servers": [ "0.de.pool.ntp.org", "1.de.pool.ntp.org" ]
       }

Formatting
Input          |        Output
M, MM            Month Number (1 - 12)
MMM, MMMM    Month Name (In currently language set by moment.lang())
D, DD            Day of month
DDD, DDDD            Day of year
d, dd, ddd, dddd    Day of week (NOTE: these formats only make sense when combined with “ww”)
e                    Day of week (locale) (NOTE: these formats only make sense when combined with “ww”)
E                    Day of week (ISO) (NOTE: this format only make sense when combined with “WW”)
w, ww            Week of the year (NOTE: combine this format with “gg” or “gggg” instead of “YY” or “YYYY”)
W, WW            Week of the year (NOTE: combine this format with “GG” or “GGGG” instead of “YY” or “YYYY”)
YY                    2 digit year (if greater than 68 will return 1900's, otherwise 2000's)
YYYY                    4 digit year
gg                    2 digit week year (if greater than 68 will return 1900's, otherwise 2000's)
gggg                    4 digit week year
GG                    2 digit week year (ISO) (if greater than 68 will return 1900's, otherwise 2000's)
GGGG                    4 digit week year (ISO)
a, A                    AM/PM
H, HH            24 hour time
h, hh                    12 hour time (use in conjunction with a or A)
m, mm            Minutes
s, ss                    Seconds
S                    Deciseconds (1/10th of a second)
SS                    Centiseconds (1/100th of a second)
SSS                    Milliseconds (1/1000th of a second)
Z, ZZ            Timezone offset as +07:00 or +0700
X                    Unix timestamp
LT, L, LL, LLL, LLLL    Locale dependent date and time representation

To use formatting in the nighly, use the option format in the GUI section of config.json.

Example Formatting Nightly:

               "date_and_time": {
                       "name": "Time",
                       "group": [ "Group" ],
                       "format": "HH:mm:ss"
               },

In this example, only the time is showed in the GUI (24h notation)

maybe you can Check it, because its from 2015
 
Reply
#4
Where did you find it?

I found some time and added it.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
Brick Protocol for FT0073 drobskind 5 3,252 07-25-2019, 10:44 PM
Last Post: fireball
  Oregon Protocol V2.1: THGR122NX jpoilux 208 69,587 07-04-2019, 02:14 PM
Last Post: Tueftler1983
  Brennenstuhl RCR CE1 1011 with QUIGG GT9000 Protocol scootermacro 1 330 06-27-2019, 06:20 PM
Last Post: scootermacro
  mumbi rcs-20gs protocol scootermacro 0 264 06-21-2019, 12:10 PM
Last Post: scootermacro
  How to introduce a new protocol folder? Phunkafizer 2 481 01-15-2019, 07:25 PM
Last Post: Phunkafizer
  rfcontroljs protocol implementation pisperate 0 285 01-13-2019, 11:07 AM
Last Post: pisperate
  MQTT protocol for pilight Chekov 11 3,465 11-03-2018, 04:21 PM
Last Post: curlymo
  getting started guide for implementing new protocol kaililleby 1 893 11-28-2017, 10:24 PM
Last Post: pilino1234
  Logilink EC0003 Protocol ehz 4 1,241 09-24-2017, 07:15 PM
Last Post: ehz
  Unkown protocol with Lidl Libra RC-710 HaselnuesseTo 0 1,098 09-11-2017, 08:30 PM
Last Post: HaselnuesseTo

Forum Jump:


Browsing: 1 Guest(s)