Giter Site home page Giter Site logo

supoxy's Introduction

supoxy

Proxy Server for Sunny Portal

Reads the JSON Values from SMA Sunny Portal and presents them formatted or Raw. It can be used in conjunction with FHEM to display your own statistic about your photovoltaic.

INSTALL

  1. Place the Files from "Distribution" Directory in an accessible path (eg /opt/fhem/suproxy)
  2. Edit sunny.conf and add your credentials
  3. Edit the file "supoxy_init_config" from the Distribution directory
  4. use "supoxy-init.sh" from the same path to start and stop. This is an init.d-style script which can also be used in /etc/init.d/

TESTING

Above 3. & 4. are not needed for testing

  1. cd to the folder
  2. start the server with java -Djava.library.path=./SuPoxy_lib -jar SuPoxy.jar sunny.conf &

RUNNING

supoxy listens as a small webserver to port 8000 (changeable in sunny.conf)

http://localhost:8000/actual returns actual values delivered by portal

http://localhost:8000/history returns last N values line by line, where N is defined in sunny.conf. Order is "oldest first"

http://localhost:8000/raw returns raw JSON output from portal

FHEM Example

define Sunny HTTPMOD http://localhost:8000/actual 10

attr Sunny readingsName1 PV
attr Sunny readingsName2 FI
attr Sunny readingsName3 GC
attr Sunny readingsName4 DC
attr Sunny readingsName5 SC
attr Sunny readingsName6 SS
attr Sunny readingsName7 TC
attr Sunny readingsName8 DCQ
attr Sunny readingsName9 SCQ
attr Sunny readingsName10 AC
attr Sunny readingsName11 BI
attr Sunny readingsName12 BO
attr Sunny readingsName13 BCS
attr Sunny readingsName14 BSH

attr Sunny readingsRegex1 PV:([\d\.]+)
attr Sunny readingsRegex2 FI:([\d\.]+)
attr Sunny readingsRegex3 GC:([\d\.]+)
attr Sunny readingsRegex4 DC:([\d\.]+)
attr Sunny readingsRegex5 SC:([\d\.]+)
attr Sunny readingsRegex6 SS:([\d\.]+)
attr Sunny readingsRegex7 TC:([\d\.]+)
attr Sunny readingsRegex8 DCQ:([\d\.]+)
attr Sunny readingsRegex9 SCQ:([\d\.]+)
attr Sunny readingsRegex10 AC:([\d\.]+)
attr Sunny readingsRegex11 BI:([\d\.]+)
attr Sunny readingsRegex12 GC:([\d\.]+)
attr Sunny readingsRegex13 BCS:([\d\.]+)
attr Sunny readingsRegex14 BSH:([\d\.]+)

supoxy's People

Contributors

thetagamma avatar

Stargazers

 avatar  avatar Nico Maas avatar Karsten avatar Simon Hitzenberger avatar

Watchers

James Cloos avatar  avatar decembersoul avatar  avatar  avatar

Forkers

shippie superwutz

supoxy's Issues

Useragent deprecated

Dear contributors,
the existing useragent in "SuPoxyServer.java" seems to be obsolete.

This one was used successfully instead:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36

Exception in thread "PortalConnector"

When starting supoxy I get the following error:

$ java -Djava.library.path=./SuPoxy_lib -jar SuPoxy.jar sunny.conf &
[1] 1750
$ 01/27/2017 17:20:26 Use default value for timecorrection (0)
01/27/2017 17:20:27 API Thread started
01/27/2017 17:20:27 SuPoxy is running at 8000
01/27/2017 17:20:28 SuPoxy try to log in
01/27/2017 17:20:30 login done
01/27/2017 17:20:30 SuPoxy login done
Exception in thread "PortalConnector" java.lang.NumberFormatException: For input string: "pe":"DateTime"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.parseLong(Long.java:631)
at de.waldmensch.SuPoxyDataObject.(SuPoxyDataObject.java:21)
at de.waldmensch.SuPoxyConnect.getLiveData(SuPoxyConnect.java:144)
at de.waldmensch.SuPoxyConnect.WebConnect(SuPoxyConnect.java:119)
at de.waldmensch.SuPoxyConnect.run(SuPoxyConnect.java:76)

I am running Ubuntu 16.04 and OpenJDK 8.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.