ThingLayer: An open source real-time web interface for IoT

Data is still there, I am making changes to the underlying data storage mechanisms for graphing and analysis. I also upgraded the rails version, ruby version, and most of the gems. I should be finished with the migration this weekend.

Same here.

ok, so made some pretty good progress. to dockerize it, there are some additional requirements (ruby-dev in order to run bundle install)…just little things. i will probably have to build and destroy several times, in order to get into a decent repeatable container. still debating on if i want to run this in a single container or a couple. the “docker” way, would be to run the db and app server separately and link them, so that other services can use the mysql container independently as well. as i’m working through it, i’ll try to think through the best approach. maybe for the first iteration, we can create a single container, followed up shortly with a dual container deployment. more to come soon…

I have thinglayer installed on a private server. Everything looks like its setup correctly, its pulling in my devices from ST, I see data was created in firebase. After I made zones/locations I am seeing the devices on my dashboard and things like the ST water alarm show the current temperature, but if I actually click on a device to look at the graph, i get this error:

any ideas what might be the cause of that?

I think I know why you are seeing this. I will push a fix later today.

thanks. great application from what I have seen so far.

Thanks @Mike_Devlin

Do a git pull and you should have your charts now. Note: Charts are still very much a work in progress.

yep, that fixed it. Charts show data since I turned it on last night now. Now i just need to get more sensors… thanks

This looks very promising, and I’m excited to try it out, but I keep running into an SSL error whenever I bind the server to and try to access it remotely. Is the application defaulting to SSL in production? The install instructions sort of leave a little bit to the imagination when it comes to configuring the Rails app properly, unless we’re just supposed to run in dev by default.

Yes it defaults to ssl in production. Please see line 41 in the production.rb config file. Set this option to false.

config.force_ssl = true

There are also several other steps required relating to the asset pipeline and other features when running production mode. If you are not familiar with running a rails server in production mode, I would suggest you point your hosted site at the development environment. Sorry if the docs are not clear as there are a lot of different methods when it comes to running it in production mode. If you have any other feedback about the documentation, I would love to hear it.

Thanks, I switched to dev and was able to get it up and running. As I understand it, the idea is that I treat this as a locally hosted, multi-user application with just a single user.

Is this the proper approach to setup?

  1. Setup a new FireBase app
  2. Create the SmartApp, making sure to update the FireBase URL in the last function to the one you just created
  3. Publish the SmartApp
  4. Enable OAuth for the app
  5. Add the SmartApp to your SmartThings location, enabling whatever devices you’d like to track
  6. Setup the Rails application with MySQL for config data, Redis for the event feed?, and using the OAuth, MySQL, and FireBase info you should already have from previous steps
  7. Start the application
  8. The application will look just like, meaning you’ll have to sign up before you can use it
  9. Once signed up, click Services, and SmartThings Connect should be your only option
  10. Connecting will require that you log into the SmartThings API and authorize the app to control devices (the authorize screen should automatically show the same selections you made when you added the App to SmartThings, since we referenced it when we setup the Rails app)
  11. Click Import Devices to load the authorized devices
  12. Create at least 1 location and zone as each device must be linked to a zone before you can us it
  13. Go to ‘Manage Things’ and edit each device 1 by 1 to give it a name and zone - they won’t be usable until you do

Note - Name is not imported automatically, and must be entered for each device
Note - locations and zones are not imported from SmartThings, and only affect the ThingLayer app.

Do you mind posting your Dockerfile here or a link to GitHub for it? We could work on it together to help share the work.

I built 2 containers (mysql shared and the thinglayer app) by hand and created an image from those just to have something quickly, but it’s not really the intention of Docker and not great for transparency.

This is an optional friendly name and it is not really used anywhere at this point. The device name from SmartThings is imported automatically. In the future the friendly name will be used for voice commands and other features. I will add your steps to the wiki to help anyone else who might have the same questions. Most of those are answered in the FAQ on the hosted website I need to bring those over to the wiki.

At this point SmartThings does not give developers access to groups/rooms so yes they are only related to ThingLayer features.

There are some things in development that will take advantage of the multi-user aspect. Like granting access to only specific zones or devices.

Is the thinglayer site still up? I have not been able to access it now for several weeks.

I have had some problems with my host and DDOS attacks. They took my servers offline for a period. I was in the process of closing the beta as well. I will be hosting ThingLayer only for demo purposes going forward but the source is available for you to host your own server. I am looking for maintainers to take over as well.

1 Like

sure. i wanted to use a CI/Jenkins to build the container and push it Docker Hub, but I just got swamped lately…I mean, crushed. this stuff is really hot right now, but it’s prioritized a lot of other things in front of this. i want to get back to this over the holiday break, and then i’ll let you know. it will be a published dockerfile on github though…that’s the only way to do it imo.

that’s rough jody…sorry to hear that! have you checked into using OSSEC or some other tool to try and prevent something like this? hard to do much about a DDOS, if that’s what you determined it to be. i’ve been looking into OSSEC and even Sort via containers (and even in a kubernetes orchestration environment) for my own stuff…let me know if i can help in any way.

If you want to share any of the details of the DDoS, i may be able to help out.

@jody.albritton ok when did this happen? Congrats?

1 Like

Hey @jody.albritton and Happy Holidays,

I got the ThingLayer package running well. I have an idea that may serve as a useful visualization for us, and I don’t know if it can be done with the chart package, AmCharts, you have used. Basically, I would like to see a graph of “power” (in watts) with respect to time, and then have studded across the timeline, the x-axis, maybe as vertical lines or text notations, the various other events, such as arrivals, switches turned on and off, etc. I’ll enclose a little cobbled together example picture of what I mean. Basically overlay all the other relevant events on top of the power graph.


1 Like