Skip to content

candrox/mqtt2caldav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mqtt2caldav

This project reads MQTT events and creates predefined CALDAV events.


Licence

mqtt2caldav is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.


Requirements



Configuration

The configuration file is located at config/config.json and holds some sample data.

MQTT SERVER :: Connection
Specifies the MQTT server connection details.

"MQTT_SERVER_ADDRESS": "localhost",
"MQTT_SERVER_PORT": "1883",
"MQTT_USERNAME": "username",
"MQTT_PASSWORD": "password"


CALDAV SERVER :: Connection
Specifies the CalDAV server connection details.

"CALDAV_SERVER_ADDRESS": "https://server.com/remote.php/dav/calendars/user",
"CALDAV_USERNAME": "username",
"CALDAV_PASSWORD": "password"


TRIGGER :: Mode
Specifies the mode.

"MODE"
  • "Create" → Creates a calendar event


TRIGGER :: MQTT Topic
Specifies the MQTT topic to trigger a calendar event creation.

"MQTT_TOPIC"
  • "mqtt/Main_Switch"
  • "mqtt/OPP_BTN_SQR_601"
  • "mqtt/0x00124b001f8ab0cd"
  • ...


TRIGGER :: MQTT Event
Specifies the MQTT event string to trigger a calendar event creation.

"MQTT_EVENT"
  • "{"action":"button_1_single"}"
  • "action":"on"
  • "battery"
  • ...


TRIGGER :: Event Calendar
Specifies the calendar name in which a calendar event is created.

"EVENT_CALENDAR"
  • "localhost/dav/calendar/work"
  • "http://server.com/remote.php/dav/calendars/user/home"
  • ...


TRIGGER :: Event Summary
Specifies the calendar event title.

"EVENT_SUMMARY"
  • "Meeting"
  • "Buy More Milk"
  • "Procrastination"
  • ...


TRIGGER :: Event Location
Specifies the calendr event location. Use a double backslash to escape a comma.

"EVENT_LOCATION"
  • "Home"
  • "Annwn Regio"
  • "1 Street\\, 23456 City\\, Country"
  • ...


TRIGGER :: Event Geo
Specifies the calendar event location in latitude and longitude coordinates.

"EVENT_GEO"
  • "41.726931;-49.948253"
  • "1.2489458;103.8343056"
  • "-73.0499998;-13.416665"
  • ...


TRIGGER :: Event Categories
Specifies the category/categories for a calendar event. This field is commonly used for 'Tags' in various calendar apps.

"EVENT_CATEGORIES"
  • "Visit"
  • "Meeting"
  • "Beachy Beach\\, Sandy Sand\\, Sunny Sun"
  • ...


TRIGGER :: Event URL
Specifies a link associated with a calendar event.

"EVENT_URL"
  • "http://something.com"
  • "http://buymoremilk.com"
  • "http://eatmorechicken.com"
  • ...


TRIGGER :: Event Description
Specifies the description for a calendar event.

"EVENT_DESCRIPTION"
  • "Meeting with Homer"
  • "Take over the world!"
  • "Dont forget to buy fresh milk!"
  • ...


TRIGGER :: Event Transparency
Specifies if a calendar event is listed as busy or free.

"EVENT_TRANSP"
  • "OPAQUE" → Busy
  • "TRANSPARENT" → Free


TRIGGER :: Event Time Zone
Specifies the timezone the calendar event is created. List of timezones → https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

"EVENT_TIMEZONE"
  • "Etc/GMT+12"
  • "Europe/London"
  • "Asia/Singapore"
  • ...


TRIGGER :: Event Offset
Specifies the offset for the calendar event start time, configurable in minutes.

"EVENT_OFFSET"
  • "" → No offset is applied to the event start time.
  • "+10" → The event start time is set ahead by 10 minutes.
  • "-25" → The event start time is set back by 25 minutes.
  • ...


TRIGGER :: Event Trigger
Specifies a calendar event alarm.

"EVENT_TRIGGER"
  • "" → No alert will be set or configured
  • "0" → Alert will trigger at event start time
  • "15" → Alert will trigger 15 minutes before event start time
  • ...


TRIGGER :: Event Seconds
Specifies if a calendar event start time and end time will have seconds set.

"EVENT_SECONDS"
  • "True" → 12:34:56
  • "False" → 12:34:00


TRIGGER :: Event Rounding
Specifies if a calendar event start time has minutes rounded up or down to the closest defined value.

"EVENT_ROUNDING"
  • "1" → 12:42:29 rounds down to 12:42:00 and 12:42:30 rounds up to 12:43:00
  • "5" → 12:42:29 rounds down to 12:40:00 and 12:42:30 rounds up to 12:45:00
  • "30" → 12:42:29 rounds down to 12:30:00 and 12:42:30 rounds up to 13:00:00
  • ...


TRIGGER :: Event Duration
Specifies a calendar event duration in minutes.

"EVENT_DURATION"
  • "1" → If event start time is 12:34:00, event end time will be set to 12:35:00 (+1 minute)
  • "10" → If event start time is 12:34:00, event end time will be set to 12:44:00 (+10 minutes)
  • "120" → If event start time is 12:34:00, event end time will be set to 14:34:00 (+120 minutes)
  • ...


Log File

The log file is located under logs/mqtt2caldav.log.