Giter VIP home page Giter VIP logo

node-red-contrib-homeconnect's Introduction

node-red-contrib-homeconnect

This nodes for Node-RED allow to control devices which are connected to the Home Connect system.

Installation

To use the HomeConnect nodes a Client ID and Client Secret are required. Those can be received from the home connect developer page:

https://developer.home-connect.com/

  • After setting up an account, register a new application and select Authorization Code Grant Flow as the OAuth Flow.
  • Use the callback URL that is configured in the auth node as Redirect URI of your application.

Available Nodes

home-connect-auth

The node handles the authentication for the HomeConnect Developer API.

Start the authorization from the properties dialog, finish the authorization at Home Connect and then save and deploy your changes.

Node Properties

Property Information
Name Name of the node (optional)
Client Id Enter the Client ID available on the HomeConnect Developer Portal
Client Secret Enter the Client Secret available on the HomeConnect Developer Portal
Use Simulation Wheter or not simulation or real appliances shall be used

home-connect-request

The Request node requires an home-connect-auth node as an config node to recevice an access token.

An input triggers the request to the HomeConnect API.

Node Properties

Property Information
Name Name of the node (optional)
Tag Category you want to control
Action Action you want to perform
HAID HAID of the home appliance
Option Key Option Key in case you want to control a specific option
Body JSON data in case you want to set e.g. a program or option

home-connect-event

The Request node requires an home-connect-auth node as an config node to recevice an access token.

It outputs event messages for the selected home appliance.

Node Properties

Property Information
Name Name of the node (optional)
HAID HAID of the home appliance

node-red-contrib-homeconnect's People

Contributors

alexkn avatar dependabot[bot] avatar ericstaal avatar hobbyquaker avatar pckhib avatar pinkit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-red-contrib-homeconnect's Issues

Auth not working anymore

Hello,

The auth module worked perfectly while a lot of month and since +/- 1 month, it's not working anymore. The last update changed nothing.

I tried to reconnect, I received correctly the token, I updated, I deployed but after I receive this message in the debug area :
image

Am I alone in this case ?

Thank's in advance for your help.

I need an example and auth problems

Is it possible to get an example of how to turn on / select program / start my dishwasher?
I can't get this going

In addition, I have to restart the Auth after each deploy.

Refresh Token and Authorization not working anymore

Since yesterday the token cannot be refreshed and I tried to set up a new authorisation and this doesn't function. The callback URL says ok and the auth-node keeps daying authorizing.

Node-RED gives this error:

node-red   | 1 Jun 19:56:35 - SyntaxError: Unexpected token u in JSON at position 0
node-red   |     at JSON.parse (<anonymous>)
node-red   |     at parseToken (/data/node_modules/node-red-contrib-homeconnect/lib/ApiService.js:27:23)
node-red   |     at Request.request.post [as _callback] (/data/node_modules/node-red-contrib-homeconnect/lib/ApiService.js:104:25)
node-red   |     at self.callback (/data/node_modules/node-red-contrib-homeconnect/node_modules/request/request.js:185:22)
node-red   |     at emitOne (events.js:116:13)
node-red   |     at Request.emit (events.js:211:7)
node-red   |     at Request.onRequestError (/data/node_modules/node-red-contrib-homeconnect/node_modules/request/request.js:877:8)
node-red   |     at emitOne (events.js:116:13)
node-red   |     at ClientRequest.emit (events.js:211:7)
node-red   |     at TLSSocket.socketErrorListener (_http_client.js:401:9)
node-red   | npm ERR! code ELIFECYCLE
node-red   | npm ERR! errno 1

It worked for 2 a 3 weeks withouth problems. Is this a known issue.

"HomeConnectError: insufficient_scope: Insufficient scope for this resource"

I get the error message from the title.

I'm using it with a node like this:
image

What am I doing wrong?

{
  "data": {
    "key": "BSH.Common.Setting.PowerState",
    "value": "BSH.Common.EnumType.PowerState.On",
    "type": "BSH.Common.EnumType.PowerState",
    "constraints": {
      "allowedvalues": [
        "BSH.Common.EnumType.PowerState.On",
        "BSH.Common.EnumType.PowerState.Standby"
      ]
    }
  }
}

Getting "Error: Bad Request" when I try to start a dishwasher program

