Page 1 of 1

Seneye Fish Tank Monitor

Posted: Thursday 13 March 2014 8:57
by RobDob
Hi,

I have some Seneye Fish Tank Monitors in my house and wanted to get the information they collected into Domoticz.

Seneye provides access to the information it captures via its API website - api.seneye.com

I created some dummy sensors and then a script that read the information from the site and uploaded to the dummy sensors, you need to change the parts like this <YOUR_STUFF> to match your own credentials and devices:

Code: Select all

#!/usr/bin/python

#import library to do http requests:
import urllib2

#define variables
seneyeurl = 'https://api.seneye.com/v1/devices/17128/exps?user=<YOUR_SENEYE_EMAIL>&pwd=<YOUR_SENEYE_PASSWORD>'
domourl1 = 'http://<YOUR_DOMO_IP>:<YOUR_DOMO_PORT>/json.htm?type=command&param=udevice&idx='
domourl2 = '&nvalue=0&svalue='
tempid = '<YOUR_DUMMY_SENSOR_ID>'
phid = '<YOUR_DUMMY_SENSOR_ID>'
nh3id = '<YOUR_DUMMY_SENSOR_ID>'
lightid = '<YOUR_DUMMY_SENSOR_ID>'

#download the data:
file = urllib2.urlopen(seneyeurl)

#convert to string:
data = file.read()
#close file because we dont need it anymore:
file.close()

#split the raw data into an array split on comma
text = data.split(',')

#select the values needed and set as variables
temperature = text[4]
ph = text[10]
nh3 = text[16]
light = text[20]

#temperature - strip off extra characters not needed
temperature = temperature.replace('"','')
temperature = temperature.replace('curr:','')
print temperature

#create URL and send to Domoticz
tempurl = domourl1 + tempid + domourl2 + temperature
urllib2.urlopen(tempurl)

#ph - strip off extra characters not needed
ph = ph.replace('"','')
ph = ph.replace('curr:','')
print ph

#create URL and send to Domoticz
phurl = domourl1 + phid + domourl2 + ph
urllib2.urlopen(phurl)

#nh3 - strip off extra characters not needed
nh3 = nh3.replace('"','')
nh3 = nh3.replace('curr:','')
print nh3

#create URL and send to Domoticz
nh3url = domourl1 + nh3id + domourl2 + nh3
urllib2.urlopen(nh3url)

#light - strip off extra characters not needed
light = light.replace('"','')
light = light.replace('curr:','')
print light

#create URL and send to Domoticz
lighturl = domourl1 + lightid + domourl2 + light
urllib2.urlopen(lighturl)
I run the script as a cron job on my Raspberry Pi checking the values every 15 minutes.

To make this better ideally I would like to be able to add some other types of sensor, e.g. ph & nh3. Right now I am just using dummy temperature sensors. If anyone knows how to do this I would appreciate it.

Anyway I hope someone else finds it useful.

Cheers.

Re: Seneye Fish Tank Monitor

Posted: Friday 11 April 2014 6:11
by Derik
Plesae some sreendump What you have

Re: Seneye Fish Tank Monitor

Posted: Friday 11 April 2014 6:33
by RobDob
I'm not sure what you are asking? Screenshots of which parts?

Re: Seneye Fish Tank Monitor

Posted: Friday 11 April 2014 6:41
by Derik
All

Re: Seneye Fish Tank Monitor

Posted: Friday 11 April 2014 8:26
by RobDob
Here is a picture of my virtual sensors that are updated by the script

Re: Seneye Fish Tank Monitor

Posted: Friday 11 April 2014 19:57
by Derik
looking great..

Only what hardware do you use??

Re: Seneye Fish Tank Monitor

Posted: Friday 11 April 2014 20:49
by RobDob
I use these:

http://www.seneye.com/devices/seneye-home

I have made some progress today making appropriate sensor types, right now I add them all as temperature and its not great, I have been modifying the code and have this so far, needs a little tidying and also adding to the UI:

Re: Seneye Fish Tank Monitor

Posted: Friday 11 April 2014 21:03
by Derik
Great work ..!!!!

Seemed like a good idea for my pool.
Only it would be nice if there'd be chlorine.
And preferably via WiFi

Re: Seneye Fish Tank Monitor

Posted: Saturday 12 April 2014 5:14
by RobDob
Looks like it may be a solution for you in the future:

http://www.seneye.com/coming-soon

The web server thing is designed to send the information to their servers without needing it to be plugged into a computer - this is nearing completion I believe and they have closed the beta program.

The new parameters (including Chlorine) have been promised for some time and they wont tell me when I can expect them.....

All in all they are a pretty cheap solution and suit me well - I have nothing to do with the company.

Re: Seneye Fish Tank Monitor

Posted: Thursday 03 December 2015 14:07
by nikels
Hello i have a question! What am i doing wrong.
This is my first question on this forum.

I have a Seneye pond dive and trying out the code provided by RobDob

When i type the url from the api i get this result:
0-18.4-18.80-17.3507.330-10.00100.0010-111.7011.61100

I have modify the code and saved it as a *.sh file and execute it as a task by Task Manager from my Synology Nas that olso runs Domoticz..

But nothing happens no device information is updated.

Code: Select all

#!/usr/bin/python

#import library to do http requests:
import urllib2

#define variables
seneyeurl = 'https://api.seneye.com/v1/devices/5697/exps?user=XXXXX&pwd=XXXX'
domourl1 = 'http://192.16x.xx.xx:8xxx/json.htm?type=command&param=udevice&idx='
domourl2 = '&nvalue=0&svalue='
tempid = '140CC'
phid = '140D1'
nh3id = '140D0'
lightid = '140CF'

#download the data:
file = urllib2.urlopen(seneyeurl)

#convert to string:
data = file.read()
#close file because we dont need it anymore:
file.close()

#split the raw data into an array split on comma
text = data.split(',')

#select the values needed and set as variables
temperature = text[10]
ph = text[11]
nh3 = text[12]
light = text[13]

#temperature - strip off extra characters not needed
temperature = temperature.replace('"','')
temperature = temperature.replace('curr:','')
print temperature

#create URL and send to Domoticz
tempurl = domourl1 + tempid + domourl2 + temperature
urllib2.urlopen(tempurl)

#ph - strip off extra characters not needed
ph = ph.replace('"','')
ph = ph.replace('curr:','')
print ph

#create URL and send to Domoticz
phurl = domourl1 + phid + domourl2 + ph
urllib2.urlopen(phurl)

#nh3 - strip off extra characters not needed
nh3 = nh3.replace('"','')
nh3 = nh3.replace('curr:','')
print nh3

#create URL and send to Domoticz
nh3url = domourl1 + nh3id + domourl2 + nh3
urllib2.urlopen(nh3url)

#light - strip off extra characters not needed
light = light.replace('"','')
light = light.replace('curr:','')
print light

#create URL and send to Domoticz
lighturl = domourl1 + lightid + domourl2 + light
urllib2.urlopen(lighturl)