[OBSOLETE] Raspberry Pi Device Type

@mark_n, Thank you for replying. I modified the raspberrypi.py file like you advised, still no joy.

@rcoodey, You say that you saw a grayed out window in the Simulation window for the API. I also have that window still, always have, can you verify that the smartthings.php I posted file is correct?

I wonder if the problem isn’t with the smartthings code… on all other devices I see the Current States match somewhat the Tiles I can use. but I only have this from SmartThings

when there should be Polling, Refresh, Temperature Measurement, Switch, Sensor, Actuator, and Contact Sensor listed here.

Hi @Mcorry, your smartthings.php looks fine… here is mine, only difference is I addeded all the GPIO pins now:

{
  "1M_load":"<?=$load_average[0]?>",
  "5M_load":"<?=$load_average[1]?>",
  "15M_load":"<?=$load_average[2]?>",
  "cpu_temp":"<?=$temperature?>",
  "cpu_speed":"<?=$speed?>",
  "cpu_volt":"<?=$voltage?>",
  "cpu_perc":"<?=$cpu_perc?>",
  "disk_usage":"<?=$disk_perc?>",
  "mem_avail":"<?=$mem_avail?>",
  "gpio_value_2":"<?=$gpio_values[2]?>",
  "gpio_value_3":"<?=$gpio_values[3]?>",
  "gpio_value_4":"<?=$gpio_values[4]?>",
  "gpio_value_7":"<?=$gpio_values[7]?>",
  "gpio_value_8":"<?=$gpio_values[8]?>",
  "gpio_value_9":"<?=$gpio_values[9]?>",
  "gpio_value_10":"<?=$gpio_values[10]?>",
  "gpio_value_11":"<?=$gpio_values[11]?>",
  "gpio_value_14":"<?=$gpio_values[14]?>",
  "gpio_value_15":"<?=$gpio_values[15]?>",
  "gpio_value_17":"<?=$gpio_values[17]?>",
  "gpio_value_18":"<?=$gpio_values[18]?>",
  "gpio_value_22":"<?=$gpio_values[22]?>",
  "gpio_value_23":"<?=$gpio_values[23]?>",
  "gpio_value_24":"<?=$gpio_values[24]?>",
  "gpio_value_25":"<?=$gpio_values[25]?>",
  "gpio_value_27":"<?=$gpio_values[27]?>"
}

And I show all the states on my device:

