Event2GCal : add events to your google calendar (send sms to ur cellphone, etc)

For information on how to install it or use it, see (it is in french by default but you can translate it using the google translate toolbar on the right) : [url=http://pascal-mietlicki.fr/blog/domotique-event2gcal-ou-recevoir-des-alertes-sms-gratuitement-depuis-la-vera]http://pascal-mietlicki.fr/blog/domotique-event2gcal-ou-recevoir-des-alertes-sms-gratuitement-depuis-la-vera[/url]
[b]
Update 01/24 : new version without problem with Lua Engine (24 of january) → waiting for approval but the link will be : MiOS Apps

Update 07/16 : new version providing the ability to change the parameters inside luup code. If you want to install it, see my post from today (16 of July)
To change an event description :
luup.call_action(“urn:event2gcal:serviceId:Event2GCal1”,“SetEventDesc”, {NewEventDesc= “Test”},device_id)

MAJ 16/07 : nouvelle version permettant de changer les paramètres ? la volée ? l’intérieur du code luup. Pour récupérer les fichiers d’installation, voir mon message du 16 juillet.
Pour changer la description d’un évènement :
luup.call_action(“urn:event2gcal:serviceId:Event2GCal1”,“SetEventDesc”, {NewEventDesc= “Test”},device_id)
[/b]

[b]Update 04/22 : I changed the plugin in order to remove the “google.lua” file. I had some problems with the new merged implementation file. The last version (one from 22/04) should not have any problems, please re-download it or reinstall it.

MAJ 22/04 : Suppression du fichier google.lua et intégration du code lua dans le fichier d’implémentation. Ayant eu quelques problèmes de syntaxe du code lua, ceux ayant téléchargé le fichier I_Event2GCal.xml doivent télécharger la dernière version (celle supérieure au 22/04) ou réinstaller le plugin.
[/b]
Hi all,

A small topic to announce a new plugin I created : Event2GCal.
The goal is simple : add a new event into your google calendar account inside scenes. Thus you can benefit of all the advantages in google calendar (like sending an sms to your cellphone).

I’ve created a new plugin on MIOS Marketplace which id is 2078 (sorry I am not allowed to post external links ???) and created a new release 1.0 Beta 4

How to install (in case you can’t install it from the marketplace)

  • Download the files D_Event2GCal.xml and I_Event2GCal.xml
  • On Vera, go to MiOS Developers, Luup files, and upload the files
  • Create a new device – use D_Event2GCal.xml and I_Event2GCal.xml. Save. Refresh your browser to reload web interface

How to use

  • Install the plugin (or download the files D_Event2GCal.xml I_Event2GCal.xml)
  • Inside the plugin parameters in the “Advanced” tab, inside the “Variables” part, you will see :
    • Email : put your email address → mandatory
    • Password : put your password → mandatory
    • CalendarName : name of the calendar you want to add your events to → optional
    • EventName : put the name of the event you want to create (ex : Intrusion!) → mandatory
    • EventDesc : description of the event that will be added as the meeting place inside your calendar (in order to appear inside the sms) → optional

I’ve made some tests and it works fine. So please test it and tell me if it works for you.
The plugin make the connexion by using the version 2 of google api (with JSON). I had some problems using OAuth for the connexion (I’m really not an expert) and thus I had to do it the old way with ClientLogin (with username and password).
I’m working on it and I’m trying to implement OAuth.

I’m waiting for your comments, remarks, ideas of improvements.
Any help would be greatly appreciated. If you know how I could create a project space on code.mios.com, I would be really grateful.

Thanks to googleapi-lua and to WebCall Dialer plugin (My example to create the implementation file)

Best regards,
Pascal

[size=12pt]En français :[/size]
Bonjour ? tous,

Juste un petit message pour vous annoncer la sortie du plugin : Event2GCal.
But : créer un événement dans votre calendrier google que vous pourrez utiliser dans vos scènes. L’intérêt principal (pour ma part) est de pouvoir être alerté par sms.

Pour l’instant il est en version 1.0 Beta 4, le plugin est accessible sur MIOS Marketplace, son id est le 2078 (désolé je n’ai pas le droit de poster de liens externes… ???)

Installation (au cas où vous n’arrivez pas ? l’installer depuis le marketplace)

  • Téléchargez les fichiers D_Event2GCal.xml et I_Event2GCal.xml
  • Sous Vera, allez dans la partie Développeur, fichiers Luup et uploadez les fichiers
  • Créer une nouvelle interface (device?) en utilisant D_Event2GCal.xml et I_Event2GCal.xml
  • Sauver et rafraichissez la page

Comment l’utiliser ?

  • Installer le plugin (les fichiers fournis sont : D_Event2GCal.xml I_Event2GCal.xml)
  • Dans les paramètres du plugin, onglet “Avancé”, dans la partie “Variables”, vous verrez :
    • Email : votre adresse email → obligatoire
    • Password : votre mot de passe → obligatoire
    • CalendarName : nom du calendrier → optionnelle (prend le principal par défaut)
    • EventName : nom de l’événement ? créer (ex : Intrusion!) → obligatoire
    • EventDesc : description de l’événement, il apparaitra en tant que “lieu” dans votre calendrier (pour un affichage correct des sms) → optionnelle

L’authentification se fait en utilisant le “ClientLogin” de l’api google. J’essaie de travailler sur une version OAuth mais je ne vois pas bien comment ça fonctionne (tout aide est la bienvenue).
J’utilise la version 2 de l’api google (format JSON).

J’attends vos remarques, idées, commentaires, etc.
Merci ? googleapi-lua et au plugin WebCall (dont je me suis inspiré pour les fichiers XML luup)

Bien ? vous,
Pascal

Hi!

Thanks for this plug-in, it works well on my unit. I had to install it manually (on apps.mios.com, the auto install doesn’t work…).

I had some problems with the default calendar name (I renamed mine , thus the default name was not my email address).

Thanks again!

Bonjour,

J’ai travaillé aussi sur cette fonctionnalité.
N’ayant pas encore la Vera, je me suis arrêté sur le fonctionnement sur PC. J’avais donc soumis ma recherche sur le forum de maison et domotique, sans retour…

Voici le script curl que j’utilisais sans OAuth :
Le forum refuse les URL externes, donc remplaces GOOGLE par l’URL de google en HTTPS

curl –verbose –insecure –basic –data-binary « @test.ics » –request POST
–header « Authorization: GoogleLogin `curl GOOGLE/accounts/ClientLogin –data-urlencode Email=pseudo@gmail.com –data-urlencode Passwd=mon_pass -d accountType=GOOGLE -d source=Google-cURL-Example -d service=cl | grep Auth »
–header « Content-Type: text/calendar; charset= »utf-8″; component=VEVENT » –url GOOGLE/calendar/ical/mon_identifiant_de calendar_private_ical/basic.ics

Pour l’identification OAuth :

curl GOOGLE/accounts/ClientLogin --data-urlencode Email=login@gmail.com --data-urlencode Passwd=MOTDEPASSE -d accountType=GOOGLE -d source=Google-cURL-Example -d service=cl

Cela te permet de t’identifier avec ton email/pass, -d accounttype précise que c’est un compte google, -d service=cl précise que l’identification est faite pour le service calendar.

En retour tu as une série de code.
Il faut utiliser uniquement la partie “Auth”

Sous linux, tu peux faire un :

curl GOOGLE/accounts/ClientLogin --data-urlencode Email=login@gmail.com --data-urlencode Passwd=MOTDEPASSE -d accountType=GOOGLE -d source=Google-cURL-Example -d service=cl | grep Auth

Cela te donnera le jeton d’identification qu’il te faut.

En espérant que cela t’aide…

[quote=“kornflex, post:3, topic:171277”]Bonjour,

J’ai travaillé aussi sur cette fonctionnalité.
N’ayant pas encore la Vera, je me suis arrêté sur le fonctionnement sur PC. J’avais donc soumis ma recherche sur le forum de maison et domotique, sans retour…

Voici le script curl que j’utilisais sans OAuth :
Le forum refuse les URL externes, donc remplaces GOOGLE par l’URL de google en HTTPS

curl –verbose –insecure –basic –data-binary « @test.ics » –request POST
–header « Authorization: GoogleLogin `curl GOOGLE/accounts/ClientLogin –data-urlencode Email=pseudo@gmail.com –data-urlencode Passwd=mon_pass -d accountType=GOOGLE -d source=Google-cURL-Example -d service=cl | grep Auth »
–header « Content-Type: text/calendar; charset= »utf-8″; component=VEVENT » –url GOOGLE/calendar/ical/mon_identifiant_de calendar_private_ical/basic.ics

Pour l’identification OAuth :

curl GOOGLE/accounts/ClientLogin --data-urlencode Email=login@gmail.com --data-urlencode Passwd=MOTDEPASSE -d accountType=GOOGLE -d source=Google-cURL-Example -d service=cl

Cela te permet de t’identifier avec ton email/pass, -d accounttype précise que c’est un compte google, -d service=cl précise que l’identification est faite pour le service calendar.

En retour tu as une série de code.
Il faut utiliser uniquement la partie “Auth”

Sous linux, tu peux faire un :

curl GOOGLE/accounts/ClientLogin --data-urlencode Email=login@gmail.com --data-urlencode Passwd=MOTDEPASSE -d accountType=GOOGLE -d source=Google-cURL-Example -d service=cl | grep Auth

Cela te donnera le jeton d’identification qu’il te faut.

En espérant que cela t’aide…[/quote]
Translated since I was following
Hello,

I also worked on this feature.
Have not yet Vera, I stopped on the functioning PC. So I submitted my research on the forum home and building automation, no return …

Here is the script I was using curl without OAuth:
The forum rejects external URLs, so GOOGLE replaced by the HTTPS URL in google

curl-verbose-insecure-basic-data-binary “@ test.ics” POST-request
-Header "Authorization:` curl GoogleLogin GOOGLE / accounts / ClientLogin-data-urlencode Email = pseudo@gmail.com-data-urlencode-d Passwd = mon_pass accountType = GOOGLE-d source = Google-cURL-Example-of service = cl | grep Auth "
-Header “Content-Type: text / calendar; charset =” utf-8 “; VEVENT component =” url-GOOGLE / calendar / ical / mon_identifiant_de calendar_private_ical / basic.ics

OAuth for identification:

GOOGLE curl / accounts / ClientLogin - data-urlencode Email = login@gmail.com - data-urlencode Passwd = PASSWORD-d-d accountType GOOGLE = source = Google-cURL-Example-of service = cl

This allows you to identify yourself with your email / pass, ie AccountType says this is a google account, service = cl-d specifies that the identification is made for the service calendar.

In return you have a serial code.
It should only use the “Auth”

Linux, you can make one:

GOOGLE curl / accounts / ClientLogin - data-urlencode Email = login@gmail.com - data-urlencode Passwd = PASSWORD-d-d accountType GOOGLE = source = Google-cURL-Example of service-cl = | grep Auth

That will give you the token ID you need.

Hope this helps you …

Hi all,

New version with new actions in order to change email, password, calendar name, event name and event description.
I added a static json file and a service file.
Every parameter is now mandatory.

The advantage of this version is that you can have just one instance of the plugin (or one by google accounts) and change the name or description inside luup code.
[b]
To change an event name in luup :
luup.call_action(“urn:event2gcal:serviceId:Event2GCal1”,“SetEventName”, {NewEventName= “Test”}, device_id)

To change an event description :
luup.call_action(“urn:event2gcal:serviceId:Event2GCal1”,“SetEventDesc”, {NewEventDesc= “Test”},device_id)

To change the email address :
luup.call_action(“urn:event2gcal:serviceId:Event2GCal1”,“SetEmail”, {NewEmail= “youremail@gmail.com”},device_id)

To change the password :
luup.call_action(“urn:event2gcal:serviceId:Event2GCal1”,“SetPassword”, {NewPassword= “yourpassword”},device_id)

To change the calendar name (the one used to write events) :
luup.call_action(“urn:event2gcal:serviceId:Event2GCal1”,“SetCalendarName”, {NewCalendarName= “Name of the calendar as it is displayed inside your google agenda”},device_id)

To add the event to your calendar inside luup code use :
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”, {newTargetValue= 1},device_id)
[/b]

