Checking for a software and IoT oriented solution that helps to monitor environmental conditions....
Public Lab is an open community which collaboratively develops accessible, open source, Do-It-Yourself technologies for investigating local environmental health and justice issues.
As an open source community, we believe in open licensing of content so that other members of the community can leverage your work legally -- with attribution, of course. By joining the Public Lab site, you agree to release the content you post here under a Creative Commons Attribution Sharealike license, and the hardware designs you post under the CERN Open Hardware License 1.1 (full text). This has the added benefit that others must share their improvements in turn with you.
First, using a spectrometer in the visible range ,by itself, normally isn't possible. You normally have to add chelating agents to make the metals visible and adjust the ph . Chromium might be an exception to this, depending on the detection limits.
There are standard methods for detecting metals in liquids. Check with the epa for the specific method. But they are rarely continuous. Usually, they require sampling the water and adding reagents for testing. Many also require moderately expensive equipment.