Extend standard module (openRemoteHelpers)

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Extend standard module (openRemoteHelpers)

Post by pz1 »

For release 1.4.1 I did describe a method to control Somfy sunscreens using the Raspberry PI GPIO interface. As I would like to make that method compatible with Z-Way 2.x, I consider to locally extend the OpenRemoteHelpers module with an adapted version of the code described in the above link:

Code: Select all

case "Somfy":
  switch (N)
    {
    case "up":
      WPi=14;
    break;
    case "stop":
      WPi=13;
    break;
    case "down":
      WPi=12;
    break;
    }
  system("/opt/z-way-server/automation/storage/GPIO.sh " + WPi);
  return Action;
}  

/* SomfyScreen description
OpenRemote usage: http://raspberry_IP:8083/JS/Run/SomfyScreen/N
This function makes use the wiringPi module (http://wiringpi.com/)
It controls the physical connector header pins 19,21,23 that are accessible
next to the RaZberry device.
This function calls script GPIO.sh:
--------------
#!/bin/sh
PIN=$1
/usr/local/bin/gpio mode $PIN out
/usr/local/bin/gpio write $PIN 1
sleep 0.1
/usr/local/bin/gpio write $PIN 0
--------------
Make sure that GPIO.sh is executable (chmod +x GPIO.sh)
The parameter represents the WiringPi pin number (see http://wiringpi.com/pins)
The supported Action can be: up, down, stop
*/
Or should I make a separate module?
Since 29-12-2016 I am no longer a moderator for this forum
Post Reply