I have set up OpenHAB to control some hue lights using this tutorial and i plan to continue by making my own sensors and buying some ZWave stuff.
But right now i am working on a separate project. I want to use an ESP8266 to control a set of peristaltic pumps by controlling transistors to turn them on an off. Essentially all i want to do is send commands from a website to turn the GPIO on the ESP8266 on/off.
The catch is that this website will contain a database of all different drinks and whatnot. The pumps which the ESP8266 controls will be connected to different cocktail ingredients, essentially making a cocktail mixing robot. The website needs a database of drinks so that you can tell it what ingredients you have and it will show you what drinks you can make with them. It will then send the commands to make the drink to the ESP8266 (for instance if you have gin, tonic, vodka, and orange juice it will display gin and tonic or a screwdriver. If you select Screwdrivier it will send (Pump1:50mL; pump2: 150mL) to the ESP which will interpret this and control the pumps.
Since the website will be a bit complex needing a database and such, it will need to run on its own server.
Heres the meat of my problem: I don’t want to have to buy a new raspberry pi for each project that requires a webserver, i already have two (one of which is dedicated for 3D printing). I want to know if its possible to run OpenHAB alongside this website and if so how would i go about differentiating the two when i type raspberrypi.local (or the IP of the raspberry pi). Is it as simple as running the other website on a different port (right now OpenHAB is running on port 8080)?
Even though openHAB is running on port 8080 i dont need to enter “:8080” at the end when i type into my browser, so i am concerned openHAB is controlling all incoming traffic.
What is the best way of setting up this website on the same raspberry pi (is it even possible?).
Secondly, if you guys know anything about this whats the best way to send instructions to a ESP8266 from a generic website running on a server?