Gigaset Elements Cli - domoticz support

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.
micbou
Posts: 88
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi
Domoticz version:
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by micbou » Monday 09 May 2016 19:54

I got everything up and working. I see my Base (red, because I need to set one of my sensors back up) and motion in the log from the motion detector. The motion switch doesn't change color on motion, right? Im planning to let the switch change to 'away' when the last person leaves the house (using the BT Beacon from this topic (index.php?mark_notification=29483&hash=6a92d7e0) and send me a Telegram message when a alert is triggered.

Any advice on how to get the 'mode' switch in there?

Again, thanks a lot. Really appreciate all the help and I learned a lot from all the steps you guided me through.

dynasticorpheus
Posts: 115
Joined: Monday 12 October 2015 15:26
Target OS: Linux
Domoticz version: 2.3295
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by dynasticorpheus » Monday 09 May 2016 20:24

Create a new selector switch:

Image

Set it up like this:

Image


The actions are:

script:///usr/local/bin/gigasetelements-cli -m home
script:///usr/local/bin/gigasetelements-cli -m custom
script:///usr/local/bin/gigasetelements-cli -m away

also in your /etc/gigasetelements-cli.conf change:

modus: home

into

modus:

Otherwise every time you run the cli it will change the modus into home
micbou wrote:I got everything up and working. I see my Base (red, because I need to set one of my sensors back up) and motion in the log from the motion detector. The motion switch doesn't change color on motion, right? Im planning to let the switch change to 'away' when the last person leaves the house (using the BT Beacon from this topic (index.php?mark_notification=29483&hash=6a92d7e0) and send me a Telegram message when a alert is triggered.

Any advice on how to get the 'mode' switch in there?

Again, thanks a lot. Really appreciate all the help and I learned a lot from all the steps you guided me through.

dynasticorpheus
Posts: 115
Joined: Monday 12 October 2015 15:26
Target OS: Linux
Domoticz version: 2.3295
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by dynasticorpheus » Monday 09 May 2016 21:43

micbou wrote:I got everything up and working. I see my Base (red, because I need to set one of my sensors back up) and motion in the log from the motion detector. The motion switch doesn't change color on motion, right? Im planning to let the switch change to 'away' when the last person leaves the house (using the BT Beacon from this topic (index.php?mark_notification=29483&hash=6a92d7e0) and send me a Telegram message when a alert is triggered.

Any advice on how to get the 'mode' switch in there?

Again, thanks a lot. Really appreciate all the help and I learned a lot from all the steps you guided me through.
I actually already have added telegram support in the cli itself but need to refine this a bit more before I push it to github.

micbou
Posts: 88
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi
Domoticz version:
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by micbou » Sunday 15 May 2016 13:18

Great!

How do I set an action w/ Blocky? I want to play a voice command and send a message via telegram.

dynasticorpheus
Posts: 115
Joined: Monday 12 October 2015 15:26
Target OS: Linux
Domoticz version: 2.3295
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by dynasticorpheus » Monday 16 May 2016 10:00

micbou wrote:Great!

How do I set an action w/ Blocky? I want to play a voice command and send a message via telegram.
Still need to work a bit more on the native Telegram support in my cli but Domoticz can also do this for you by calling a simple bash script in the on/off action field of a device:

Follow step 1, 2, 3, and 5 of below instructable to get an authorization token and chat ID. (step 4 not needed)

http://www.instructables.com/id/Telegra ... /?ALLSTEPS

Create telegram-cli.sh with below code and replace TOKEN / CHATID with those you got from doing above steps.

Code: Select all

#!/bin/sh -e

# Telegram token
TOKEN=bot*************************************************

# Telegram chat ID
CHATID=12345678

curl -o /dev/null -s -X POST "https://api.telegram.org/$TOKEN/sendMessage" -F chat_id=$CHATID -F text="$1 $2 $3 $4 $5 $6 $7 $8 $9 $10"
Now you can call this script in the on/off action field in a device but first make sure it works by testing it in your terminal first. Use correct path of script but it should look like something below.

script:///home/user/script/telegram-cli.sh Hoi, dit is een TEST!

micbou
Posts: 88
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi
Domoticz version:
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by micbou » Monday 16 May 2016 15:38

I got the Telegram service up, but I want to trigger it when the alarm goes of or even when motion is detected..

micbou
Posts: 88
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi
Domoticz version:
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by micbou » Sunday 29 May 2016 22:47

hi, I was forced to clean install my Domoticz/RPi3 today. I tried working through the installation again and it seemed to work, but I ran into this error running gigasetelements-cli -tt

Code: Select all

root@raspberrypi:/etc# gigasetelements-cli -tt

Gigaset Elements - Command-line Interface v1.5.0b1

[-] Configuration     | LOADED   | /etc/gigasetelements-cli.conf
[-] Identity          | VERIFIED | User logged in successfully.
[-] Authentication    | SUCCESS  | 
[-] Basestation       | ONLINE   | E52C011F30C1BE84C86895D96C76D693
[-] Status            | GREEN    | Modus HOME