I am running node-red-contrib-homeconnect in a docker container Node Red instance. The home connect is implemented & authorized as described and I am able to run all the get requests with successfully. Unfortunately the set requests do not work. So I am not able to start a dishwasher program (remote start on the device is enabled) or set any option value for a program.

image

Any idea?

home-connect-request

I can not implement the "home-connect-request" Node
i get an error with, an exclemation mark with [object,object].

Any ideas (Node-red V1.3.6)

image

401: Unauthorized

Hello,
When I try to start the autorization, after get the email and login page, when I select "accept" on the next page, I get "401: Unauthorized".
In scope, I have only put "IdentifyAppliance"

please make a sample flow

Hi can you please make a sample flow I can not get I fully to work. the call back is not working and I get ok when using the call back local. but I try authentificaton both on simulation and with real devices:

{
"error": "unauthorized_client",
"error_description": "client or redirection URI not authorized"
}

so if you made a sample flow maybe many beginner errors would be eliminated.

thanks

How to catch "get_active_program" errors?

Hi,

I'm using the "home_connect_request" node to "get_active_program" from the given HAID and this works as expected - but: as soon as there's no active program available, the node throws an error which will be displayed in the debug window:

msg : string[67]
"404 Not Found SDK.Error.NoProgramActive: There is no program active"

I wan't to capture this error using the "catch"-node, but this doesn't work - the node is never triggered by the error.

Any idea why this doesn't work?

Thank you,...

Authorization issues

After registering the application on the developers-page, entering the callback URL at the Redirect URI field, I am trying to authorize the connection. But where the API on the Home Connect developers actually leads me towards 'finishing the authorization' and I can see my appliances in the results, no such options rise when I am using the application. I must be overlooking something, but I'm lost on what I should do.

Any suggestions?

Wrong protocol for callback URL when using Node-RED behind a reverse proxy

Hi!

My Node-RED instance is running behind a reverse proxy that offers https. The callback_url doesnt respect that cause the request from the proxy to node-red is plain http and so req.protocol is http:// then.

So I'm accessing Node-RED via e.g. https://node-red but the callback_url then points the oauth flow back to http://node-red.

I can offer to create a PR, would you accept that?

Possible Solutions that came to my mind:

  • Make the callback_url configurable
  • Look for a X-Forwarded-* header (that then has to be set by the reverse proxy)
  • Hand through window.location to the /homeconnect/auth/start endpoint
  • Use the Referer header

I would prefer the possibility to make the callback_url configurable. Simple, but bullet proof. If left empty it would still default to the current req.protocol + '://' + req.get('host') + '/homeconnect/auth/callback - so nothing should break.

What do you think?

Regards,
Sebastian

Give Scope doesn

{"error":"invalid_scope","error_description":"given scope doesn't match requested scope"}

Give Scope doesn't match requested scope

Heya,

I hope I configured everything as it should be but I get this here:

{"error":"invalid_scope","error_description":"given scope doesn't match requested scope"}

On the devpage I did something like this:
image

And in node-red I did it like this:
image

And if both don't match I get this:
image
In english: The user used is not assigned to this application in the Home Connect Developer Portal.

Auth node is not installed

I have tried to install the palette three times and the auth node never gets intsalled.
I only get request and event.

What could be the issue?

home-connect-event node periodically gives: {"type":"error"}

Hello

Every now and then (probably every hour). the event node gives an error. The logfile only prints:

26 Feb 17:23:27 - [error] [home-connect-event:vaatwas] {"type":"error"}

I only monitor a dishwasher. I don't think there were actions on that dishwasher at these moments.

Thanks in advance

Home Connect integration not working

Hi team,

unfortunately, the integration/connection with home connect does not work for me.

I always get the following error message:
{
"error": "unauthorized_client",
"error_description": "client or redirection URI not authorized"
}

image

image

Do you have any idea to solve this?

Dynamic Request Body

Hi,

first let me say this plugin is awesome, thank you so much for this. I will use this to control my appliances based on the current electricity price, really next level thanks to you!

I would like to ask if it is somehow posssible to use variables in the JSON Body of the request node. Because I would like to set a timer for my dishwasher after I calculated when it should start. Is this possible currently?

Thanks again!

Where do I get the HAID from?

The docs guide me to get Node-red authenticated, and then asks for a HAID.
Nowhere in the docs does it state what the HAID is, or where to retrieve it from.

I'm not a HomeConnect developer, I just want to handle events when my appliances are finished.

Error 429: Too Many Requests

Hi,

