Victron VRM API

Home Assistant, Arduino, SDS, Raspberry, Linux, vzdálený dohled, automatizace, měření, opensource, closedsource, hotová řešení, DIY, stavebnice, komponenty, software, postupy, návody, schémata, rady, zkušenosti ...
Uživatelský avatar
rottenkiwi
Příspěvky: 5451
Registrován: pát úno 13, 2015 2:24 pm
Lokalita: SO, SK
Bydliště: SO, SK

Victron VRM API

Příspěvek od rottenkiwi »

Pouzivate niekto toto VRM API ?

https://vrm-api-docs.victronenergy.com/#/

Nejako mi nejde sa tam lognut ani s "bearer" ani s "token" tokenom.
DC-AC inverter REC Lion DC-AC ESP32 DIY inv. 15 GB za sekundu DIY MPPT Holder
Zjedz vsetko, co si kupil, v obchode a netreba ti tasku, auto ci chladnicku.
Uživatelský avatar
rottenkiwi
Příspěvky: 5451
Registrován: pát úno 13, 2015 2:24 pm
Lokalita: SO, SK
Bydliště: SO, SK

Re: Victron VRM API

Příspěvek od rottenkiwi »

Tak uz som to pochopil:

Najprv musite pomocou emailu a passwordu poslat:

Kód: Vybrat vše

curl --request POST \
  --url https://vrmapi.victronenergy.com/v2/auth/login \
  --header 'Content-Type: application/json' \
  --data '{
  "username": "john@example.com",
  "password": "somepassword",
  "remember_me": "true"
}'
Ziskate long-lived-token a mozete si ho pozriet na:
https://jwt.io/

Pomocou bearer tokenu vygenerujete token:

Kód: Vybrat vše

curl --request POST \
  --url https://vrmapi.victronenergy.com/v2/users/<vas_user_id>/accesstokens/create \
  --header 'Content-Type: application/json' \
  --header 'x-authorization: Bearer <vas bearer token>' \
  --data '{
  "name": "MyNewToken"
}'

A pre vas user_id si vypisete vsetky vase installations:

Kód: Vybrat vše

curl --request GET \
  --url https://vrmapi.victronenergy.com/v2/installations/<install_id>/system-overview \
  --header 'Content-Type: application/json' \
  --header 'x-authorization: Bearer <vas_bearer_token>'

A pre kazdu installation ziskate instalovane devices:

Kód: Vybrat vše

curl --request GET \
  --url https://vrmapi.victronenergy.com/v2/installations/<install_id>/system-overview \
  --header 'Content-Type: application/json' \
  --header 'x-authorization: Bearer <vas bearer token>' 
200 OK

Kód: Vybrat vše

{
  "success": true,
  "records": {
    "devices": [
      {
        "name": "Gateway",
        "customName": null,
        "productCode": "",
        "idSite": xxxxx,
        "productName": "Generic Venus Device (rpi or other)",
        "firmwareVersion": "vx.xx",
        "remoteOnLan": "192.xx.xx.yy",
        "autoUpdate": "On",
        "updateTo": "Official release",
        "lastConnection": 1672501009,
        "class": "device-gateway device-icon-generic-venus-device--rpi-or-other-",
        "loggingInterval": 60,
        "identifier": "xxxxxxxxxx",
        "lastPowerUpOrRestart": 1618280821,
        "vncSshAuth": true,
        "vncStatus": "Enabled",
        "vncPort": 0,
        "twoWayCommunication": true,
        "remoteSupportEnabled": false,
        "remoteSupportPort": xxxxx,
        "remoteSupportIp": "xx.xx.xx.xx",
        "remoteSupport": "disabled",
        "machineSerialNumber": null,
        "settings": []
      },
      {
        "name": "VE.Bus System",
        "customName": null,
        "productCode": "",
        "idSite": xxxxx,
        "productName": "MultiPlus-II 48/3000/35-32 (50A ext sensor)",
        "firmwareVersion": "xxx",
        "lastConnection": 1672501009,
        "class": "device-ve-bus device-icon-multiplus-ii-48-3000-35-32--50a-ext-sensor-",
        "productId": "xxxx",
        "vmc": "VE.Bus",
        "vid": {
          "enumValue": "Single unit",
          "devicesPerPhase": {
            "L1": 1,
            "L2": 0,
            "L3": 0
          }
        },
        "instance": xxx,
        "idDeviceType": 1,
        "settings": []
      },
      {
        "name": "Solar Charger",
        "customName": "",
        "productCode": "",
        "idSite": yyyyy,
        "productName": "BlueSolar Charger MPPT 150/60",
        "firmwareVersion": "vx.xx",
        "lastConnection": 1672501009,
        "class": "device-solar-charger device-icon-bluesolar-charger-mppt-150-60",
        "machineSerialNumber": "H56456456456456",
        "instance": xxx,
        "idDeviceType": 4,
        "settings": []
      }
    ],
    "unconfigured_devices": []
  }
}
Naposledy upravil(a) rottenkiwi dne sob pro 31, 2022 4:50 pm, celkem upraveno 1 x.
DC-AC inverter REC Lion DC-AC ESP32 DIY inv. 15 GB za sekundu DIY MPPT Holder
Zjedz vsetko, co si kupil, v obchode a netreba ti tasku, auto ci chladnicku.
Uživatelský avatar
rottenkiwi
Příspěvky: 5451
Registrován: pát úno 13, 2015 2:24 pm
Lokalita: SO, SK
Bydliště: SO, SK

