Seneye Aquarium Monitor - SWS Webserver → API → Home Assistant
Details and Attributes
See this original post by @notovich Влад Нотович without him this would not work.
What it Does
- This flow will extract data from the Seneye API every 3 minutes (Matches the 20 manual requests per hour)
- Sensor Output to Node Red Companion Sensors
- Alternate MQTT Sensor Output
- Use sensor output in Home Assistant to create graphs or display outputs
Requirements
NodeRed Companion: node-red-contrib-home-assistant-websocket
MQTT Sensors
- Built In
Step 1 - Setup SWS (Seneye Web Server)
- Seneye Setup Instructions
- Ensure you can access the SWS GUI (Graphic User Interface) directly via the URL e.g. http://2mop534r4o6l.sws.li/
- Ensure you have access via seneye.me account and readings are going through to your App.
Step 2 - Access the Seneye API
It is critical to test your API link and ensure it works
- DeviceID - Find your 12 character Device ID - e.g. 2mop534r4o6l
- [email protected] - The email address you registered with eye
- User_Password - Seneye.me password
Copy and place your details into the below URL remove the asteriks ** if there is any.
https ://api.seneye.com/v1/devices/DeviceID?IncludeState=1&user=[email protected]&pwd=User_Password
Paste your URL into a webbrowser and you should be greeted with the output of the Seneye API
NOTE: If you have two devices they will show up, use this to change the function node to read from that device.
Step 3 - Import Flow and Setup
IMPORT FLOW
Copy and Paste the below flow
In NodeRED click the hamburger icon and click import
Paste the flow into Import nodes dialoge (suggest selecting Import to new flow)
Click Import to import the flow into your NodeRed instance
HTTPS REQUEST NODE
- In the http request node paste your URL
DEBUG NODE USAGE
- If you have two devices use the debug node to copy the path of the reading you want
EDIT FUNCTION NODE
- Ensure the function node matches the path for the reading you want
SETUP NodeRED Companion Sensor
- Click on the Entity Config edit button
- Select your Home Assistant Server
- Repeat for all sensors and name/translate as you feel fit.
SETUP MQTT Sensor
- Select your MQTT Server
- Repeat for all sensors and name/translate as you feel fit.
Make your aquarium monitoring dashboard
[{"id":"097aa92b38953411","type":"group","z":"f1939796.abade8","name":"SENEYE MONITORING","style":{"label":true},"nodes":["a34e20ef.d65e8","8b274ef6.c7352","acbfe05f.fe984","e4ac4c11.167ef","97c2f3df.31cf5","23e3f222.9577ae","81942829.17e618","1bc0627b.4d29be","e9f6285a.609b58","ba2dfea6.ec175","6c40e3cd.3dc99c","edb8f828.f14df8","e2ecbfec.37f08","6916bb1d.35e384","fe5a48e8.54aec8","21a3d1a9.bca3fe","acfb54c9.a8ba28","db52d51e.3a7fb8","422061fa6f7fe183","a04be8591519d3dc","eb92c7aba036f7e1","bc7b222d14ec9ee9","8398c7612b911d52"],"x":134,"y":19,"w":1332,"h":582},{"id":"a34e20ef.d65e8","type":"function","z":"f1939796.abade8","g":"097aa92b38953411","name":"Temp","func":"msg.payload = Math.round(msg.payload[0].exps.temperature.curr * 10) / 10;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":280,"wires":[["bd9204ad849dace5"]]},{"id":"8b274ef6.c7352","type":"inject","z":"f1939796.abade8","g":"097aa92b38953411","name":"3 min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"180","crontab":"","once":true,"onceDelay":"60","topic":"","payload":"","payloadType":"date","x":230,"y":360,"wires":[["acbfe05f.fe984"]]},{"id":"acbfe05f.fe984","type":"http request","z":"f1939796.abade8","g":"097aa92b38953411","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.seneye.com/v1/devices/**DeviceID**?IncludeState=1&user=**[email protected]**&pwd=**User_Password**","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":250,"y":300,"wires":[["a34e20ef.d65e8","e4ac4c11.167ef","23e3f222.9577ae","6c40e3cd.3dc99c","e2ecbfec.37f08","97c2f3df.31cf5","81942829.17e618","1bc0627b.4d29be","e9f6285a.609b58","ba2dfea6.ec175","eb92c7aba036f7e1"]]},{"id":"e4ac4c11.167ef","type":"function","z":"f1939796.abade8","g":"097aa92b38953411","name":"Ph","func":"msg.payload = msg.payload[0].exps.ph.curr;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":320,"wires":[["c9135df4c206d7de"]]},{"id":"97c2f3df.31cf5","type":"function","z":"f1939796.abade8","g":"097aa92b38953411","name":"O2","func":"msg.payload = msg.payload[0].exps.o2.curr;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":360,"wires":[["32261c4eaf51df0a"]]},{"id":"23e3f222.9577ae","type":"function","z":"f1939796.abade8","g":"097aa92b38953411","name":"NH3","func":"msg.payload = msg.payload[0].exps.nh3.curr;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":400,"wires":[["cfca1a0c59f4efb8"]]},{"id":"81942829.17e618","type":"function","z":"f1939796.abade8","g":"097aa92b38953411","name":"NH4","func":"msg.payload = msg.payload[0].exps.nh4.curr;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":440,"wires":[["13f7473191f64493"]]},{"id":"1bc0627b.4d29be","type":"function","z":"f1939796.abade8","d":true,"g":"097aa92b38953411","name":"LUX","func":"msg.payload = msg.payload[0].exps.lux.curr;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":480,"wires":[[]]},{"id":"e9f6285a.609b58","type":"function","z":"f1939796.abade8","d":true,"g":"097aa92b38953411","name":"PAR","func":"msg.payload = msg.payload[0].exps.par.curr;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":520,"wires":[[]]},{"id":"ba2dfea6.ec175","type":"function","z":"f1939796.abade8","d":true,"g":"097aa92b38953411","name":"Kelvin","func":"msg.payload = msg.payload[0].exps.kelvin.curr;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":560,"wires":[[]]},{"id":"6c40e3cd.3dc99c","type":"function","z":"f1939796.abade8","g":"097aa92b38953411","name":"Last","func":"msg.payload = msg.payload[0].status.last_experiment;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":120,"wires":[["edb8f828.f14df8"]]},{"id":"edb8f828.f14df8","type":"moment","z":"f1939796.abade8","g":"097aa92b38953411","name":"","topic":"","input":"","inputType":"msg","inTz":"Australia/Hobart","adjAmount":0,"adjType":"days","adjDir":"add","format":"","locale":"C","output":"","outputType":"msg","outTz":"Australia/Hobart","x":700,"y":120,"wires":[["fe5a48e8.54aec8"]]},{"id":"e2ecbfec.37f08","type":"function","z":"f1939796.abade8","g":"097aa92b38953411","name":"slide","func":"msg.payload = msg.payload[0].status.slide_expires;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":160,"wires":[["6916bb1d.35e384"]]},{"id":"6916bb1d.35e384","type":"moment","z":"f1939796.abade8","g":"097aa92b38953411","name":"","topic":"","input":"","inputType":"msg","inTz":"Europe/London","adjAmount":0,"adjType":"days","adjDir":"add","format":"","locale":"C","output":"","outputType":"msg","outTz":"Europe/London","x":700,"y":160,"wires":[["21a3d1a9.bca3fe"]]},{"id":"fe5a48e8.54aec8","type":"change","z":"f1939796.abade8","g":"097aa92b38953411","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(msg.payload).fromNow()","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":120,"wires":[["acfb54c9.a8ba28","422061fa6f7fe183"]]},{"id":"21a3d1a9.bca3fe","type":"change","z":"f1939796.abade8","g":"097aa92b38953411","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(msg.payload).fromNow()","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":160,"wires":[["a04be8591519d3dc"]]},{"id":"acfb54c9.a8ba28","type":"switch","z":"f1939796.abade8","g":"097aa92b38953411","name":"if >45min","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"45 minutes ago","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1120,"y":120,"wires":[["db52d51e.3a7fb8"]]},{"id":"db52d51e.3a7fb8","type":"function","z":"f1939796.abade8","g":"097aa92b38953411","name":"Seneye no updated for 1H","func":"msg.payload = {}\nmsg.payload.chatId = 448821241\nmsg.payload.type = \"message\"\nmsg.payload.content = \"Seneye not updated for 1H\"\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1330,"y":120,"wires":[[]]},{"id":"422061fa6f7fe183","type":"ha-sensor","z":"f1939796.abade8","g":"097aa92b38953411","name":"Seneye Last Reading","entityConfig":"c2248a7503069b40","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1160,"y":60,"wires":[[]],"server":"Select_Your_Server"},{"id":"a04be8591519d3dc","type":"ha-sensor","z":"f1939796.abade8","g":"097aa92b38953411","name":"Seneye Slide Expiry","entityConfig":"8b4b6e6dde0731e4","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1160,"y":180,"wires":[[]],"server":"Select_Your_Server"},{"id":"eb92c7aba036f7e1","type":"debug","z":"f1939796.abade8","g":"097aa92b38953411","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":280,"y":140,"wires":[]},{"id":"bc7b222d14ec9ee9","type":"group","z":"f1939796.abade8","g":"097aa92b38953411","name":"Sensor Output Alternate MQTT","style":{"label":true},"nodes":["a2fc219047efdd72","58a2c3b2c39c90da","02488545fb8722fc","7cbba0526b248c01","ecf391724ee899ab"],"x":894,"y":239,"w":232,"h":242},{"id":"a2fc219047efdd72","type":"mqtt out","z":"f1939796.abade8","g":"bc7b222d14ec9ee9","name":"tele/seneye/last","topic":"tele/seneye/last","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"34f7583aa6e3efb2","x":1000,"y":280,"wires":[]},{"id":"58a2c3b2c39c90da","type":"mqtt out","z":"f1939796.abade8","g":"bc7b222d14ec9ee9","name":"tele/seneye/slide","topic":"tele/seneye/slide","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"34f7583aa6e3efb2","x":1010,"y":320,"wires":[]},{"id":"02488545fb8722fc","type":"mqtt out","z":"f1939796.abade8","g":"bc7b222d14ec9ee9","name":"tele/seneye/temp","topic":"tele/seneye/temp","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"34f7583aa6e3efb2","x":1010,"y":360,"wires":[]},{"id":"7cbba0526b248c01","type":"mqtt out","z":"f1939796.abade8","g":"bc7b222d14ec9ee9","name":"tele/seneye/ph","topic":"tele/seneye/ph","qos":"","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"34f7583aa6e3efb2","x":1000,"y":400,"wires":[]},{"id":"ecf391724ee899ab","type":"mqtt out","z":"f1939796.abade8","g":"bc7b222d14ec9ee9","name":"tele/seneye/nh3","topic":"tele/seneye/nh3","qos":"","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"34f7583aa6e3efb2","x":1000,"y":440,"wires":[]},{"id":"34f7583aa6e3efb2","type":"mqtt-broker","name":"core-mosquitto: 1883 192.168.2.40","broker":"core-mosquitto","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"8398c7612b911d52","type":"group","z":"f1939796.abade8","g":"097aa92b38953411","name":"Sensor Output Node Red Companion","style":{"label":true},"nodes":["bd9204ad849dace5","c9135df4c206d7de","cfca1a0c59f4efb8","32261c4eaf51df0a","13f7473191f64493"],"x":594,"y":239,"w":252,"h":242},{"id":"bd9204ad849dace5","type":"ha-sensor","z":"f1939796.abade8","g":"8398c7612b911d52","name":"Seneye Temperature","entityConfig":"f9f3b6aeb2d49d08","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":720,"y":280,"wires":[[]],"server":"Select_Your_Server"},{"id":"c9135df4c206d7de","type":"ha-sensor","z":"f1939796.abade8","g":"8398c7612b911d52","name":"Seneye pH","entityConfig":"a352104e4fa8fbca","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":690,"y":320,"wires":[[]],"server":"Select_Your_Server"},{"id":"cfca1a0c59f4efb8","type":"ha-sensor","z":"f1939796.abade8","g":"8398c7612b911d52","name":"Seneye NH3","entityConfig":"a17420f2dde5b686","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":690,"y":400,"wires":[[]],"server":"Select_Your_Server"},{"id":"32261c4eaf51df0a","type":"ha-sensor","z":"f1939796.abade8","g":"8398c7612b911d52","name":"Seneye ORP","entityConfig":"e12640e89ea0c86b","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":690,"y":360,"wires":[[]],"server":"Select_Your_Server"},{"id":"13f7473191f64493","type":"ha-sensor","z":"f1939796.abade8","g":"8398c7612b911d52","name":"Seneye NH4","entityConfig":"3c013944355a91a8","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":690,"y":440,"wires":[[]],"server":"Select_Your_Server"},{"id":"f9f3b6aeb2d49d08","type":"ha-entity-config","server":"Select_Your_Server","deviceConfig":"371510540596ad0d","name":"Seneye Temperature","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Seneye Temperature"},{"property":"icon","value":"mdi:thermometer"},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"temperature"},{"property":"unit_of_measurement","value":"°C"},{"property":"state_class","value":"measurement"}],"resend":true,"debugEnabled":false},{"id":"a352104e4fa8fbca","type":"ha-entity-config","server":"Select_Your_Server","deviceConfig":"a37ac1a20a75d8b8","name":"Seneye pH","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Seneye pH"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"potential_hydrogen"},{"property":"unit_of_measurement","value":"pH"},{"property":"state_class","value":"measurement"}],"resend":true,"debugEnabled":false},{"id":"a17420f2dde5b686","type":"ha-entity-config","server":"Select_Your_Server","deviceConfig":"d2821b3dea19909c","name":"Seneye NH3","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Seneye Ammonia"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"ppm"},{"property":"state_class","value":"measurement"}],"resend":true,"debugEnabled":false},{"id":"e12640e89ea0c86b","type":"ha-entity-config","server":"Select_Your_Server","deviceConfig":"9f95cf7c12bccc84","name":"Seneye ORP","version":6,"entityType":"sensor","haConfig":[{"property":"name","value":"Seneye ORP"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"mV"},{"property":"state_class","value":"measurement"}],"resend":true,"debugEnabled":false},{"id":"3c013944355a91a8","type":"ha-entity-config","server":"Select_Your_Server","deviceConfig":"1d19b28a31ebd95a","name":"Seneye NH4","version":6,"entityType":"sensor","haConfig":[{"property":"name","value":"Seneye NH4"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"ppb"},{"property":"state_class","value":"measurement"}],"resend":true,"debugEnabled":false},{"id":"371510540596ad0d","type":"ha-device-config","name":"Seneye Temperature","hwVersion":"","manufacturer":"Node-RED","model":"Seneye","swVersion":"","server":"Select_Your_Server"},{"id":"a37ac1a20a75d8b8","type":"ha-device-config","name":"Seneye pH","hwVersion":"","manufacturer":"Node-RED","model":"Seneye","swVersion":"","server":"Select_Your_Server"},{"id":"d2821b3dea19909c","type":"ha-device-config","name":"Seneye NH3","hwVersion":"","manufacturer":"Node-RED","model":"Seneye","swVersion":"","server":"Select_Your_Server"},{"id":"9f95cf7c12bccc84","type":"ha-device-config","name":"Seneye ORP","hwVersion":"","manufacturer":"Node-RED","model":"Seneye","swVersion":"","server":"Select_Your_Server"},{"id":"1d19b28a31ebd95a","type":"ha-device-config","name":"Seneye NH4","hwVersion":"","manufacturer":"Node-RED","model":"Seneye","swVersion":"","server":"Select_Your_Server"},{"id":"c2248a7503069b40","type":"ha-entity-config","server":"Select_Your_Server","deviceConfig":"9046cab53ca274cb","name":"Seneye Last Reading","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Seneye Last Reading"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"8b4b6e6dde0731e4","type":"ha-entity-config","server":"Select_Your_Server","deviceConfig":"33b17011dd640a15","name":"Seneye Slide Expiry","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Seneye Slide Expiry"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"9046cab53ca274cb","type":"ha-device-config","name":"Seneye Last Reading","hwVersion":"","manufacturer":"Node-RED","model":"Seneye","swVersion":"","server":"Select_Your_Server"},{"id":"33b17011dd640a15","type":"ha-device-config","name":"Seneye Slide Expiry","hwVersion":"","manufacturer":"Node-RED","model":"Seneye Slide Expiry","swVersion":"","server":"Select_Your_Server"}]