-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get the current power of the solar production (or current consumption) ? #28
Comments
Is the command to get the Solar Production documented in the Smappee API or elsewhere? |
Hi, the Smappy package has two kinds of clients: The first is The A third approach could be to check out the new MQTT functionality, see #27 |
@JrtPec Thank you. I did not find any info about the LocalSmappy client you are talking about. Do you mean another python wrapper for the Smappee API connecting directly to my Smappee device via my LAN ? (I do not need to access it from outside). Is it available here on GitHub ? Edit: Ooops ! I just understand you were talking about your separate client class LocalSmappee in your smappy.py package ! |
You got it! We don't have anything for the MQTT yet, its existence was only brought to my attention 2 days ago. |
Sorry, I'm new to python. Could you give me a sample code how to use the LocalSmappee client, to logon and get all the instantanate data from my Smappee device ? |
I have updated the Readme, so now it has some documentation about LocalSmappee. Here's a sample you could try: import smappy
client = smappy.LocalSmappee(ip='192.168.0.50') # fill in the IP of your Smappee
client.logon(password='admin') # enter your password, default is 'admin'
report = client.report_instantaneous_values()
print(report)
instantaneous = client.load_instantaneous()
print(instantaneous) disclaimer: I do not have a Smappee in my own local network, so I haven't tested this part of the code. |
Thank you. Actually I finally had found by myself : Here is my code to measure the current solar power. It works fine: import smappy
ls = smappy.LocalSmappee(ip='192.168.1.120')
ls.logon(password='admin')
smappeeData = ls.load_instantaneous()
solarPowerInWatts = 0.0
for itemDict in smappeeData:
key = itemDict.get('key')
if key in ['phase3ActivePower','phase4ActivePower','phase5ActivePower']:
value = itemDict.get('value')
phasePowerInWatts = float(value) / 1000
solarPowerInWatts += phasePowerInWatts
print(solarPowerInWatts) |
I'm a bit confused with the interface of the Smappy Python Wrapper. I do not need the energy produced (or consumed) between two past time stamps but I need to monitor the current solar production power (or the current electrical consumption power) like displayed on the main screen of the Smappee Smartphone App.
How to simply get theses values with the Smappy Python Wrapper ?
The text was updated successfully, but these errors were encountered: