Page 1 of 1

SAJ solar power

Posted: Thursday 29 March 2018 10:45
by nood
I made a phyton script so I can monitor my solar power production in Domoticz. I couldn't use the script from the forum viewtopic.php?t=10356 I think I have another wifi adapter.
If you want to test if this script will work before you install it, copy this link in your browser : http://*your local SAJ URL*/status/status.php
If you get a webpage with a list of numbers, you are good to go.

For this script you need to have the python requests library installed.
Make a dummy energy device and remember the IDX. Give your SAJ solarinverter a static IP in your router. replace the *** in the script with your values.

Code: Select all

import requests
from requests.auth import HTTPBasicAuth

DOMOTICZ = 'http://***' #input your domoticz IP here
IDX ='***' #input your energy idx here
SAJ = 'http://***' #input your local SAJ IP here

SAJURL = SAJ + '/status/status.php'
file = requests.get(SAJURL, auth=HTTPBasicAuth('***', '***')) #input your login here between the ' '
print(file.status_code)
text = file.text
list = text.split(',')

POWER = list[23]
ENERGY = int(list[1])
ENERGYCALC = str(ENERGY * 10)

requests.get(DOMOTICZ+'/json.htm?type=command&param=udevice&idx='+IDX+'&nvalue=0&svalue='+POWER+';'+ENERGYCALC)
Save this script to your domoticz python folder and make a crontab to run this script. I run it every minute to get realtime power readings. If you only want daily power production you could go with less.

Re: SAJ solar power

Posted: Thursday 11 October 2018 14:15
by thorian
Depending on what you actually got - the SAJ Suntrio has all the needed data here: http://IP_OF_SAJ_SUNTRIO/real_time_data.xml