since yesterday, the event has stopped working due of an API error 429 (too many requests):

"{"type":"error","status":429,"message":"Too Many Requests"}"

How to solve this?

Thanks,...

Serverproblems?

Hi!
I have no connection from node red to home connect. Did someone also get this notifcation also?
"not connected" is shown under the node.
IO Broker is still working.

Thank you!

Home appliances disconnected

Since yesterday, all my home appliances are disconnected, i.e. "connected: false". Get_home_appliances is working, but nothing else. However, I can see them connected via native Home Connect app - everything ok there.
I really don't know what has happened. Any clue?

Error with haid

"Error: Required parameter haId is not provided"

After 3 Months i geht this error in the debug window of nodeRed:
"Error: Required parameter haId is not provided"

No changes on the machine or the nodes.
Unbenannt

Red Event after Deploy

Hello, I currently get an event from node red every time I deploy.

"[RED.events] Deprecated use of "nodes-started" event from "/home/pi/.node-red/node_modules/node-red-contrib-homeconnect/nodes/home-connect-auth.js:73:20". Use "flows:started" instead."

I suspect a component is out of date. Can this be?
Node Red is version 1.2.1.

Thank you for the effort.

How to use it?!?

Hello, Sorry but i cannot hable to make your node working!
i can connect to my appliance fine because i can get HSID form my node-red server! Is that my connection is working! but only get_appliances is working!

Wehn i try to make onther thing i together get this error:
{"payload":"xxxxf2c9.6d27","event":{"clientX":579,"clientY":193,"bbox":[499,227,655,179]},"socketid":"EgSjKkxxxxxxy4cCAAAE","_msgid":"8bxxx9b9.29b978","error":"Error: Conflict"}
Have you any idee?

Can you send me any screenshot of working config has exemple?
Many thanks for your job!

Error: Forbidden

Everything I do, I get a Error: Forbidden message back.

I set up a developer account and an application with Authorization Code Grant Flow.

The redirect uri is my Node-RED test machine: http://192.168.2.2:1880/homeconnect/auth/callback
(this machine is not accessible from the Internet).

I get a login prompt when authorizing with the oauth settings dialog. I log in with my Home Connect credentials used to connect the iOS app and see dishwasher with all authorizations and press Authorize button.

The Redirect URL gives an OK in the browser and the oauth settings dialog give's a `tokens received' message. I update, and deploy. The request node gives a green dot with ready.

Settings in request node:

  • tag: General
  • action: get_home_appliances

Scope in oauth dialog: Dishwasher.

I double checked my Client ID and Client Secret.

I do not have an blue oauth node, only a request and event node. oauth is in the request node as config button.

Can you please help me? I do not get what I'm doing wrong.

Error after start authorization

Hi,

When i start the Authorizaion i get the following error:

Missing code or state parameter in http://<URL>/auth/external/callback?code=<CODE>&grant_type=authorization_code
The strange thing is that i entered as callback url: https://<URL>/auth/external/callback in the home-connect developer api site.

Deprecated dependencies

2024-05-04T17:04:52.709Z Install : node-red-contrib-homeconnect 0.6.7

2024-05-04T17:04:54.006Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2024-05-04T17:04:54.204Z [err] npm
2024-05-04T17:04:54.204Z [err]  WARN config production Use `--omit=dev` instead.
2024-05-04T17:05:06.389Z [err] npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
2024-05-04T17:05:06.421Z [err] npm WARN deprecated [email protected]: this library is no longer supported
2024-05-04T17:05:06.500Z [err] npm WARN 
2024-05-04T17:05:06.500Z [err] deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
2024-05-04T17:05:17.276Z [out] 
2024-05-04T17:05:17.276Z [out] added 142 packages in 23s
2024-05-04T17:05:17.289Z rc=0

Scope Error

I am getting this error
{"error":"invalid_scope","error_description":"given scope doesn't match requested scope"}
when I try to authorize Oven, Control or Oven-Control. Same with Hob. Washer, Hood etc works fine.

How to authorise for multiple scopes

Great work you're doing on this node-red contrib project!
I'm trying to find my way around the possibilities. HomeConnect's API documentation is pretty good, so that'll work.
One thing though, how can I authorise for multiple scopes?
API Doc says to provide multiple scopes separated by %20 (space). However, whatever I try, I can't seem to get the auth node to produce a valid request with multiple scopes.
How should it be done?

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.