Re: Victron VRM API

Příspěvek od rottenkiwi »

A este diagnostika:

Kód: Vybrat vše

curl --request GET \
  --url 'https://vrmapi.victronenergy.com/v2/installations/<vase_is>/diagnostics?count=10&page=10' \
  --header 'Content-Type: application/json' \
  --header 'x-authorization: Bearer '

Kód: Vybrat vše

{
  "success": true,
  "records": [
    {
      "idSite": xxxxx,
      "timestamp": 1672501489,
      "Device": "VE.Bus System",
      "instance": 289,
      "idDataAttribute": 325,
      "description": "Inverter To AcOut",
      "formatWithUnit": "%.2F kWh",
      "dbusServiceType": "vebus",
      "dbusPath": "/Energy/InverterToAcOut",
      "code": "t9",
      "bitmask": 0,
      "formattedValue": "6.37 kWh",
      "rawValue": "6.37",
      "id": 1
    },
    {
      "idSite": xxxxxx,
      "timestamp": 1672501489,
      "Device": "VE.Bus System",
      "instance": 289,
      "idDataAttribute": 326,
      "description": "AcOut to Inverter",
      "formatWithUnit": "%.2F kWh",
      "dbusServiceType": "vebus",
      "dbusPath": "/Energy/OutToInverter",
      "code": "t10",
      "bitmask": 0,
      "formattedValue": "0.04 kWh",
      "rawValue": "0.04",
      "id": 2
    },
    {
      "idSite": xxxxx,
      "timestamp": 1672135580,
      "Device": "VE.Bus System",
      "instance": 289,
      "idDataAttribute": 357,
      "description": "Device 0 assistant list",
      "formatWithUnit": "%s",
      "dbusServiceType": null,
      "dbusPath": null,
      "code": "asT0",
      "bitmask": 0,
      "formattedValue": "",
      "rawValue": "",
      "id": 3
    },
    {
      "idSite": xxxxxx,
      "timestamp": 1672501489,
      "Device": "VE.Bus System",
      "instance": 289,
      "idDataAttribute": 523,
      "description": "High DC Ripple",
      "formatWithUnit": "%s",
      "dbusServiceType": "vebus",
      "dbusPath": "/Alarms/Ripple",
      "code": "eR",
      "bitmask": 0,
      "formattedValue": "Ok",
      "rawValue": 0,
      "dataAttributeEnumValues": [
        {
          "nameEnum": "Ok",
          "valueEnum": 0
        },
        {
          "nameEnum": "Warning",
          "valueEnum": 1
        },
        {
          "nameEnum": "Alarm",
          "valueEnum": 2
        }
      ],
      "id": 4
    },
    {
      "idSite": xxxxxx,
      "timestamp": 1672501489,
      "Device": "VE.Bus System",
      "instance": 289,
      "idDataAttribute": 344,
      "description": "Temperature L1",
      "formatWithUnit": "%s",
      "dbusServiceType": null,
      "dbusPath": null,
      "code": "eT1",
      "bitmask": 0,
      "formattedValue": "Ok",
      "rawValue": 0,
      "dataAttributeEnumValues": [
        {
          "nameEnum": "Ok",
          "valueEnum": 0
        },
        {
          "nameEnum": "Warning",
          "valueEnum": 1
        },
        {
          "nameEnum": "Alarm",
          "valueEnum": 2
        }
      ],
      "id": 5
    },
    {
      "idSite": xxxxx,
      "timestamp": 1672501489,
      "Device": "VE.Bus System",
      "instance": 289,
      "idDataAttribute": 345,
      "description": "Low battery L1",
      "formatWithUnit": "%s",
      "dbusServiceType": null,
      "dbusPath": null,
      "code": "eL1",
      "bitmask": 0,
      "formattedValue": "Ok",
      "rawValue": 0,
      "dataAttributeEnumValues": [
        {
          "nameEnum": "Ok",
          "valueEnum": 0
        },
        {
          "nameEnum": "Warning",
          "valueEnum": 1
        },
        {
          "nameEnum": "Alarm",
          "valueEnum": 2
        }
      ],
      "id": 6
    },
    {
      "idSite": xxxxxx,
      "timestamp": 1672501489,
      "Device": "VE.Bus System",
      "instance": 289,
      "idDataAttribute": 346,
      "description": "Overload L1",
      "formatWithUnit": "%s",
      "dbusServiceType": null,
      "dbusPath": null,
      "code": "eO1",
      "bitmask": 0,
      "formattedValue": "Ok",
      "rawValue": 0,
      "dataAttributeEnumValues": [
        {
          "nameEnum": "Ok",
          "valueEnum": 0
        },
        {
          "nameEnum": "Warning",
          "valueEnum": 1
        },
        {
          "nameEnum": "Alarm",
          "valueEnum": 2
        }
      ],
      "id": 7
    },
    {
      "idSite": xxxxxx,
      "timestamp": 1672501489,
      "Device": "VE.Bus System",
      "instance": 289,
      "idDataAttribute": 347,
      "description": "High DC Ripple L1",
      "formatWithUnit": "%s",
      "dbusServiceType": null,
      "dbusPath": null,
      "code": "eR1",
      "bitmask": 0,
      "formattedValue": "Ok",
      "rawValue": 0,
      "dataAttributeEnumValues": [
        {
          "nameEnum": "Ok",
          "valueEnum": 0
        },
        {
          "nameEnum": "Warning",
          "valueEnum": 1
        },
        {
          "nameEnum": "Alarm",
          "valueEnum": 2
        }
      ],
      "id": 8
    },
    {
      "idSite": xxxxxx,
      "timestamp": 1672501489,
      "Device": "VE.Bus System",
      "instance": 289,
      "idDataAttribute": 348,
      "description": "Temperature L2",
      "formatWithUnit": "%s",
      "dbusServiceType": null,
      "dbusPath": null,
      "code": "eT2",
      "bitmask": 0,
      "formattedValue": "Ok",
      "rawValue": 0,
      "dataAttributeEnumValues": [
        {
          "nameEnum": "Ok",
          "valueEnum": 0
        },
        {
          "nameEnum": "Warning",
          "valueEnum": 1
        },
        {
          "nameEnum": "Alarm",
          "valueEnum": 2
        }
      ],
      "id": 9
    },
    {
      "idSite": xxxxxx,
      "timestamp": 1672501489,
      "Device": "VE.Bus System",
      "instance": 289,
      "idDataAttribute": 349,
      "description": "Low battery L2",
      "formatWithUnit": "%s",
      "dbusServiceType": null,
      "dbusPath": null,
      "code": "eL2",
      "bitmask": 0,
      "formattedValue": "Ok",
      "rawValue": 0,
      "dataAttributeEnumValues": [
        {
          "nameEnum": "Ok",
          "valueEnum": 0
        },
        {
          "nameEnum": "Warning",
          "valueEnum": 1
        },
        {
          "nameEnum": "Alarm",
          "valueEnum": 2
        }
      ],
      "id": 10
    }
  ],
  "num_records": 163
}
DC-AC inverter REC Lion DC-AC ESP32 DIY inv. 15 GB za sekundu DIY MPPT Holder
Zjedz vsetko, co si kupil, v obchode a netreba ti tasku, auto ci chladnicku.

  • Podobná témata
    Odpovědi
    Zobrazení
    Poslední příspěvek