Giter Site home page Giter Site logo

sebilm / iobroker.myuplink Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 502 KB

ioBroker Adapter for myUplink.com for Nibe Heat Pumps

License: MIT License

JavaScript 1.83% TypeScript 98.17%
iobroker home-automation myuplink smart-home ait contura cta ctc heat-pump nibe

iobroker.myuplink's Introduction

ioBroker.myuplink

NPM version Current version in stable repository Downloads Number of Installations Build Status

NPM

myuplink.com adapter for ioBroker

This ioBroker adapter receives data from myUplink.com.

Using this adapter

German version below - Eine deutsche Version dieser Anleitung gibt's weiter unten.

  1. You need a myUplink compatible heat pump from NIBE, AIT, Cetetherm, ClimateMaster, Contura, CTA, CTC, Enertech Global or Høiax - buy one if you don't have ;-)
  2. You need an account at myUplink: https://myuplink.com
  3. Go to myUplink Api: https://dev.myuplink.com and log in
  4. Click "Applications" and then "Create New Application"
  5. Fill in: Name and Description can be everything e.g. ioBroker
  6. The Callback URL is important for Authorization Code Grant Flow. You can use https://sebilm.github.io/ioBroker.myuplink/myuplink.html
  7. Accept the myUplink API Services Agreement and click "Create"
  8. Then you get an Identifier and a Secret - we need them
  9. Install this adapter in ioBroker
  10. At adapter setting page fill in the Identifier and the Secret.
  11. Choose your language and all other settings.
  12. Click Save and Close

Each device has an object in the object tree called setData. You can enter a JSON object of the form

{
    "12345": "42",
    "23456": "1"
}

in this object. This makes it possible to send and change several data points to the API at the same time. It can also be used to change data points that are not sent by the API.

How the adapter works

The adapter retrieves the list of systems and devices from the myUplink API every x minutes (depending on the setting). It then retrieves the available parameters for each device and saves them in the object tree. If myUplink sends new parameters in the process, these are automatically added to the object tree.

The adapter generally does not delete any objects so that data is not lost if myUplink does not send a parameter.

The adapter also has no influence on which parameters are sent by myUplink.

Verwendung dieses Adapters

  1. Es wird eine myUplink-kompatible Wärmepumpe von NIBE, AIT, Cetetherm, ClimateMaster, Contura, CTA, CTC, Enertech Global or Høiax benötigt.
  2. Es wird ein Account bei myUplink benötigt: https://myuplink.com
  3. Auf der myUplink-API-Webseite einloggen: https://dev.myuplink.com
  4. "Applications" und dann "Create New Application" anklicken
  5. Name und Description können beliebig ausgefüllt werden, z.B. "ioBroker"
  6. Die Callback URL ist für den Authorization Code Grant Flow wichtig. Es kann https://sebilm.github.io/ioBroker.myuplink/myuplink.html eingetragen werden.
  7. Die myUplink API Services Agreements müssen akzeptiert und es muss auf "Create" geklickt werden.
  8. Es wird ein Identifier und ein Secret angezeigt - diese werden benötigt.
  9. Nun diesen Adapter in ioBroker installieren.
  10. Auf der Einstellungsseite des Adapters den Identifier und das Secret eingeben.
  11. Die Sprache und alle anderen Einstellungen auswählen und einstellen.
  12. Speichern und Schliessen klicken.

Jedes Gerät verfügt über ein Objekt im Objektbaum namens "setData". Dort kann ein JSON-Objekt der Form

{
    "12345": "42",
    "23456": "1"
}

in das Objekt eingetragen werden. Dies ermöglicht es, mehrere Datenpunkte gleichzeitig an die API zu senden und zu ändern. Es kann auch verwendet werden, um Datenpunkte zu ändern, die nicht von der API gesendet werden.

Arbeitsweise des Adapters

Der Adapter holt von der myuplink-API aller x Minuten (je nach Einstellung) die Liste der Systeme und Geräte. Anschließend holt er für jedes Gerät die vorhandenen Parameter und speichert sie im Objektbaum. Wenn myUplink dabei neue Parameter sendet, dann werden diese automatisch dem Objektbaum hinzugefügt.

Der Adapter löscht generell keine Objekt, damit es nicht zu Datenverlust kommt, falls myUplink mal einen Parameter nicht mit sendet.

Der Adapter hat auch keinen Einfluss darauf, welche Parameter von myUplink gesendet werden.

Changelog

WORK IN PROGRESS

  • Do not send empty objects (setData)
  • The initial refresh interval was set to 5 minutes
  • The code has been restructured internally
  • At least Node.js 18 is required!
  • Dependencies have been updated

0.7.1 (2024-02-10)

  • Crash after 'unhandled promise rejection' fixed #15

0.7.0 (2024-02-04)

  • Forbidden characters are removed from the category
  • An error when setting data has been fixed
  • Performance has been improved

0.6.1 (2024-02-03)

  • Performance has been improved
  • Dependencies have been updated

0.6.0 (2024-01-28)

  • The setData object has been added