I asked for the approval of this version to the micasaverde team. I am not working to change the authentication part with OAuth, if you are concerned about security issues, you can always create a new specific google account for your vera.

I am not sure you can access or install the plugin directly from https://apps.mios.com so you will find, attached, the files. You can install it manually by going to “Apps → Developp Apps → luup files → upload files” and then create a device with this parameters :
Device Filename : D_Event2GCal.xml
Implementation Filename : I_Event2GCal.xml

@kornflex : thanks for the tip and you curl command. Maybe, if I had some time, I will try to implement the OAuth part but it is no longer a priority.

Best regards,
Pascal

PS : did not have the time to test and qualify everything, please report the bugs by responding to this post

Dear Pascal,

Thanks for the plugin. It is very usefull. I receive an error when Vera UI5 is starting up: Event2GCal : Lua error.
In the logs I can see:

0 08/07/12 13:21:30.348 luup_log:51: Event2GCal Starting… LEAK this:69632 start:1085440 to 0xc18000 <0x2c295680>
50 08/07/12 13:21:30.349 luup_log:51: Event2GCal Not initialized: setting up variables <0x2c295680>
50 08/07/12 13:21:30.351 luup_log:51: Event2GCal Ready… <0x2c295680>

What can be done fix this error?
Even with this error, the plugin is working and add events to the calendar, but if would be nice to fix this.

