• 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
  Hardware that would be needed for 915Mhz protocol development? hepcat72 0 702 08-23-2022, 02:15 PM
Last Post: hepcat72
  Oregon Protocol V2.1: THGR122NX jpoilux 211 153,869 04-22-2021, 01:24 PM
Last Post: Ruhaf
  Protocol ADE WS1503 Rschnauzer 1 1,064 03-20-2021, 08:53 PM
Last Post: curlymo
  protocol franju received but is not in doku Rschnauzer 2 1,199 03-13-2021, 12:30 PM
Last Post: Rschnauzer
  FT007TH Thermo-/Hygrometer, Protocol: Alecto V3 sandnabba 1 1,823 12-12-2019, 09:40 PM
Last Post: sandnabba
Brick Protocol for FT0073 drobskind 5 7,196 07-25-2019, 10:44 PM
Last Post: fireball
  Brennenstuhl RCR CE1 1011 with QUIGG GT9000 Protocol scootermacro 1 2,078 06-27-2019, 06:20 PM
Last Post: scootermacro
  mumbi rcs-20gs protocol scootermacro 0 1,338 06-21-2019, 12:10 PM
Last Post: scootermacro
  How to introduce a new protocol folder? Phunkafizer 2 2,152 01-15-2019, 07:25 PM
Last Post: Phunkafizer
  rfcontroljs protocol implementation pisperate 0 1,369 01-13-2019, 11:07 AM
Last Post: pisperate

Forum Jump:


Browsing: 1 Guest(s)