BakSeeDaa´s Google Calendar for Domoticz (deprecated)

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.
User avatar
BakSeeDaa
Posts: 293
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby BakSeeDaa » Sunday 28 February 2016 23:12

deennoo wrote:Got a small problem now, surely nothing impossible to solve :

I made some modification on my json.lua file to test something else, but i didn't made any backup.

I'm facing this log error :

Code: Select all

2016-02-28 21:22:01.314 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_device_gcal.lua: /home/pi/domoticz/scripts/lua/json.lua:383: JSON:decode must be called in method format


Does someone can share his file please ?


If You rename the json.lua file, the file will be downloaded automatically. You can also download it manually if you prefer.
Best wishes

// บักสีดา

deennoo
Posts: 826
Joined: Wednesday 10 December 2014 14:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby deennoo » Monday 29 February 2016 0:22

OK Thanks for your help, fast and clear as usual

even if i copy and past yours it doesn't works.
My solution was to erase it, and BakSeeDaa's Google Calendar for Domoticz run again !
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / ESP8266 / MQTT / BLE
http://domo-attitude.fr

oxedgar
Posts: 6
Joined: Sunday 10 April 2016 11:59
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby oxedgar » Sunday 10 April 2016 12:03

Hello,

I'm trying to install your codes but i don't have any success!

here my domoticz log. i'm retreive 404 error!:

Code: Select all