[-] ERROR             | UNKNOWN  | HTTPConnectionPool(host='192.68.1.112', port=8080): Max retries exceeded with url: /json.htm?type=command&param=addlogmessage&message=Gigaset%20Elements%20-%20Command-line%20Interface:%20Domoticz%20mode%20started (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x763cd290>: Failed to establish a new connection: [Errno 101] Network is unreachable',))
when I switch mode in the selector the log shows:

Code: Select all

2016-05-29 22:46:53.652 (Gigaset Elements Modus) Light/Switch (Gigaset Elements Modus)
2016-05-29 22:46:54.445 Executing script: /usr/local/bin/gigasetelements-cli
2016-05-29 22:46:55.025 Error: Error executing script command (/usr/local/bin/gigasetelements-cli). returned: 512

Any idea?

dynasticorpheus
Posts: 115
Joined: Monday 12 October 2015 15:26
Target OS: Linux
Domoticz version: 2.3295
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by dynasticorpheus » Monday 30 May 2016 9:32

micbou wrote:hi, I was forced to clean install my Domoticz/RPi3 today. I tried working through the installation again and it seemed to work, but I ran into this error running gigasetelements-cli -tt

Code: Select all

root@raspberrypi:/etc# gigasetelements-cli -tt

Gigaset Elements - Command-line Interface v1.5.0b1

[-] Configuration     | LOADED   | /etc/gigasetelements-cli.conf
[-] Identity          | VERIFIED | User logged in successfully.
[-] Authentication    | SUCCESS  | 
[-] Basestation       | ONLINE   | E52C011F30C1BE84C86895D96C76D693
[-] Status            | GREEN    | Modus HOME

[-] ERROR             | UNKNOWN  | HTTPConnectionPool(host='192.68.1.112', port=8080): Max retries exceeded with url: /json.htm?type=command&param=addlogmessage&message=Gigaset%20Elements%20-%20Command-line%20Interface:%20Domoticz%20mode%20started (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x763cd290>: Failed to establish a new connection: [Errno 101] Network is unreachable',))
when I switch mode in the selector the log shows:

Code: Select all

2016-05-29 22:46:53.652 (Gigaset Elements Modus) Light/Switch (Gigaset Elements Modus)
2016-05-29 22:46:54.445 Executing script: /usr/local/bin/gigasetelements-cli
2016-05-29 22:46:55.025 Error: Error executing script command (/usr/local/bin/gigasetelements-cli). returned: 512

Any idea?
Best guess would be an authorization issue. In domoticz settings check the option Local Networks (no username/password) and add

Code: Select all

127.0.0.*;192.68.1.*
btw are you sure your ip is 192.68.1.112 and not 192.168.1.112 ???

francocouly
Posts: 6
Joined: Monday 30 May 2016 17:16
Target OS: -
Domoticz version:
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by francocouly » Monday 30 May 2016 17:32

Hi all,

I have some problems with the gigasetelements-cli.

I have created 3 .sh scripts that refer to the 5 actions from the Gigaset Elements System :
2016-05-30 17_24_25-Photos.png
2016-05-30 17_24_25-Photos.png (68.9 KiB) Viewed 2810 times
but impossible to have the Domoticz working. No errors, but no actions.

For example, the away.sh script contain :

#!/bin/bash

/etc/gigasetelements-cli/gigasetelements-cli.py -m away -q > /dev/null


However, my scripts runs well in putty, changing the mode of the Gigaset Elements System.

Can you help me please ? :)

For information, I run Domoticz and gigasetelements-cli on my Synology NAS.

Thanks

micbou
Posts: 88
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi
Domoticz version:
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by micbou » Monday 30 May 2016 17:35

dynasticorpheus wrote:
btw are you sure your ip is 192.68.1.112 and not 192.168.1.112 ???

:oops: embarrassing! Sorry for wasting your time on this one

micbou
Posts: 88
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi
Domoticz version:
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by micbou » Monday 30 May 2016 17:37

@francocouly, does below work?
Schermafbeelding 2016-05-30 om 17.36.27.png
Schermafbeelding 2016-05-30 om 17.36.27.png (269.64 KiB) Viewed 2807 times

francocouly
Posts: 6
Joined: Monday 30 May 2016 17:16
Target OS: -
Domoticz version:
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by francocouly » Monday 30 May 2016 17:48

No, it doesn't work, like the previous settings :
2016-05-30 17_47_17-Domoticz.png
2016-05-30 17_47_17-Domoticz.png (72.02 KiB) Viewed 2804 times
and nothing in the logs :
2016-05-30 17_45_30-TripAdvisor.png
2016-05-30 17_45_30-TripAdvisor.png (5.49 KiB) Viewed 2804 times
It's very weird, I don't understand :/

dynasticorpheus
Posts: 115
Joined: Monday 12 October 2015 15:26
Target OS: Linux
Domoticz version: 2.3295
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by dynasticorpheus » Monday 30 May 2016 19:30

francocouly wrote:No, it doesn't work, like the previous settings :

2016-05-30 17_47_17-Domoticz.png

and nothing in the logs :

2016-05-30 17_45_30-TripAdvisor.png

It's very weird, I don't understand :/
There is really no need to create separate scripts if you do a regular install. Please run below code:

Code: Select all

pip install --upgrade https://github.com/dynasticorpheus/gigasetelements-cli/zipball/develop
and follow below instructions:

viewtopic.php?f=38&t=8404&start=40#p85496

EDIT:

Don't know if you can do a regular install on a NAS but if not than I would suggest you put "python" in front of your command:

Code: Select all

#!/bin/bash
python /etc/gigasetelements-cli/gigasetelements-cli.py -m away -q > /dev/null

francocouly
Posts: 6
Joined: Monday 30 May 2016 17:16
Target OS: -
Domoticz version:
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by francocouly » Monday 30 May 2016 23:08

Hi,

Here is my configuration :
Screen Shot 2016-05-30 at 23.02.28.png
Screen Shot 2016-05-30 at 23.02.28.png (230.5 KiB) Viewed 2777 times
And my switch :
Screen Shot 2016-05-30 at 23.02.44.png
Screen Shot 2016-05-30 at 23.02.44.png (272.33 KiB) Viewed 2777 times
The sensors are OK, but still not able to set the modus with the script. It's running well in cmd line :
Screen Shot 2016-05-30 at 23.06.17.png
Screen Shot 2016-05-30 at 23.06.17.png (108.05 KiB) Viewed 2777 times
Thank you for your help

dynasticorpheus
Posts: 115
Joined: Monday 12 October 2015 15:26
Target OS: Linux
Domoticz version: 2.3295
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by dynasticorpheus » Tuesday 31 May 2016 8:46

francocouly wrote:Hi,

Here is my configuration :

Screen Shot 2016-05-30 at 23.02.28.png

And my switch :

Screen Shot 2016-05-30 at 23.02.44.png

The sensors are OK, but still not able to set the modus with the script. It's running well in cmd line :

Screen Shot 2016-05-30 at 23.06.17.png

Thank you for your help
I replicated your setup and it was working so we need to have a closer look, let's first route the output to a text file. Please share the output.

Code: Select all

script:///etc/gigasetelements-cli/gigasetelements-cli.py -m home >> /tmp/gigasetelements-cli.log

francocouly
Posts: 6
Joined: Monday 30 May 2016 17:16
Target OS: -
Domoticz version:
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by francocouly » Tuesday 31 May 2016 11:07

Hi,

thanks for your return !

when I add script:///etc/gigasetelements-cli/gigasetelements-cli.py -m home >> /tmp/gigasetelements-cli.log, no .log file can be found in my /tmp folder. Perhaps a problem of rights ?

dynasticorpheus
Posts: 115
Joined: Monday 12 October 2015 15:26
Target OS: Linux
Domoticz version: 2.3295
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by dynasticorpheus » Tuesday 31 May 2016 13:40

francocouly wrote:Hi,

thanks for your return !

when I add script:///etc/gigasetelements-cli/gigasetelements-cli.py -m home >> /tmp/gigasetelements-cli.log, no .log file can be found in my /tmp folder. Perhaps a problem of rights ?
Can you try again using below .sh script? Perhaps you first need to "cd" into the correct directory due to environment constraints?

Code: Select all

#!/bin/bash
cd /etc/gigasetelements-cli
python gigasetelements-cli.py -m away

francocouly
Posts: 6
Joined: Monday 30 May 2016 17:16
Target OS: -
Domoticz version:
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by francocouly » Tuesday 31 May 2016 14:12

Still not working.

the log file is created but empty, even if I add a "sudo -u admin" before the python command in the .sh script, add all the rights to this file, and the same for the log file

dynasticorpheus
Posts: 115
Joined: Monday 12 October 2015 15:26
Target OS: Linux
Domoticz version: 2.3295
Location: NL
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by dynasticorpheus » Tuesday 31 May 2016 15:06

francocouly wrote:Still not working.

the log file is created but empty, even if I add a "sudo -u admin" before the python command in the .sh script, add all the rights to this file, and the same for the log file
I needed to specify the full path to python to get it working. Can you try as well. First check if it is also /usr/bin/python for you.

Code: Select all

#!/bin/bash
cd /etc/gigasetelements-cli
/usr/bin/python gigasetelements-cli.py -m away

francocouly
Posts: 6
Joined: Monday 30 May 2016 17:16
Target OS: -
Domoticz version:
Contact:

Re: Gigaset Elements Cli - domoticz support

Post by francocouly » Tuesday 31 May 2016 17:07

Yessss ! It works perfectly :)

Thank you very much for your support !

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests