Skip to content
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

Additional documentation #31

Open
maxant opened this issue Aug 18, 2024 · 0 comments
Open

Additional documentation #31

maxant opened this issue Aug 18, 2024 · 0 comments

Comments

@maxant
Copy link

maxant commented Aug 18, 2024

Hi, many thanks for this awesome library. I made some notes while reverse engineering your python, so that I could call the API with Node-RED / Javascript. I tested it using curl. Would it be useful for others, to post this in the README or nearby? Especially the part about multiplying the values by 4.

Go into basement, push button on the inverter which is next to USB port for about 5 seconds until 
the "wifi" LED on the front turns blue.
use laptop to connect to the inverters wifi - the password is written on the side of the inverter.
run this to find the password:

    conda create -n env3819 python=3.8.19
    conda activate env3819
    pip install pyess
    esscli --action get_password

        INFO:pyess.cli:password: XXXXXX


push and hold the button again for five seconds until the wifi led goes back to being green. then connect the laptop back to the normal wifi and do this to get data:


    esscli --action get_data --password XXXXXX | jq


use the router to find the name of ess box, it is:

    AB1234BBBB56789C 192.168.1.400

    export MYPWD="XXXXXX"

    export AUTHKEY=$(curl -vvv -k -s -XPUT \
                    'https://AB1234BBBB56789C/v1/user/setting/login' \
                    -H 'Content-Type: application/json' \
                    -d '{"password": "'"$MYPWD"'"}' \
                | jq -r '.auth_key')

e.g. get network settings:

    curl -vvv -k -s -XPUT \
                    'https://AB1234BBBB56789C/v1/user/setting/network' \
                    -H 'Content-Type: application/json' \
                    -d '{"auth_key": "'"$AUTHKEY"'"}' \
                | jq

if any call returns this, then the user needs to log in again:

        {
            "auth": "session_timed_out"
        }


provide total per quarter hour, and **so need multiplying by 4** in order to match how they are displayed in the graph:

    curl -vvv -k -XPOST 'https://AB1234BBBB56789C/v1/user/graph/load/day' \
         -H 'Content-Type: application/json' \
         -d '{"year_month_day": "'"$(date +%Y%m%d%H%M%S)"'", "auth_key": "'"$AUTHKEY"'"}'

    curl -vvv -k -XPOST 'https://AB1234BBBB56789C/v1/user/graph/pv/day' \
         -H 'Content-Type: application/json' \
         -d '{"year_month_day": "'"$(date +%Y%m%d%H%M%S)"'", "auth_key": "'"$AUTHKEY"'"}'

    curl -vvv -k -XPOST 'https://AB1234BBBB56789C/v1/user/graph/batt/day' \
         -H 'Content-Type: application/json' \
         -d '{"year_month_day": "'"$(date +%Y%m%d%H%M%S)"'", "auth_key": "'"$AUTHKEY"'"}'


provides instantaneous values:

    curl -vvv -k -XPOST 'https://AB1234BBBB56789C/v1/user/essinfo/home' \
         -H 'Content-Type: application/json' \
         -d '{"auth_key": "'"$AUTHKEY"'"}'

    curl -vvv -k -XPOST 'https://AB1234BBBB56789C/v1/user/essinfo/common' \
         -H 'Content-Type: application/json' \
         -d '{"auth_key": "'"$AUTHKEY"'"}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant