[NEEDS UPDATING] Raspberry Pi Relay Controller (WebIOPi)

Hi Alisson,

I tested it again and on my side it’s accurate execpt a bug in initialize
When I tested to recreate my smartapps I found a possible bug, if you don’t update the config the updating GPIO Map is not started.
It’s fixed in a new update.
Did you try to debug WebIOPi logs?
I don’t have these problems with the relays on my hardware but I know that another person work on inverted relay.
Hope he will share with us his work :wink:

Kall

Having a discussion with someone on the FB group… Would it be possible to utilize this for the purposes of running a command on the Pi, rather than triggering a GPIO pin? The functionality would allow control of a service on the unit, such as en/disable the VPN service.

I have my Pi up and running Webiopi and it is controlling relays for garage doors and sensing some door contacts as well. It works fine on all the devices, but I have a problem with Webiopi refreshing with Smartthings. After so much time the device no longer communicates through Smarttings. It still shows all of the devices, but for me to open the door or see if the door is open via the app I have to manually go into each device and then Smart Apps, select Webiopi to go into the first screen then click save to refresh the device. After that they work fine again for a while, but it always happens. Is there a way to input code or something so this refresh happens every 5 seconds or something in the background at all times. I have this partially set up as a security sensor and it doesn’t serve it’s purpose if it doesn’t sense the door is open at all times.

Thanks in advance.

I like the possibilities of your script with the update option but it gives me an error every single time I try to use/add anything.
the old groov scripts work just fine but they seem to leave my gpio in an off state and not always turn off/on the relays…

Question… if I want to add the repo to my Github integration… what data should I use?

Did you add other groovy files from my repo (relay, contacts, temp)?
Could you post the log?

I made an enhancement of the update process schedule in the repo, because sometimes, the schedule stop by itself. Trying another way

My GPIO list does not have IN listed next to GPIO, it just has gray boxes. I’m also getting some errors on the pi. This one doesn’t look good:

  • NameError: global name ‘GPIO’ is not defined (line 258 in http.py)

However, it appears to be communicating with SmartThings just fine. I added a test GPIO 25 and then renamed it, and the changes are showing in the log:
The POST path is: /GPIO/25/value/0
debug Executing 'setDeviceState’
debug Setting initial state of Window - Office to off
debug Found existing device which we will now update
debug getChildDevices(false), children=2
trace Searching for: piRelay.192.168.1.183.25
debug The GET path is: /*
trace Updating GPIO map
debug Updated with settings: [piIP:192.168.1.183, piPort:8000, theHub:Home Hub, deviceName1:Window - Office, deviceType1:switch, deviceConfig1:25]

Thoughts? I want to use this to monitor different contacts I have wired from a previous alarm system.

Sam

Bueller? Bueller?

No such file or directory exists

maybe change the instructions so its cd WebIOPi-0.7.1 I think it will help people out :slight_smile:

Hello I’ve been working with this project and it’s really fantastic but what I am trying to do now is wire a transmitter and wireless receiver so that I can control let’s say my garage door without having to hardwire it from the Raspberry Pi and relay but I’m having trouble with the code I need to install on the Raspberry Pi connected to the receiver

Hi Cynthia

Coincidentally I am doing exactly the same thing right now …

In my setup, I have roller garage doors and separate electric control for each door, with wireless transmitters for each. Given this, the approach I am taking is to link some of the GPIOs on the Pi to optoisolators which then actuates each individual button on the garage door remote control … so it works like a momentary button push rather than relay on / relay off

The code to achieve this is a simplified version of the smart app / dth that comes with WebIOPi

What approach are you taking?

yes i added all of them. I stopped messing with it. I took the code differences from your code and the original code and used a few snipits and everything works perfect. I need to make a video but I am in the process of remodeling.

Hi,

I have been using this to control a relay which has been working perfectly.

I decided to setup another pi with a second relay in a different room, which can also be controlled fine.

The issue is that at random when switched on, the devices show they are pulsing on and off (however the relay itself is not and is just showing in the Smartthings app)

This stops if one of the Pi’s is shut down.

Does anyone have any ideas as to what may be causing this?

Cheers

Jamie

I installed this and everything seemed successful but when I try to browse the page I get an error "this page isn’t working unexpectedly closed the connection. err_content_length_mismatch. a telnet to port 8000 confirms that the port is listening. just doesnt display the page. any suggestions?

Read though everything… fix is there… [RELEASE] Raspberry Pi Relay Controller (WebIOPi)

@Syntheses, did you ever find an answer to modifying the code to execute scripts on the Pi? I am looking to exactly the same thing.

Sadly, no. I don’t have the development skills to make something happen either.

This is version 2. More professional/commercial setup.
This is a picture on the bench before I installed it.
I also used the node.JS scripting to support the amazon Dash buttons and ASUS ac68u router to “parental control” the amazon Dash buttons from accessing the internet.

12 sainsmart relays 8+4 board
Pi 3 with patch
12v 10amp DIn mount PSU ( bigger lower one )
5v 5amp DIN PSU ( upper one )
3 Din Rails
Lots of 3D printer wire chain and brackets
12v x10 Fuse block.
115VAC to 18VAC transformer Din mount is on its way from china to attach at the bottom for my ring doorbell.
20180302_204553

Good morning from Texas Kall
thank you for all your help i finally got everything installed and it is working just fine with one exception on the contact sensor side.
When the door is actually closed the sensor reads/shows up on the SmartThings app as Open and (gray background) and when you actually open the garage door the sensor reads as Closed (green background) how can i fix this since is the opposite of whats supposed to be??
On the webIOpi i have set the GPIO pins where the sensors are connected as IN and done all the necessary connections right.
Any help will be greatly appreciated
Denis

Hi @richland007,

You may try this:

Blockquote
I had a problem where all of my sensors and switches were opposite (open vs closed and on vs off). I know very little coding and it took a little trial and error.
On the contact sensor device handler I had to flip the 0 and 1 on lines 83 and 86
On the relay I had to make two changes.
On the device handler I had to flip the 0 and 1 just like the contact sensor on 83 and 86. In the SmartApp I had to flip the 0 and 1 in the array on line 437 and 447

@JohnnyBoyGee made this. tx to him
https://community.smartthings.com/t/raspberry-pi-garage-door-opener-with-current-state/119432

Sorry for the delay but I have a lot to do and take care of my family.