Best regards,
Viorel

Hi Pascal,

Great plug-in! Does wonders for easy event tracking in Google Calendar! I’m also experiencing the Lua Error mentioned by Viorel. Any ideas how to fix this?

Thanks,
DK

This is not a fix, but at least I don’t see the error messages: go to Apps, Develop Apps, Edit startup LUA, paste the following code:

luup.task(“OK”,1,“your_system_name”,0)
luup.task(“OK”,1,“your_system_name”,1)
luup.task(“OK”,1,“your_system_name”,2)
luup.task(“OK”,1,“your_system_name”,3)
return true

Press Go, Save and you’ll see the OK now. It will override the error message :slight_smile: You can put whatever message you like there.

Viorel

I tried to load this from apps.mios.com and it said that it failed to load. When I logged into my vera3 to try again from the apps page, it was already on my desktop. I opened the first tab and completed the email, pw, calendar name, event name and clicked set after each one but nothing happened. My specified google calendar doesn’t show the entry that I tried to create with Event2GCal. If I get this plugin running, can I specify the starting and ending date and time for the event?

Hi all !

Sorry for the delay but there was some problems with encoding files. I think it is solved now but I am waiting for the approval of the micasaverde team.
It will be available at : [url=http://apps.mios.com/plugin.php?id=589]MiOS Apps

While waiting, you can find some documentation on how to install it and use it at (in french but you can use the google translate toolbar on the right) :
[url=http://pascal-mietlicki.fr/blog/domotique-event2gcal-ou-recevoir-des-alertes-sms-gratuitement-depuis-la-vera]http://pascal-mietlicki.fr/blog/domotique-event2gcal-ou-recevoir-des-alertes-sms-gratuitement-depuis-la-vera[/url]

Sorry for this misunderstanding but “manually” it worked correctly, I did not understand why the automatic install did not work. I didn’t think about encoding problems because everything was ok with manual installation.

Best regards,
Pascal

Does this plugin still work???
The links in this section are dead - where is the documentation?

Plugin was working fine, and now since two week ago, it suddenly stopped working. From a day to another, nothing appears on my calendar anymore… Can someone help ?
I didn’t changed anything (password or so…). Try to re-input the password but still the same.

Thanks.

Kris

I have been uprgraded under UI17;
The plugin does not work correctly :

  • once all email, password, … entered into the device, it work well if you activate the “ON” button.
  • with Luua scripts in the scenes, it does not work.

It looks like this plugin may not be maintained any more and / or may have been affected by the changes google mandated to authentication in Nov 2014. If that is the case - you may be interested that I added to my GCal3 plugin the ability to create calendar events (since I already had the authentication). If I am incorrect - my apologies.

If you are interested you can find the details here

http://forum.micasaverde.com/index.php/topic,26692.0.html

and here

http://forum.micasaverde.com/index.php/topic,26692.msg223846.html#msg223846