0.5.0 (2024-01-14)

  • Parameter IDs and categories have been added for a few heat pumps

0.4.1 (2024-01-13)

  • In object IDs, all characters that are not officially supported are now replaced by an underscore
  • The roles of the data objects have been improved
  • The logging of token data (in log level silly) has been removed
  • Dependencies have been updated

0.4.0 (2023-12-31)

  • New options for renaming IDs have been added #5
  • Options are deactivated if checkboxes are not checked

0.3.0 (2023-12-29)

  • Support for setting parameter values has been added (must be paid for at myuplink.com) #4
  • Authorization Code Grant Flow settings have been moved to new Extended tab
  • Password control will be used for Secret and Auth Code

0.2.1 (2023-12-28)

  • All responsive sizes have been added to jsonConfig
  • More error logging have been added

0.2.0 (2023-12-28)

  • Settings page have been changed from materialize to jsonConfig
  • Dependencies have been updated

0.1.0 (2023-12-25)

  • Initial release

License

MIT License

Copyright (c) 2024 Sebastian Häßelbarth [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

iobroker.myuplink's People

Contributors

dependabot[bot] avatar sebilm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

iobroker.myuplink's Issues

Frequent crash in newest version

Hi Seb, using the actual version from today download, it crashes frequently, every minute i would say. After a while, iobroker terminates the adapter permanently. Would you mind having a look, please?

This is the error log:

myuplink.0 2024-02-07 21:06:25.311 error Gateway Time-out: "\r\n<title>504 Gateway Time-out</title>\r\n\r\n

504 Gateway Time-out

\r\n
Microsoft-Azure-Application-Gateway/v2\r\n\r\n\r\n"
myuplink.0 2024-02-07 21:06:25.310 error Error: Gateway Time-out: "\r\n<title>504 Gateway Time-out</title>\r\n\r\n

504 Gateway Time-out

\r\n
Microsoft-Azure-Application-Gateway/v2\r\n\r\n\r\n" at MyUplinkRepository.checkError (/opt/iobroker/node_modules/iobroker.myuplink/build/myuplinkRepository.js:101:18) at MyUplinkRepository.getFromMyUplinkAsync (/opt/iobroker/node_modules/iobroker.myuplink/build/myuplinkRepository.js:72:18) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MyUplinkRepository.getDevicePointsAsync (/opt/iobroker/node_modules/iobroker.myuplink/build/myuplinkRepository.js:46:12) at async Myuplink.setSystemDeviceAsync (/opt/iobroker/node_modules/iobroker.myuplink/build/main.js:264:30) at async /opt/iobroker/node_modules/iobroker.myuplink/build/main.js:214:9
myuplink.0 2024-02-07 21:06:25.308 error unhandled promise rejection: Gateway Time-out: "\r\n<title>504 Gateway Time-out</title>\r\n\r\n

504 Gateway Time-out

\r\n
Microsoft-Azure-Application-Gateway/v2\r\n\r\n\r\n"
myuplink.0 2024-02-07 21:06:25.307 error Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
myuplink.0 2024-02-07 21:06:25.303 error { "message": "Request failed with status code 504", "name": "AxiosError", "stack": "AxiosError: Request failed with status code 504\n at settle (/opt/iobroker/node_modules/axios/dist/node/axios.cjs:1967:12)\n at IncomingMessage.handleStreamEnd (/opt/iobroker/node_modules/axios/dist/node/axios.cjs:3066:11)\n at IncomingMessage.emit (node:events:529:35)\n at endReadableNT (node:internal/streams/readable:1368:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (/opt/iobroker/node_modules/axios/dist/node/axios.cjs:3877:41)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async MyUplinkRepository.getFromMyUplinkAsync (/opt/iobroker/node_modules/iobroker.myuplink/build/myuplinkRepository.js:63:24)\n at async MyUplinkRepository.getDevicePointsAsync (/opt/iobroker/node_modules/iobroker.myuplink/build/myuplinkRepository.js:46:12)\n at async Myuplink.setSystemDeviceAsync (/opt/iobroker/node_modules/iobroker.myuplink/build/main.js:264:30)\n at async /opt/iobroker/node_modules/iobroker.myuplink/build/main.js:214:9", "config": { "transitional": { "silentJSONParsing": true, "forcedJSONParsing": true, "clarifyTimeoutError": false }, "adapter": [ "xhr", "http" ], "transformRequest": [ null ], "transformResponse": [ null ], "timeout": 45000, "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN", "maxContentLength": -1, "maxBodyLength": -1, "env": {}, "headers": { "Accept": "application/json, text/plain, /", "user-agent": "iobroker.myuplink", "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkI3NDEwMDI3NjJGQ0MzOTQ3OTA1RTA0QUIxREFBMjNGMjk4MzIzQ0ZSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6InQwRUFKMkw4dzVSNUJlQktzZHFpUHltREk4OCJ9.eyJuYmYiOjE3MDczMzYzNTQsImV4cCI6MTcwNzMzOTk1NCwiaXNzIjoiaHR0cHM6Ly9hcGkubXl1cGxpbmsuY29tIiwiYXVkIjoiQVBJLXYyIiwiY2xpZW50X2lkIjoiZTRiNWUwNDQtYjNlYy00OTg5LTllMjktODFkYzgyMTY4MWE1Iiwic3ViIjoiY2UzZDUyMzEtMzYwMy00NGFmLWE3MjktMDhkOTJiZDZlZmYxIiwianRpIjoiRDg0MDNCNDM2NUQwNEJCQTU0NjlDMDlCREMxMkRDMEEiLCJpYXQiOjE3MDczMzYzNTQsInNjb3BlIjpbIlJFQURTWVNURU0iLCJXUklURVNZU1RFTSJdfQ.vGSuImcqJz2-zJ8xxfEmk1P-0Xdh4Z7t1d0EXbYcYBN5yOeAqxvamqMzGF8E_fxNq4Ra9IGJlPwyINjvQhdc4PGa-zF9NcIa7RtZspKWCz04hEDfV6DdQIi98zW69nhJ9lZINBCOnOn0igNBeSY2lr9NFHyDHM1HjtGsMhrCSGwIZDoXss_rIGgw3Qa-kSvG-Tq0ilVvKp7EioyVm1P-PSiGuTSv61_O1mV5l44Dy4YuOgMkFEp0aPRlnL_LqnXlFP5oCq5cc5D0GVBWbu8SO1XQWJDubh76idbwf3lQo0HEyyUEFQTCbAuz9oFHhz66xsOUUNWKYOSzYlKww22RUQ", "Accept-Language": "en", "Accept-Encoding": "gzip, compress, deflate, br" }, "baseURL": "https://api.myuplink.com", "method": "get", "url": "/v3/devices/emmy-r-104783-20240205-06722520297565-68-27-19-29-fa-12/points" }, "code": "ERR_BAD_RESPONSE", "status": 504}
myuplink.0 2024-02-07 21:06:25.297 error error from /v3/devices/emmy-r-104783-20240205-06722520297565-68-27-19-29-fa-12/points
myuplink.0 2024-02-07 21:05:54.128 info Adapter started.
myuplink.0 2024-02-07 21:05:54.088 info Starting adapter.
myuplink.0 2024-02-07 21:05:54.048 info starting. Version 0.7.0 (non-npm: sebilm/ioBroker.myuplink) in /opt/iobroker/node_modules/iobroker.myuplink, node: v18.18.2, js-controller: 5.0.17
 

Danke, auf dich ist Verlass

Genau, was ich wieder gebraucht habe.
Wenn mir beim Betrieb was auffällt, melde ich mich.
Ging bei mir auf Anhieb, trotz das ich zuerst die CallBack vergessen hatte.
Datenpunkte ändern läuft bei mir auch.
alles bis jetzt super.

Datapoint collection

Hey,
do you allready have a collection of all writeable datapoints from the main menu?
I found a way to get the ID's when using DevTools. The Network section shows each datapoint action inside the Myuplink GUI.

If there is no collection, I would offer to collect the ones from my Nibe VVM225/F2120-8 and share it here.

I can imagine that it would be great for a lot of users, having an adapter-menu to create a set of datapoint's in different languages. I've checked the functionality with "set data" datapoint from your adapter with these ID's and it worked:

  Name Einheit Menü
47027 Außentemperaturpunkt °C 1.9.8
47028 Kurvenänderung °C 1.9.8

I think there is an hidden API part called internalapi.myuplink.com which is used for non offical API datapoints: https://internalapi.myuplink.com/v3/devices/***

BR, Armin

keine aktuellen Energiedaten

Describe the bug
Seit dem 1.2. werden keine aktuellen Energiedaten von myuplink geliefert? Woran mag es liegen? In der Anlage (Service-Menü) werden aktuelle Werte angezeigt. Bin ich allein mit dem Problem? MyUplink Schuld, oder was im Adapter?

System: VVM500, F2120/12

To Reproduce
Beispiel (aus dem Response json):

    {
        "category": "Heat meter",
        "parameterId": "44300",
        "parameterName": "Heating, includ­ing int. add. heat",
        "parameterUnit": "kWh",
        "writable": false,
        "timestamp": "2024-02-01T09:28:02+00:00",
        "value": 6367.5,
        "strVal": "6367.5kWh",
        "smartHomeCategories": [],
        "minValue": 0,
        "maxValue": 999999.9,
        "stepValue": 0.1,
        "enumValues": [],
        "scaleValue": "0.1",
        "zoneId": null
    },

Timestamp ist vom 1.2. - bei anderen Werten (z.B. Gradminuten) bekomme ich aktuelle Daten.

Expected behavior
Akutelle Energiedaten in den Objekten

Screenshots & Logfiles
Im Log steht nix.

Versions:

  • Adapter version: 0.7.1
  • JS-Controller version: 5.0.17
  • Node version: v16.20.2
  • Operating system: docker/unraid

Additional context
Add any other context about the problem here.

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.