BakSeeDaa´s Google Calendar for Domoticz V 1.0.2 Released

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.
User avatar
Ferpando
Posts: 30
Joined: Friday 23 October 2015 9:45
Target OS: NAS (Synology & others)
Domoticz version:
Location: Spain
Contact:

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

Postby Ferpando » Saturday 07 November 2015 11:47

Hello,

Sorry for the delay.
I installed the new version and it seems to be working fine for the time being. I'll keep you informed when a sinology update comes.
Here's the log.

2015-11-07 10:40:00.741 LUA: GCal3 V 1.0.2: Calendar device Calendar Vera (idx:24 ) initializing
2015-11-07 10:40:00.745 LUA: GCal3 V 1.0.2: Command /bin/ls /usr/local/domoticz/var/GCal3/ returned true
2015-11-07 10:40:00.748 LUA: GCal3 V 1.0.2: Command /bin/rm -f /usr/local/domoticz/var/GCal3/GCal3.sem returned true
2015-11-07 10:40:00.751 LUA: GCal3 V 1.0.2: Command bin/rm -f /usr/local/domoticz/var/GCal3/*.token returned nil
2015-11-07 10:40:00.751 LUA: GCal3 V 1.0.2: Checking semaphore
2015-11-07 10:40:00.755 LUA: GCal3 V 1.0.2: Command /bin/ls /usr/local/domoticz/var/GCal3/GCal3.sem returned nil
2015-11-07 10:40:00.755 LUA: GCal3 V 1.0.2: Semaphore file returned nil
2015-11-07 10:40:00.755 LUA: GCal3 V 1.0.2: Device 24 requested semaphore
2015-11-07 10:40:00.759 LUA: GCal3 V 1.0.2: Command /bin/ls /usr/local/domoticz/var/GCal3/GCal3.sem returned true
2015-11-07 10:40:00.759 LUA: GCal3 V 1.0.2: Device 24 claimed semaphore
2015-11-07 10:40:00.759 LUA: GCal3 V 1.0.2: Variables initialized ...
2015-11-07 10:40:00.762 LUA: GCal3 V 1.0.2: Command /bin/ls /usr/local/domoticz/var/scripts/lua/json.lua returned true
2015-11-07 10:40:00.764 LUA: GCal3 V 1.0.2: local function: checkforcredentials
2015-11-07 10:40:00.767 LUA: GCal3 V 1.0.2: Command /bin/ls /usr/local/domoticz/var/GCal3/GCal3.json returned true
2015-11-07 10:40:00.771 LUA: GCal3 V 1.0.2: Command /bin/ls /usr/local/domoticz/var/GCal3/GCal3.json returned true
2015-11-07 10:40:00.775 LUA: GCal3 V 1.0.2: Command find /usr/local/domoticz/var/GCal3/ -type f ! -newer GCal3.json -name GCal3.pem -delete returned nil
2015-11-07 10:40:00.778 LUA: GCal3 V 1.0.2: Command /bin/ls /usr/local/domoticz/var/GCal3/GCal3.pem returned true
2015-11-07 10:40:00.779 LUA: GCal3 V 1.0.2: Timezone is 1 hrs and 0 min
2015-11-07 10:40:00.779 LUA: GCal3 V 1.0.2: Running Plugin ...
2015-11-07 10:40:00.780 LUA: GCal3 V 1.0.2: local function: checkGCal
2015-11-07 10:40:00.780 LUA: GCal3 V 1.0.2: Checking semaphore
2015-11-07 10:40:00.783 LUA: GCal3 V 1.0.2: Command /bin/ls /usr/local/domoticz/var/GCal3/GCal3.sem returned true
2015-11-07 10:40:00.784 LUA: GCal3 V 1.0.2: Semaphore file returned 24
2015-11-07 10:40:00.787 LUA: GCal3 V 1.0.2: Command /bin/ls /usr/local/domoticz/var/GCal3/GCal3.sem returned true
2015-11-07 10:40:00.787 LUA: GCal3 V 1.0.2: Device 24 claimed semaphore
2015-11-07 10:40:00.787 LUA: GCal3 V 1.0.2: StartMin is 2015-11-06T23:00:00Z StartMax is 2015-11-08T09:40:00Z
2015-11-07 10:40:00.787 LUA: GCal3 V 1.0.2: End of day is 2015-11-07T23:59:59
2015-11-07 10:40:00.788 LUA: GCal3 V 1.0.2: local function: requestCalendar
2015-11-07 10:40:00.788 LUA: GCal3 V 1.0.2: local function: get_access_token
2015-11-07 10:40:00.788 LUA: GCal3 V 1.0.2: Getting a new token
2015-11-07 10:40:00.948 LUA: GCal3 V 1.0.2: Got new token
2015-11-07 10:40:00.949 LUA: GCal3 V 1.0.2: Checking google calendar
2015-11-07 10:40:01.177 LUA: GCal3 V 1.0.2: Device 24 released the semaphore - reason: calendar check complete
2015-11-07 10:40:01.177 LUA: GCal3 V 1.0.2: local function: getEvents
2015-11-07 10:40:01.177 LUA: GCal3 V 1.0.2: There were 1 events retrieved
2015-11-07 10:40:01.178 LUA: GCal3 V 1.0.2: Effective Event Name PEPE[0,0]{}
2015-11-07 10:40:01.178 LUA: GCal3 V 1.0.2: Events Today = 1
2015-11-07 10:40:01.178 LUA: GCal3 V 1.0.2: Events Left Today = 1
2015-11-07 10:40:01.178 LUA: GCal3 V 1.0.2: local function: saveEvents
2015-11-07 10:40:01.178 LUA: GCal3 V 1.0.2: Active Events: PEPE
2015-11-07 10:40:01.182 LUA: GCal3 V 1.0.2: Command chmod 644 /usr/local/domoticz/var/GCal3/events24.json returned true
2015-11-07 10:40:01.182 LUA: GCal3 V 1.0.2: json active event list [{"eventName":"PEPE","eventParameter":""}]
2015-11-07 10:40:01.182 LUA: GCal3 V 1.0.2: Next Event: PEPE


Thank you for your dedication :-)

User avatar
BakSeeDaa
Posts: 244
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 Release

Postby BakSeeDaa » Saturday 07 November 2015 18:03

OK @ferpando. Let me know if You encounter any problems.
Best wishes

// บักสีดา

User avatar
capman
Posts: 103
Joined: Friday 12 July 2013 20:48
Target OS: NAS (Synology & others)
Domoticz version: v.3.6277
Location: Belgium
Contact:

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

Postby capman » Wednesday 11 November 2015 12:33

I have testing your latest update (v 1.0.2) , and it's working fine with my synology server. After the update of my synology server , the script's are still running good.
Very nice job !!

User avatar
BakSeeDaa
Posts: 244
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 Release

Postby BakSeeDaa » Wednesday 11 November 2015 12:35

capman wrote:I have testing your latest update (v 1.0.2) , and it's working fine with my synology server. After the update of my synology server , the script's are still running good.
Very nice job !!


Thanks capman. I'm really happy to know. :D :D :D
Best wishes

// บักสีดา

Triple0s
Posts: 3
Joined: Sunday 15 November 2015 13:34
Target OS: Linux
Domoticz version:
Contact:

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

Postby Triple0s » Sunday 15 November 2015 13:47

hello I'm new in domoticz and I'm french ;-)

First, congratulations for this job :o

now I've a problem with the script.
I run in linux and I get an error with the token :-)
Is it normal that the file /home/sylvain/domoticz/GCal3/GCal3.sem have root owner ?


See my log

can you help me ?

Code: Select all

 2015-11-15 12:30:01.564 LUA: GCal3 V 1.0.2: Calendar device GCal VMC (idx:166 ) initializing
2015-11-15 12:30:01.568 LUA: GCal3 V 1.0.2: Command /bin/ls /home/sylvain/domoticz/GCal3/ returned true
2015-11-15 12:30:01.571 LUA: GCal3 V 1.0.2: Command /bin/rm -f /home/sylvain/domoticz/GCal3/GCal3.sem returned true
2015-11-15 12:30:01.573 LUA: GCal3 V 1.0.2: Command bin/rm -f /home/sylvain/domoticz/GCal3/*.token returned nil
2015-11-15 12:30:01.573 LUA: GCal3 V 1.0.2: Checking semaphore
2015-11-15 12:30:01.578 LUA: GCal3 V 1.0.2: Command /bin/ls /home/sylvain/domoticz/GCal3/GCal3.sem returned nil
2015-11-15 12:30:01.578 LUA: GCal3 V 1.0.2: Semaphore file returned nil
2015-11-15 12:30:01.578 LUA: GCal3 V 1.0.2: Device 166 requested semaphore
2015-11-15 12:30:01.581 LUA: GCal3 V 1.0.2: Command /bin/ls /home/sylvain/domoticz/GCal3/GCal3.sem returned true
2015-11-15 12:30:01.581 LUA: GCal3 V 1.0.2: Device 166 claimed semaphore
2015-11-15 12:30:01.581 LUA: GCal3 V 1.0.2: Variables initialized ...
2015-11-15 12:30:01.584 LUA: GCal3 V 1.0.2: Command /bin/ls /home/sylvain/domoticz/scripts/lua/json.lua returned true
2015-11-15 12:30:01.585 LUA: GCal3 V 1.0.2: local function: checkforcredentials
2015-11-15 12:30:01.590 LUA: GCal3 V 1.0.2: Command /bin/ls /home/sylvain/domoticz/GCal3/GCal3.json returned true
2015-11-15 12:30:01.593 LUA: GCal3 V 1.0.2: Command /bin/ls /home/sylvain/domoticz/GCal3/GCal3.json returned true
2015-11-15 12:30:01.596 LUA: GCal3 V 1.0.2: Command find /home/sylvain/domoticz/GCal3/ -type f ! -newer GCal3.json -name GCal3.pem -delete returned nil
2015-11-15 12:30:01.600 LUA: GCal3 V 1.0.2: Command /bin/ls /home/sylvain/domoticz/GCal3/GCal3.pem returned true
2015-11-15 12:30:01.600 LUA: GCal3 V 1.0.2: Timezone is 1 hrs and 0 min
2015-11-15 12:30:01.600 LUA: GCal3 V 1.0.2: Running Plugin ...
2015-11-15 12:30:01.600 LUA: GCal3 V 1.0.2: local function: checkGCal
2015-11-15 12:30:01.600 LUA: GCal3 V 1.0.2: Checking semaphore
2015-11-15 12:30:01.603 LUA: GCal3 V 1.0.2: Command /bin/ls /home/sylvain/domoticz/GCal3/GCal3.sem returned true
2015-11-15 12:30:01.603 LUA: GCal3 V 1.0.2: Semaphore file returned 166
2015-11-15 12:30:01.608 LUA: GCal3 V 1.0.2: Command /bin/ls /home/sylvain/domoticz/GCal3/GCal3.sem returned true
2015-11-15 12:30:01.608 LUA: GCal3 V 1.0.2: Device 166 claimed semaphore
2015-11-15 12:30:01.608 LUA: GCal3 V 1.0.2: StartMin is 2015-11-14T23:00:00Z StartMax is 2015-11-16T11:30:00Z
2015-11-15 12:30:01.608 LUA: GCal3 V 1.0.2: End of day is 2015-11-15T23:59:59
2015-11-15 12:30:01.608 LUA: GCal3 V 1.0.2: local function: requestCalendar
2015-11-15 12:30:01.608 LUA: GCal3 V 1.0.2: local function: get_access_token
2015-11-15 12:30:01.608 LUA: GCal3 V 1.0.2: Getting a new token
2015-11-15 12:30:01.817 LUA: GCal3 V 1.0.2: The token request returned an error: {
"error" : "invalid_grant"
}
2015-11-15 12:30:01.817 LUA: GCal3 V 1.0.2: Fatal error trying to get access token
2015-11-15 12:30:01.818 LUA: GCal3 V 1.0.2: Device 166 released the semaphore - reason: calendar check complete
2015-11-15 12:30:01.818 LUA: GCal3 V 1.0.2: Next check will be in 500 sec on 2015-11-15 at 12:38:21
2015-11-15 12:30:01.818 LUA: GCal3 V 1.0.2: Device 166 released the semaphore - reason: initialization complete
2015-11-15 12:30:01.818 LUA: GCal3 V 1.0.2: Switch recent status: Off
2015-11-15 12:30:01.820 EventSystem: Script event triggered: /home/sylvain/domoticz/scripts/lua/script_device_gcal.lua
2015-11-15 12:30:01.554 (Virtuel) Lighting 2 (GCalCheck VMC)

User avatar
BakSeeDaa
Posts: 244
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 Release

Postby BakSeeDaa » Sunday 15 November 2015 14:57

Triple0s wrote:hello I'm new in domoticz and I'm french ;-)

First, congratulations for this job :o

now I've a problem with the script.
I run in linux and I get an error with the token :-)
Is it normal that the file /home/sylvain/domoticz/GCal3/GCal3.sem have root owner ?


See my log

can you help me ?


Hi Triple0s

It looks like Domoticz has been denied access to your calendar. My guess is that there is a problem with the way you've set up the Google credentials. Please check carefully that You've followed all the steps necessary. If You still can not find the problem let me know and I will see if I can help you further.

Google Credentials
You will need explicit credentials (service account) as well as an ID that identifies the calendar you wish to access.
You will also need to share the calendar with your service account. Stuart made an excellent description to help you do that. It's published here with his permission. Download the Setting up a Google V3 API Service Account.PDF
Best wishes

// บักสีดา

Triple0s
Posts: 3
Joined: Sunday 15 November 2015 13:34
Target OS: Linux
Domoticz version:
Contact:

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

Postby Triple0s » Sunday 15 November 2015 16:08

OK thank you for your help.

That's work

in fact, I've migrated my domoticz from raspberry to my linux server and i've copied the database scripts and co.

I've decided to erase all datas for Gcal and restart the installation from zero.

now that's work :mrgreen:

User avatar
BakSeeDaa
Posts: 244
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 Release

Postby BakSeeDaa » Sunday 15 November 2015 16:23

Triple0s wrote:OK thank you for your help.

That's work

in fact, I've migrated my domoticz from raspberry to my linux server and i've copied the database scripts and co.

I've decided to erase all datas for Gcal and restart the installation from zero.

now that's work :mrgreen:


I'm happy to hear that. Good luck with Your new linux server. :mrgreen:
Best wishes

// บักสีดา

User avatar
Ferpando
Posts: 30
Joined: Friday 23 October 2015 9:45
Target OS: NAS (Synology & others)
Domoticz version:
Location: Spain
Contact:

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

Postby Ferpando » Tuesday 17 November 2015 10:06

I can confirm it works both after Synology and Domoticz upgrade.
Good work!

Now I have another question.
I created 2 events a minute apart, and seems only the first one is active.
So, if an event is active, ¿no other events work?

Here's the log:

2015-11-17 08:45:00.578 LUA: GCal3 V 1.0.2: Checking google calendar
2015-11-17 08:45:00.798 LUA: GCal3 V 1.0.2: Device 24 released the semaphore - reason: calendar check complete
2015-11-17 08:45:00.798 LUA: GCal3 V 1.0.2: local function: getEvents
2015-11-17 08:45:00.798 LUA: GCal3 V 1.0.2: There were 2 events retrieved
2015-11-17 08:45:00.798 LUA: GCal3 V 1.0.2: Effective Event Name TEST[0,0]{}
2015-11-17 08:45:00.798 LUA: GCal3 V 1.0.2: Effective Event Name TEST2[0,0]{}
2015-11-17 08:45:00.798 LUA: GCal3 V 1.0.2: Events Today = 2
2015-11-17 08:45:00.798 LUA: GCal3 V 1.0.2: Events Left Today = 2
2015-11-17 08:45:00.798 LUA: GCal3 V 1.0.2: local function: saveEvents
2015-11-17 08:45:00.798 LUA: GCal3 V 1.0.2: Active Events: TEST
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: Command chmod 644 /usr/local/domoticz/var/GCal3/events24.json returned true
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: json active event list [{"eventName":"TEST","eventParameter":""}]
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: Next Event: TEST
08:45 Nov 17 to 09:45 Nov 17
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: local function: setTrippedOff
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: Event-End Finished
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: WE CAN'T WAIT, CAN WE? Waiting 5 sec to activate the next event
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: Event-Start TEST 11/17 08:45 Active
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: Next check will be in 3600 sec on 2015-11-17 at 09:45:00
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: Device 24 released the semaphore - reason: initialization complete
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: Switch recent status: Off
2015-11-17 08:45:00.802 LUA: GCal3 V 1.0.2: Setting new Switch status to: On


TEST2 event was supposed to happen at 8:46, so I created an alert but the calendar device only shows TEST event, so alert never gets sent

User avatar
BakSeeDaa
Posts: 244
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 Release

Postby BakSeeDaa » Tuesday 17 November 2015 12:03

Ferpando wrote:I created 2 events a minute apart, and seems only the first one is active.
So, if an event is active, ¿no other events work?


Hi Ferpando

If I understand right, you have created 2 overlapping events in Google Calandar.

TEST from 08:45 to 09:45
and
TEST2 starting at 08:46 (End time unknown)

What will happen is that the Text device will display "TEST" during the time 08:45 to 09:45
If the TEST2 event ends after that the TEST ends, the "Text device" will display "TEST2" at 09:45 when TEST ends.

The "Calendar Device" will be on from 08:45 until there is no active event left in your calendar.

The Text device will only display one event.

I believe that you've set up an alert when the "Calendar Device" is "On". If You need to be alerted also for overlapping events you'd need to set up multiple BGCD devices pointing at the same Google Calendar (using some filtering). If that can not meet your needs you can script whatever you want using the eventsnn.json file.

Did I answer your question?
Best wishes

// บักสีดา

User avatar
Ferpando
Posts: 30
Joined: Friday 23 October 2015 9:45
Target OS: NAS (Synology & others)
Domoticz version:
Location: Spain
Contact:

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

Postby Ferpando » Tuesday 17 November 2015 13:22

Yes. Thank you.
It was just a test for the moment. I usually have only one event at a time, as I have a separate calendar for domotics.

User avatar
BakSeeDaa
Posts: 244
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 Release

Postby BakSeeDaa » Tuesday 17 November 2015 13:53

Ferpando wrote:Yes. Thank you.
It was just a test for the moment. I usually have only one event at a time, as I have a separate calendar for domotics.


OK. :mrgreen:

As You probably know, there is normally no need for a separate Google Calendar for Domoticz. In most cases it will work fine with your personal calendar (or a public calendar), use keyword filtering if necessary. You may put a keyword in the event title or in the event description.
Best wishes

// บักสีดา

deennoo
Posts: 637
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 Release

Postby deennoo » Monday 23 November 2015 13:38

Thanks for your Job !! works great !
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / ESP8266 / MQTT / BLE
http://domo-attitude.fr

User avatar
BakSeeDaa
Posts: 244
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 Release

Postby BakSeeDaa » Monday 23 November 2015 15:12

deennoo wrote:Thanks for your Job !! works great !


I'm happy to know. Thanks! :lol:
Best wishes

// บักสีดา

deennoo
Posts: 637
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 Release

Postby deennoo » Monday 23 November 2015 18:24

BakSeeDaa wrote:I'm happy to know. Thanks! :lol:


I'm run a test domoticz on android device with linux deploy, not all script works !
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / ESP8266 / MQTT / BLE
http://domo-attitude.fr

ricorico94
Posts: 53
Joined: Monday 26 October 2015 11:41
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Postby ricorico94 » Tuesday 08 December 2015 19:49

Hi,

Your module seems very interesting, but I must admit I don't understand how to use it in practice when reading the posts.
If you want to use google calendar to manage several devices (multiple lights, stores, heaters..), do you need to create one calendar per device to be managed ?
Also, I read that "Google Calendar" device is On or Off: if you want to manage a light with dimmer and order the dimmer to switch on light at 20% at 7:00am and at 50% at 7:10am, can we use your scripts, or is it only for on/off states currently ?

My own target would be to use google calendar to manage 6 or 7 heaters and each of them should receive different values (through "dimmer" orders, in fact). On longer term, I'd probably also add some orders to open/close stores. Do you think I could use your scripts for that purpose ? I also saw the disclaimer about "don"t use google Calendar for critical usage", but is there another approach for managing heaters based on complex planning ? (other than your script and other than scripts with dozens of "if..else if else if else.." and manually changing them every time a day is not "looking like" a standard day..?)

Ricorico94

User avatar
BakSeeDaa
Posts: 244
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 Release

Postby BakSeeDaa » Wednesday 09 December 2015 9:16

ricorico94 wrote:Hi,

Your module seems very interesting, but I must admit I don't understand how to use it in practice when reading the posts.
If you want to use google calendar to manage several devices (multiple lights, stores, heaters..), do you need to create one calendar per device to be managed ?
Also, I read that "Google Calendar" device is On or Off: if you want to manage a light with dimmer and order the dimmer to switch on light at 20% at 7:00am and at 50% at 7:10am, can we use your scripts, or is it only for on/off states currently ?

My own target would be to use google calendar to manage 6 or 7 heaters and each of them should receive different values (through "dimmer" orders, in fact). On longer term, I'd probably also add some orders to open/close stores. Do you think I could use your scripts for that purpose ? I also saw the disclaimer about "don"t use google Calendar for critical usage", but is there another approach for managing heaters based on complex planning ? (other than your script and other than scripts with dozens of "if..else if else if else.." and manually changing them every time a day is not "looking like" a standard day..?)

Ricorico94


Hello @Ricorico94

For each instance you set up, You get a virtual switch, a "Calendar Device" that will follow the calendar that You've specified according to the filter settings etc. BGCD will not manage any devices for you. You will have to create your own Home Automation logics by scripting or by Blockly. Your logics will just look at the on/off status of the "Calendar Device". Then You can script to control as many devices as you wish using the status of a single "Calendar Device".

You will need to set up multiple BGCD "Calendar Devices" if you want to connect to several Google Calendars or if you have many different types of Calendar Events that you want to filter on. For example, You can have a single Google Calendar where you mix events for "heating" and events for "walking the dog". You may then set up a "Calendar Device" for each of the different event types you wish to automate, using filtering as You probably wouldn't like to start the heating just because a "walking dog" event is active.

So, what You get with BGCD is just a single virtual switch; The "Calendar Device" that reflects what's active in a Google Calendar.

In Your own scripts, You can use the status of the "Calendar Device" in combination with any other device (temperature, weather. door status, light levels etc) to do whatever you like.

Don't use this software in situations where a software failure or a drop of internet connection can lead to any kind of damage or disturb your relation to your wife (or husband).
Best wishes

// บักสีดา

ricorico94
Posts: 53
Joined: Monday 26 October 2015 11:41
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Postby ricorico94 » Wednesday 09 December 2015 12:31

Hi,

So, if I understand properly, you mean that I could setup a single calendar in google: every time an entry is found in this calendar, your script forces the "Google Calendar device" to become "ON" instead of OFF, which can be used to trigger other events in Blockly.
At that point, the blockly script (or other script) should look at the google entry (the one which forced the calendar to become "ON") thanks to the value of "Status MYCALENDARNAME" device (which you name also "Text Device"): so I should find a way in Blockly to analyse the content of this text to deduct if this content is asking for "walking the dog" or asking for "switch the Heater XX to Comfort mode" ? I'm not sure I got your point when writing
" You may then set up a "Calendar Device" for each of the different event types you wish to automate, using filtering"


Ricorico94

User avatar
BakSeeDaa
Posts: 244
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 Release

Postby BakSeeDaa » Wednesday 09 December 2015 13:01

ricorico94 wrote:Hi,

So, if I understand properly, you mean that I could setup a single calendar in google: every time an entry is found in this calendar, your script forces the "Google Calendar device" to become "ON" instead of OFF, which can be used to trigger other events in Blockly.
At that point, the blockly script (or other script) should look at the google entry (the one which forced the calendar to become "ON") thanks to the value of "Status MYCALENDARNAME" device (which you name also "Text Device"): so I should find a way in Blockly to analyse the content of this text to deduct if this content is asking for "walking the dog" or asking for "switch the Heater XX to Comfort mode" ? I'm not sure I got your point when writing
" You may then set up a "Calendar Device" for each of the different event types you wish to automate, using filtering"


Ricorico94


The blockly script (or other script) should only check the status of the Calendar Device switch. (On or Off)

Set a keyword (filtering on keyword) on the calendar device to filter what events you are interested in
Set the user variable named GCalnnKeyword to only trigger on certain Calendar Events.
Set the user variable named GCalnnexactKeyword if you only want to match the exact keyword given.


If You set GCalnnKeyword to "dog" only events with the word "dog" in the title or the description will trigger an event.

If You also need to control heating you can set up BGCD for multiple Google Calendars. Then You will end up with multiple Goggle Calendar devices. These devices can be set up using the same Google Calendar but using different keywords if that's what You like.
Best wishes

// บักสีดา

deennoo
Posts: 637
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 » Sunday 28 February 2016 22:24

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 ?
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / ESP8266 / MQTT / BLE
http://domo-attitude.fr


Return to “Show your projects”

Who is online

Users browsing this forum: No registered users and 2 guests