So it might be your device handler code, maybe try reloading that. Also, what do you get if you browse to [http://raspi_ip/api_command/smartthings]? You should see the JSON with the values. This is what the SmartThings device will pull from.

Sorry for the long delay, I just got back in town. Thank you for responding and showing me really clear examples.
When I enter
http://raspi_ip/api_command/smartthings
I get “ERROR: Unknown Command” in the webpage.

I went and deleted the Raspberry Pi Device Type in SmartThings as well as my devices, started over with the guide found here https://github.com/nicholaswilde/berryio-smartthings/wiki/Installation. I actually tried using the Github integration (nicholaswilde was not on the list) so I went the manual path, Created from code, and received the same result. My Raspberry Pi device still shows only the switch Current State.

Just to add, I’m not overclocking and did this on a fresh image. However, I am using Rasbian Jessie (11-21-2015) version. So That could be the cause. Does anyone have this working on Jessie?

@Mcorry Did you ever get this working? I went through it all last night and do have it working. Shoot me a msg if you need some help.

Hi,

I’m new to smartthings and have just got my RPi 2 going, can see the status updates and all looks good - I have a question though and don’t seem to be able to find any mention and this may be my lack of knowledge…

When I use my Android tablet to change the contact state - the relay I have connected across GPIO17 doesn’t do anything, I can only change the contact state via BerryIO and then it is reflected on the app.

Is this by design? I thought it (the tablet) could control the RPi GPIO.

thanks
Andre

Is this project dead??? I followed the Berryio instruction Found Here but ran into issues right near the beginning. In particular running the script berryio_install.sh. during the Enabling the BerryIo Site configuration phase. At that point the script failed and Berryio was not installed. I found another (similar) script that did install BerryIO and I was able to access the PI via the web interface without issue.

My next problem(s) are within the ST app itself and are similar to those described above, In particular, ending up with a screen like

Has anyone recently have this working?? Additionally, where/what is this *.php file? I have no such file anywhere.

I’m not sure what is the status of this project. I was thinking of writing my own project in a few months to just monitor the Raspi’s that I have operating in the home. I would not perform two-way control or reboot, since I do not like opening up my home systems to external internet through SmartThings.

1 Like

Looks like there’s a BerryIO project which replaced this (see OP at the top) but after looking at the sheer amount of code and dependencies, I wrote my own.

I wrote a simple 2-file solution. One is a PHP script that does everything one can want from the Raspberry Pi and the other is a Device Handler for SmartThings. The two are very powerful and for now have been acting reliably for me as a gate trigger/short. See this link:

Raspberry Pi to PHP to GPIO to Relay to Gate/Garage Trigger

All the best

Just saw this. I just got an raspberry Pi and am interested in a custome device that will report moisture from a moisture prob and possible turn on s sprinkler relay. All this through smarting so of course

Thanks! This should, be very help full.

For those of us “linux peasants” some additional instructions would be nice. So far my ST Device shows a near empty page with only icons for “Gate”, “Test” and “Reboot” showing.

Unclear on the following:
Placing the index.php in /var/www/html but what else???
ST Device option :
Post or Get. Which?
URL Path?

I don’t want to hijack this thread so please post question in my thread instead. To answer your question, use POST and URL Path I leave blank because Apache by default serves out index.php

And yes ANY Linux peasant can use this, not just Raspberry Pi users :slight_smile:

All the best!

My “problems” is the result of following the Berryio instruction/setup described above. The default website now is the Berryio folder. Instructions on how to revert back to using the default folder by changing to Berryio port number are provided but I got side tracked (and lost) :slight_smile:

I see, this is a question for the BerryIO author. I thought you quoted my post which means that you were using my code. If you are indeed using my code, then please post on my thread. What I can’t do is walk you through removing/changing BerryIO configuration (since I’ve never used it) to make my “simple” implementation work. Easier to start with a new Raspbian install IMO.

Thanks!

No actually is was not. I was saying that my problem getting your device to work was due to the changes made to default web folders by the Berryio install.

New Raspbian install should do it — and probably easiest on time with respect to recovery or a fresh-start. If you have issues after that with my code please post on my thread.

Update:
Already managed to get most of it working, except my parse() function doesn’t appear to ever trigger create or sendEvents. not sure whats up.

Original message:
I’ve installed berryio on a rpi3, there were some issues; php needed to be configured for short ?> php strings to work, and I had some manual apache2 config, as well as finishing up the installer manually since it aborted due to the apache2 differences.

Beyond that, it’s working! The one thing I’m trying to figure out is how to add a switch ie, relay control from smartthings in groovy. Haven’t quite nailed that down, I see a contacts example, but I believe that’s just a display of contact on/off, not the ability to switch GPIO.

Hopefully someone has some groovy examples for setting up a GPIO switch in smartthings.

Thanks!

Hi,

I ran into there same issues with the difference between Apache 2.2 and 2.4. Sadly I did not solve it. Can you share what you did?

Thanks

Simon

1 Like

Can you elaborate. I did get Berryio installed but not using the script linked above. Using the original link I ran into the same problem. Aborted at Apache2 install/update. As for the .php file. I assume that was included with the Berryio install? Because I installed Berryio from another source I am guessing thats the reason no such file exists for me

“Already managed to get most of it working, except my parse() function doesn’t appear to ever trigger create or sendEvents. not sure whats up.”

Having the same problem. I poll the raspberry to check the gpio status, it figure out the pin 17 is on. Which is hooked up to a simple led right now. But when I send the event my button one change to ON.

Oddly I can click the tile and turn it on and off and it changes colors. But reset the device type by dragging it down turns it back to the default.

I just found aapache2 rpi3 tutorial and followed it, then I installed berryio non forked version from NeonHorizon on top of it. That worked perfect. Then I installed the berryio-smartthing version of berryio from git on top of that. I tested the api_command/smartthings and it worked. Only think I can figure out is how to get it to give ma status for GPIO pins other than 17.