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

Export charging status to other program #19

Open
blooby78 opened this issue Feb 7, 2020 · 2 comments
Open

Export charging status to other program #19

blooby78 opened this issue Feb 7, 2020 · 2 comments

Comments

@blooby78
Copy link

blooby78 commented Feb 7, 2020

Hello,

Thanks for your project it work's perfect.
I would like to know how simpli get the status off power delivery (not charging/ incharge with x amp / error ...)
You use IPC but the anwswer is direcly provide to php who is interpreted.
I would like to use bash or python program to get this status.
Do you have a suggestion ?
Thanks
Jerome

@juamiso
Copy link

juamiso commented Apr 23, 2020

I am using curl and python request lib to communicate with other systems (iobroker = home automation, and influxdb for nice graphs)

Maybe you can get some inspirations from this lines:

    # displaying download stats. -m 60 prevents the whole
    # operation from taking over 60 seconds.
    #greenEnergyData = run_process('curl -s -m 60 "http://192.168.13.58/history/export.csv?T=1&D=0&M=1&C$
    Photovoltaic = 0
    Smartmeter=0
    HouseBatt= 0
    url_string = 'http://<your_server>/write?db=<your_influx_db>'
    data_string = 'TWCMagager.CurrentChargingPower,from=TWCManager value=' + str(total_amps_actual_all_twcs()*225)
    myToken = '<your_influxdb_auth_token>' 
    header_string = {'Authorization': 'Bearer {}'.format(myToken)}
    ip='192.168.0.71' #This is the local ip from your inverter being connected via TCP Modbus
    client = ModbusClient(ip,port=502)
    client.connect()
    try:
      Photovoltaic = int(BinaryPayloadDecoder.fromRegisters(client.read_holding_registers(40092-1,2,unit$
      SmartMeter = int(BinaryPayloadDecoder.fromRegisters(client.read_holding_registers(40098-1,2,unit=2$
      HouseBatt = run_process('curl -s -m 5 "http://<local_iobroker_server_ip>/getPlainValue/vis.0.Batt_Discharge$
      req.post(url_string, data=data_string, headers=header_string)

@ngardiner
Copy link

You could take a look at my fork of this, which has modules to talk to multiple external interfaces including HomeAssistant and MQTT

https://github.com/ngardiner/TWCManager

deece pushed a commit to InfernoEmbedded/TWCManager that referenced this issue Jan 12, 2022
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

3 participants