2016-04-10 10:07:00.539 LUA: GCal - Domotique needs to run
2016-04-10 10:07:00.541 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_gcal.lua
2016-04-10 10:07:01.281 (Capteurs perso) General/Percentage (Cuve - Pourcentage remplissage)
2016-04-10 10:07:03.086 LUA: GCal3 V 1.0.2: Calendar device GCal - Domotique (idx:158 ) initializing
2016-04-10 10:07:03.170 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/ returned true
2016-04-10 10:07:03.232 LUA: GCal3 V 1.0.2: Command /bin/rm -f /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-10 10:07:03.280 LUA: GCal3 V 1.0.2: Command bin/rm -f /home/pi/domoticz/GCal3/*.token returned nil
2016-04-10 10:07:03.280 LUA: GCal3 V 1.0.2: Checking semaphore
2016-04-10 10:07:03.360 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned nil
2016-04-10 10:07:03.361 LUA: GCal3 V 1.0.2: Semaphore file returned nil
2016-04-10 10:07:03.362 LUA: GCal3 V 1.0.2: Device 158 requested semaphore
2016-04-10 10:07:03.448 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-10 10:07:03.449 LUA: GCal3 V 1.0.2: Device 158 claimed semaphore
2016-04-10 10:07:03.450 LUA: GCal3 V 1.0.2: Variables initialized ...
2016-04-10 10:07:03.498 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/scripts/lua/json.lua returned true
2016-04-10 10:07:03.520 LUA: GCal3 V 1.0.2: local function: checkforcredentials
2016-04-10 10:07:03.570 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.json returned true
2016-04-10 10:07:03.619 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.json returned true
2016-04-10 10:07:03.689 LUA: GCal3 V 1.0.2: Command find /home/pi/domoticz/GCal3/ -type f ! -newer GCal3.json -name GCal3.pem -delete returned nil
2016-04-10 10:07:03.740 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.pem returned true
2016-04-10 10:07:03.740 LUA: GCal3 V 1.0.2: Timezone is 2 hrs and 0 min
2016-04-10 10:07:03.740 LUA: GCal3 V 1.0.2: Running Plugin ...
2016-04-10 10:07:03.760 LUA: GCal3 V 1.0.2: local function: checkGCal
2016-04-10 10:07:03.760 LUA: GCal3 V 1.0.2: Checking semaphore
2016-04-10 10:07:03.808 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-10 10:07:03.809 LUA: GCal3 V 1.0.2: Semaphore file returned 158
2016-04-10 10:07:03.858 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-10 10:07:03.859 LUA: GCal3 V 1.0.2: Device 158 claimed semaphore
2016-04-10 10:07:03.861 LUA: GCal3 V 1.0.2: StartMin is 2016-04-09T22:00:00Z StartMax is 2016-04-11T08:07:00Z
2016-04-10 10:07:03.861 LUA: GCal3 V 1.0.2: End of day is 2016-04-10T23:59:59
2016-04-10 10:07:03.861 LUA: GCal3 V 1.0.2: local function: requestCalendar
2016-04-10 10:07:03.861 LUA: GCal3 V 1.0.2: local function: get_access_token
2016-04-10 10:07:03.861 LUA: GCal3 V 1.0.2: Getting a new token
2016-04-10 10:07:05.437 LUA: GCal3 V 1.0.2: Got new token
2016-04-10 10:07:05.439 LUA: GCal3 V 1.0.2: Checking google calendar
2016-04-10 10:07:05.989 LUA: GCal3 V 1.0.2: Error getting calendar data: {
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
2016-04-10 10:07:05.992 LUA: GCal3 V 1.0.2: Device 158 released the semaphore - reason: calendar check complete
2016-04-10 10:07:05.993 LUA: GCal3 V 1.0.2: Next check will be in 500 sec on 2016-04-10 at 10:15:25
2016-04-10 10:07:06.185 LUA: GCal3 V 1.0.2: Device 158 released the semaphore - reason: initialization complete
2016-04-10 10:07:06.185 LUA: GCal3 V 1.0.2: Setting new Switch status to: Off



here my calendarID (xxxxxx is masqued characters):

Code: Select all

<iframe src="https://calendar.google.com/calendar/embed?src=xxxxxxxxxxxxxxxxxxxxxxxxxx%40group.calendar.google.com&ctz=Europe/Zurich" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>


And y tryed too with this:

Code: Select all

https://calendar.google.com/calendar/embed?src=xxxxxxxxxxxxxxxxxxxxxxxxxx%40group.calendar.google.com&ctz=Europe/Zurich


And with this:

Code: Select all

xxxxxxxxxxxxxxxxxxxxxxxxxx%40group.calendar.google.com



and dosent work. info:Wenh i get this url on my browser i have the good calendar.
Can you help me to resolve this please?
(sorry for my aproximate english)

User avatar
BakSeeDaa
Posts: 293
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby BakSeeDaa » Wednesday 13 April 2016 13:58

oxedgar wrote:Hello,

I'm trying to install your codes but i don't have any success!

here my domoticz log. i'm retreive 404 error!:

Code: Select all

2016-04-10 10:07:00.539 LUA: GCal - Domotique needs to run
2016-04-10 10:07:00.541 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_gcal.lua
2016-04-10 10:07:01.281 (Capteurs perso) General/Percentage (Cuve - Pourcentage remplissage)
2016-04-10 10:07:03.086 LUA: GCal3 V 1.0.2: Calendar device GCal - Domotique (idx:158 ) initializing
2016-04-10 10:07:03.170 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/ returned true
2016-04-10 10:07:03.232 LUA: GCal3 V 1.0.2: Command /bin/rm -f /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-10 10:07:03.280 LUA: GCal3 V 1.0.2: Command bin/rm -f /home/pi/domoticz/GCal3/*.token returned nil
2016-04-10 10:07:03.280 LUA: GCal3 V 1.0.2: Checking semaphore
2016-04-10 10:07:03.360 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned nil
2016-04-10 10:07:03.361 LUA: GCal3 V 1.0.2: Semaphore file returned nil
2016-04-10 10:07:03.362 LUA: GCal3 V 1.0.2: Device 158 requested semaphore
2016-04-10 10:07:03.448 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-10 10:07:03.449 LUA: GCal3 V 1.0.2: Device 158 claimed semaphore
2016-04-10 10:07:03.450 LUA: GCal3 V 1.0.2: Variables initialized ...
2016-04-10 10:07:03.498 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/scripts/lua/json.lua returned true
2016-04-10 10:07:03.520 LUA: GCal3 V 1.0.2: local function: checkforcredentials
2016-04-10 10:07:03.570 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.json returned true
2016-04-10 10:07:03.619 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.json returned true
2016-04-10 10:07:03.689 LUA: GCal3 V 1.0.2: Command find /home/pi/domoticz/GCal3/ -type f ! -newer GCal3.json -name GCal3.pem -delete returned nil
2016-04-10 10:07:03.740 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.pem returned true
2016-04-10 10:07:03.740 LUA: GCal3 V 1.0.2: Timezone is 2 hrs and 0 min
2016-04-10 10:07:03.740 LUA: GCal3 V 1.0.2: Running Plugin ...
2016-04-10 10:07:03.760 LUA: GCal3 V 1.0.2: local function: checkGCal
2016-04-10 10:07:03.760 LUA: GCal3 V 1.0.2: Checking semaphore
2016-04-10 10:07:03.808 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-10 10:07:03.809 LUA: GCal3 V 1.0.2: Semaphore file returned 158
2016-04-10 10:07:03.858 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-10 10:07:03.859 LUA: GCal3 V 1.0.2: Device 158 claimed semaphore
2016-04-10 10:07:03.861 LUA: GCal3 V 1.0.2: StartMin is 2016-04-09T22:00:00Z StartMax is 2016-04-11T08:07:00Z
2016-04-10 10:07:03.861 LUA: GCal3 V 1.0.2: End of day is 2016-04-10T23:59:59
2016-04-10 10:07:03.861 LUA: GCal3 V 1.0.2: local function: requestCalendar
2016-04-10 10:07:03.861 LUA: GCal3 V 1.0.2: local function: get_access_token
2016-04-10 10:07:03.861 LUA: GCal3 V 1.0.2: Getting a new token
2016-04-10 10:07:05.437 LUA: GCal3 V 1.0.2: Got new token
2016-04-10 10:07:05.439 LUA: GCal3 V 1.0.2: Checking google calendar
2016-04-10 10:07:05.989 LUA: GCal3 V 1.0.2: Error getting calendar data: {
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
2016-04-10 10:07:05.992 LUA: GCal3 V 1.0.2: Device 158 released the semaphore - reason: calendar check complete
2016-04-10 10:07:05.993 LUA: GCal3 V 1.0.2: Next check will be in 500 sec on 2016-04-10 at 10:15:25
2016-04-10 10:07:06.185 LUA: GCal3 V 1.0.2: Device 158 released the semaphore - reason: initialization complete
2016-04-10 10:07:06.185 LUA: GCal3 V 1.0.2: Setting new Switch status to: Off



here my calendarID (xxxxxx is masqued characters):

Code: Select all

<iframe src="https://calendar.google.com/calendar/embed?src=xxxxxxxxxxxxxxxxxxxxxxxxxx%40group.calendar.google.com&ctz=Europe/Zurich" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>


And y tryed too with this:

Code: Select all

https://calendar.google.com/calendar/embed?src=xxxxxxxxxxxxxxxxxxxxxxxxxx%40group.calendar.google.com&ctz=Europe/Zurich


And with this:

Code: Select all

xxxxxxxxxxxxxxxxxxxxxxxxxx%40group.calendar.google.com



and dosent work. info:Wenh i get this url on my browser i have the good calendar.
Can you help me to resolve this please?
(sorry for my aproximate english)


Set the user variable named GCalnnCalendarID to the Calendar ID. It should look something like
[email protected]
or
[email protected]

Don't write "http" or "%40" into the variable. Did that help?
Best wishes

// บักสีดา

oxedgar
Posts: 6
Joined: Sunday 10 April 2016 11:59
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby oxedgar » Wednesday 13 April 2016 19:26


woody4165
Posts: 412
Joined: Monday 14 March 2016 14:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby woody4165 » Wednesday 13 April 2016 21:00

Hi BakSeeDaa

I'm in the same situation of oxedgar.

Code: Select all

2016-04-13 20:50:48.525 User: Admin initiated a switch command
2016-04-13 20:50:48.881 LUA: GCal3 V 1.0.2: Calendar device GCal ticz (idx:xx ) initializing
2016-04-13 20:50:48.918 LUA: GCal3 V 1.0.2: Command /bin/ls /home/osmc/domoticz/GCal3/ returned true
2016-04-13 20:50:48.945 LUA: GCal3 V 1.0.2: Command /bin/rm -f /home/osmc/domoticz/GCal3/GCal3.sem returned true
2016-04-13 20:50:48.969 LUA: GCal3 V 1.0.2: Command bin/rm -f /home/osmc/domoticz/GCal3/*.token returned nil
2016-04-13 20:50:48.969 LUA: GCal3 V 1.0.2: Checking semaphore
2016-04-13 20:50:49.004 LUA: GCal3 V 1.0.2: Command /bin/ls /home/osmc/domoticz/GCal3/GCal3.sem returned nil
2016-04-13 20:50:49.005 LUA: GCal3 V 1.0.2: Semaphore file returned nil
2016-04-13 20:50:49.006 LUA: GCal3 V 1.0.2: Device 88 requested semaphore
2016-04-13 20:50:49.041 LUA: GCal3 V 1.0.2: Command /bin/ls /home/osmc/domoticz/GCal3/GCal3.sem returned true
2016-04-13 20:50:49.042 LUA: GCal3 V 1.0.2: Device 88 claimed semaphore
2016-04-13 20:50:49.044 LUA: GCal3 V 1.0.2: Variables initialized ...
2016-04-13 20:50:49.078 LUA: GCal3 V 1.0.2: Command /bin/ls /home/osmc/domoticz/scripts/lua/json.lua returned true
2016-04-13 20:50:49.094 LUA: GCal3 V 1.0.2: local function: checkforcredentials
2016-04-13 20:50:49.132 LUA: GCal3 V 1.0.2: Command /bin/ls /home/osmc/domoticz/GCal3/GCal3.json returned true
2016-04-13 20:50:49.175 LUA: GCal3 V 1.0.2: Command /bin/ls /home/osmc/domoticz/GCal3/GCal3.json returned true
2016-04-13 20:50:49.216 LUA: GCal3 V 1.0.2: Command find /home/osmc/domoticz/GCal3/ -type f ! -newer GCal3.json -name GCal3.pem -delete returned nil
2016-04-13 20:50:49.251 LUA: GCal3 V 1.0.2: Command /bin/ls /home/osmc/domoticz/GCal3/GCal3.pem returned true
2016-04-13 20:50:49.252 LUA: GCal3 V 1.0.2: Timezone is 2 hrs and 0 min
2016-04-13 20:50:49.252 LUA: GCal3 V 1.0.2: Running Plugin ...
2016-04-13 20:50:49.264 LUA: GCal3 V 1.0.2: local function: checkGCal
2016-04-13 20:50:49.264 LUA: GCal3 V 1.0.2: Checking semaphore
2016-04-13 20:50:49.300 LUA: GCal3 V 1.0.2: Command /bin/ls /home/osmc/domoticz/GCal3/GCal3.sem returned true
2016-04-13 20:50:49.301 LUA: GCal3 V 1.0.2: Semaphore file returned xx
2016-04-13 20:50:49.336 LUA: GCal3 V 1.0.2: Command /bin/ls /home/osmc/domoticz/GCal3/GCal3.sem returned true
2016-04-13 20:50:49.337 LUA: GCal3 V 1.0.2: Device xx claimed semaphore
2016-04-13 20:50:49.340 LUA: GCal3 V 1.0.2: StartMin is 2016-04-12T22:00:00Z StartMax is 2016-04-14T18:50:00Z
2016-04-13 20:50:49.340 LUA: GCal3 V 1.0.2: End of day is 2016-04-13T23:59:59
2016-04-13 20:50:49.340 LUA: GCal3 V 1.0.2: local function: requestCalendar
2016-04-13 20:50:49.341 LUA: GCal3 V 1.0.2: local function: get_access_token
2016-04-13 20:50:49.341 LUA: GCal3 V 1.0.2: Getting a new token
2016-04-13 20:50:50.417 LUA: GCal3 V 1.0.2: Got new token
2016-04-13 20:50:50.420 LUA: GCal3 V 1.0.2: Checking google calendar
2016-04-13 20:50:51.020 LUA: GCal3 V 1.0.2: Error getting calendar data: {
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
2016-04-13 20:50:51.022 LUA: GCal3 V 1.0.2: Device xx released the semaphore - reason: calendar check complete
2016-04-13 20:50:51.024 LUA: GCal3 V 1.0.2: Next check will be in 500 sec on 2016-04-13 at 20:59:11
2016-04-13 20:50:51.029 LUA: GCal3 V 1.0.2: Device xx released the semaphore - reason: initialization complete
2016-04-13 20:50:51.030 LUA: GCal3 V 1.0.2: Switch recent status: Off
2016-04-13 20:50:51.050 EventSystem: Script event triggered: /home/osmc/domoticz/scripts/lua/script_device_gcal.lua


The GCalnnCalendarID is set to [email protected]

The calendar is set in the same account where I created the Google API Credential.

As device name I used "GCalCheck xxx" where xxx is the exact name of the calendar.

Where I can check?

Thanks

woody4165
Posts: 412
Joined: Monday 14 March 2016 14:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby woody4165 » Wednesday 13 April 2016 21:12

Just set the calendar Public, and it's working.

What can I check since I would like to let the calendar remain private?

Thanks

woody4165
Posts: 412
Joined: Monday 14 March 2016 14:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby woody4165 » Wednesday 13 April 2016 21:20

In a few minutes I found my issue.


It's related to the last page of the Setting up a Google V3 API Service Account.PDF

You have to grab the client_email from GCal3.json and share the calendar with this email address with option to modify and manage.

That's made me the trick!!!

User avatar
BakSeeDaa
Posts: 293
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby BakSeeDaa » Thursday 14 April 2016 11:50

woody4165 wrote:In a few minutes I found my issue.


It's related to the last page of the Setting up a Google V3 API Service Account.PDF

You have to grab the client_email from GCal3.json and share the calendar with this email address with option to modify and manage.

That's made me the trick!!!


I'm glad it worked out for You. :D
Best wishes

// บักสีดา

woody4165
Posts: 412
Joined: Monday 14 March 2016 14:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby woody4165 » Thursday 14 April 2016 12:37

I saw in one of the lua script to put in the lua folder something related to AutoRemote with a fixed ip in it.
What's this for?

User avatar
BakSeeDaa
Posts: 293
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby BakSeeDaa » Thursday 14 April 2016 12:56

woody4165 wrote:I saw in one of the lua script to put in the lua folder something related to AutoRemote with a fixed ip in it.
What's this for?


AutoRemote is not being used for BakSeeDaa´s Google Calendar for Domoticz. In the file bakseeda.lua there are several more or less generic functions that I use in my personal installation. If You find some of them useful, you may use them to whatever you want. :D
Best wishes

// บักสีดา

oxedgar
Posts: 6
Joined: Sunday 10 April 2016 11:59
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby oxedgar » Thursday 14 April 2016 20:06

woody4165 wrote:In a few minutes I found my issue.


It's related to the last page of the Setting up a Google V3 API Service Account.PDF

You have to grab the client_email from GCal3.json and share the calendar with this email address with option to modify and manage.

That's made me the trick!!!



Hi , thank you, it's work with this .

oxedgar
Posts: 6
Joined: Sunday 10 April 2016 11:59
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby oxedgar » Friday 15 April 2016 6:22

I can try your script's now but i cannot set on / off a virtual device.

I created one virtual device for this special use. I need to set on my wather gerden system from april to september to allow it. i've created two events on google calendar and i can get it correctly on Domoticz.

I have created a blocky for test this using a uservariable GCal158TrippedEvent to set on my device.

Wehn i change manually the value of this uservariable ( to "ARROSAGE AUTOMATIQUE=ON" or "ARROSAGE AUTOMATIQUE=OFF", the blocky works but it not work automaticly when your script make the change of uservariable GCal158TrippedEvent !
Have you any idea wath append?

here my blocky
blocky.png
blocky.png (26.36 KiB) Viewed 1164 times


here the log

Code: Select all

2016-04-15 05:48:31.334 User: Admin initiated a switch command
2016-04-15 05:48:31.667 LUA: GCal3 V 1.0.2: Calendar device GCal - Domotique (idx:158 ) initializing
2016-04-15 05:48:31.728 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/ returned true
2016-04-15 05:48:31.783 LUA: GCal3 V 1.0.2: Command /bin/rm -f /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-15 05:48:31.822 LUA: GCal3 V 1.0.2: Command bin/rm -f /home/pi/domoticz/GCal3/*.token returned nil
2016-04-15 05:48:31.822 LUA: GCal3 V 1.0.2: Checking semaphore
2016-04-15 05:48:31.883 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned nil
2016-04-15 05:48:31.883 LUA: GCal3 V 1.0.2: Semaphore file returned nil
2016-04-15 05:48:31.884 LUA: GCal3 V 1.0.2: Device 158 requested semaphore
2016-04-15 05:48:31.937 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-15 05:48:31.938 LUA: GCal3 V 1.0.2: Device 158 claimed semaphore
2016-04-15 05:48:31.939 LUA: GCal3 V 1.0.2: Variables initialized ...
2016-04-15 05:48:31.998 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/scripts/lua/json.lua returned true
2016-04-15 05:48:32.018 LUA: GCal3 V 1.0.2: local function: checkforcredentials
2016-04-15 05:48:32.078 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.json returned true
2016-04-15 05:48:32.137 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.json returned true
2016-04-15 05:48:32.214 LUA: GCal3 V 1.0.2: Command find /home/pi/domoticz/GCal3/ -type f ! -newer GCal3.json -name GCal3.pem -delete returned nil
2016-04-15 05:48:32.285 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.pem returned true
2016-04-15 05:48:32.285 LUA: GCal3 V 1.0.2: Timezone is 2 hrs and 0 min
2016-04-15 05:48:32.285 LUA: GCal3 V 1.0.2: Running Plugin ...
2016-04-15 05:48:32.306 LUA: GCal3 V 1.0.2: local function: checkGCal
2016-04-15 05:48:32.306 LUA: GCal3 V 1.0.2: Checking semaphore
2016-04-15 05:48:32.359 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-15 05:48:32.360 LUA: GCal3 V 1.0.2: Semaphore file returned 158
2016-04-15 05:48:32.420 LUA: GCal3 V 1.0.2: Command /bin/ls /home/pi/domoticz/GCal3/GCal3.sem returned true
2016-04-15 05:48:32.420 LUA: GCal3 V 1.0.2: Device 158 claimed semaphore
2016-04-15 05:48:32.433 LUA: GCal3 V 1.0.2: StartMin is 2016-04-14T22:00:00Z StartMax is 2016-04-16T03:48:00Z
2016-04-15 05:48:32.433 LUA: GCal3 V 1.0.2: End of day is 2016-04-15T23:59:59
2016-04-15 05:48:32.433 LUA: GCal3 V 1.0.2: local function: requestCalendar
2016-04-15 05:48:32.433 LUA: GCal3 V 1.0.2: local function: get_access_token
2016-04-15 05:48:32.434 LUA: GCal3 V 1.0.2: Getting a new token
2016-04-15 05:48:33.743 LUA: GCal3 V 1.0.2: Got new token
2016-04-15 05:48:33.745 LUA: GCal3 V 1.0.2: Checking google calendar
2016-04-15 05:48:34.094 LUA: GCal3 V 1.0.2: Device 158 released the semaphore - reason: calendar check complete
2016-04-15 05:48:34.094 LUA: GCal3 V 1.0.2: local function: getEvents
2016-04-15 05:48:34.094 LUA: GCal3 V 1.0.2: There were 2 events retrieved
2016-04-15 05:48:34.096 LUA: GCal3 V 1.0.2: Effective Event Name ARROSAGE AUTOMATIQUE=ON[0,0]{}
2016-04-15 05:48:34.098 LUA: GCal3 V 1.0.2: Effective Event Name ARROSAGE AUTOMATIQUE=OFF[0,0]{}
2016-04-15 05:48:34.098 LUA: GCal3 V 1.0.2: Events Today = 2
2016-04-15 05:48:34.099 LUA: GCal3 V 1.0.2: Events Left Today = 2
2016-04-15 05:48:34.099 LUA: GCal3 V 1.0.2: local function: saveEvents
2016-04-15 05:48:34.099 LUA: GCal3 V 1.0.2: Active Events:
2016-04-15 05:48:34.140 LUA: GCal3 V 1.0.2: Command chmod 644 /home/pi/domoticz/GCal3/events158.json returned true
2016-04-15 05:48:34.141 LUA: GCal3 V 1.0.2: json active event list []
2016-04-15 05:48:34.141 LUA: GCal3 V 1.0.2: Next Event: ARROSAGE AUTOMATIQUE=ON
05:53 Apr 15 to 05:55 Apr 15
2016-04-15 05:48:34.141 LUA: GCal3 V 1.0.2: Cancel any active event
2016-04-15 05:48:34.141 LUA: GCal3 V 1.0.2: local function: setTrippedOff
2016-04-15 05:48:34.141 LUA: GCal3 V 1.0.2: Event-End Inactive
2016-04-15 05:48:34.143 LUA: GCal3 V 1.0.2: Next check will be in 266 sec on 2016-04-15 at 05:53:00
2016-04-15 05:48:34.290 LUA: GCal3 V 1.0.2: Device 158 released the semaphore - reason: initialization complete
2016-04-15 05:48:34.291 LUA: GCal3 V 1.0.2: Switch recent status:
2016-04-15 05:48:34.291 LUA: GCal3 V 1.0.2: Setting new Switch status to: Off
2016-04-15 05:48:34.331 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_device_gcal.lua


here the log when i change manually the GCal158TrippedEvent

Code: Select all

2016-04-15 06:16:32.559 ooooooooooooooooooooooooooooooooooooooooffffffff
2016-04-15 06:16:32.560 EventSystem: Event triggered: GCal - Déclenacheurs_2
2016-04-15 06:16:33.456 (Capteurs perso) Light/Switch (GCal - Arrosage autorisé)

Code: Select all

2016-04-15 06:17:31.568 oooooooooooooooooooooooooooooooooooooooon
2016-04-15 06:17:31.570 EventSystem: Event triggered: GCal - Déclenacheurs_1
2016-04-15 06:17:31.729 (Capteurs perso) Light/Switch (GCal - Arrosage autorisé)


Your script work only with lua ? i need to make one or i can simply use blocky?

woody4165
Posts: 412
Joined: Monday 14 March 2016 14:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby woody4165 » Friday 15 April 2016 9:28

Is it possible (in an easy way) to get the duration of an event from the text device?
I was thinking to use the calendar events to manage my irrigation, like oxedgar.

Combining the calendar event with weather forecast it should be not to difficult...

oxedgar
Posts: 6
Joined: Sunday 10 April 2016 11:59
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby oxedgar » Friday 15 April 2016 18:08

woody4165 wrote:Is it possible (in an easy way) to get the duration of an event from the text device?
I was thinking to use the calendar events to manage my irrigation, like oxedgar.

Combining the calendar event with weather forecast it should be not to difficult...


hello,

I prefert to add one event on gcal to set on and another to set off to prevent troubles with reboots or other unwanted reasons!
In my case, in just need to use this virtual device to allow it during the summertime. it's not this to control irrigation directlly but it appear like a master on/off button. My irrigation is all automated by Domoticz using a gardena valves and home made activatiors powred by arduino and wirred by ethernet.
I can talk my domotic system is all home made by myself!

User avatar
BakSeeDaa
Posts: 293
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby BakSeeDaa » Monday 27 June 2016 10:50

oxedgar wrote:Your script work only with lua ? i need to make one or i can simply use blocky?


I'm not a "blockly guy". I know that blockly had some issues before on reacting to changes to a virtual text device. But that is a pure blockly related question. I have no idea.
Best wishes

// บักสีดา

User avatar
BakSeeDaa
Posts: 293
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby BakSeeDaa » Monday 27 June 2016 10:53

woody4165 wrote:Is it possible (in an easy way) to get the duration of an event from the text device?
I was thinking to use the calendar events to manage my irrigation, like oxedgar.

Combining the calendar event with weather forecast it should be not to difficult...


There is no such information held by the text device. However You should be able to calculate that by acessing the json events fetched for the calendar device.
Best wishes

// บักสีดา

Fainted
Posts: 19
Joined: Thursday 08 September 2016 13:47
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby Fainted » Thursday 08 September 2016 13:52

Hello, have this been implemented as an hardware plugin yet? Think i haven't seen it, would be amazing if it got implemented!

four2six
Posts: 56
Joined: Wednesday 24 February 2016 10:16
Target OS: Raspberry Pi
Domoticz version:
Location: NRW, Germany
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby four2six » Friday 09 September 2016 13:25

Thank you for this great feature, this is a great help to me!

It seems to work great, even though I see an error occurring every 12 seconds or so:

Code: Select all

Error: EventSystem: in /home/pi/domoticz/scripts/lua/._script_device_gcal.lua: /home/pi/domoticz/scripts/lua/._script_device_gcal.lua:1: unexpected symbol


any idea what this could be? not sure where to start my search

four2six
Posts: 56
Joined: Wednesday 24 February 2016 10:16
Target OS: Raspberry Pi
Domoticz version:
Location: NRW, Germany
Contact:

Re: BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

Postby four2six » Tuesday 13 September 2016 9:30

upon further research, there were 4 hidden lua files that caused the errors to happen. i renamed them not to be executed and i notice no difference except the errors are gone. did they have any purpose?


Return to “Show your projects”

Who is online

Users browsing this forum: No registered users and 1 guest