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

Valve + Irrigation + Heater with OSRAM Smart Plugs on HUE Bridge #882

Closed
NicolaiBre opened this issue Jan 8, 2021 · 21 comments
Closed

Valve + Irrigation + Heater with OSRAM Smart Plugs on HUE Bridge #882

NicolaiBre opened this issue Jan 8, 2021 · 21 comments
Labels

Comments

@NicolaiBre
Copy link

Hi,
I am a new user of homebdrige. I have several different Items running on OSRAM Smart plugs (which are attached to the HUE Bridge), therefore I want, inf possible to configure those plugs separately to:

  • Heater
  • Irrigation-Valve (2 Options = Power on = open / Power off = closed
  • Waterpump

I was able to manage the change to Plugs which worked fine with:
http://192.168.2.106/api/4ykDL4AMvv-1L4C7wjEEXAMPLEEXAMPLEEXAMPLE/lights

Next I've used

ph -H 192.168.2.106 -u dfJf7F-IDMEXAMPLEEXAMPLEEXAMPLE post /resourcelinks '{ "name": "homebridge-hue", "description": "valve", "classid": 1, "links": [ "/lights/7" ] }'

Which gives back 5 Digits.

My question is now:
Is there anything further to do which I have not done correctly as nothing changes?

Thanks a lot,
Nicolai

@ebaauw
Copy link
Owner

ebaauw commented Jan 8, 2021

You need to restart Homebridge after creating the resourcelink. If you enable Homebridge debug mode (or start homebridge -D manually), Homebridge Hue logs what it exposes during startup, incl. What resource links it recognises.

You can specify in Home how the valve should be displayed, similarly to specifying how an outlet should be displayed. You should also get the duration and auto-off for valves. Not sure if Home has an appropriate icon for heater (would be under outlet).

@ebaauw ebaauw added the question label Jan 8, 2021
@NicolaiBre
Copy link
Author

Thanks a lot for your answer.
After restarting in the debug mode it shows:

///////////////////////
[08/01/2021, 09:48:08] Error: listen EADDRINUSE: address already in use :::51970
at Server.setupListenHandle [as _listen2] (net.js:1318:16)
at listenInCluster (net.js:1366:12)
at Server.listen (net.js:1452:7)
at EventedHTTPServer._this.listen (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/eventedhttp.ts:84:21)
at HAPServer._this.listen (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:236:22)
at Bridge.Accessory._this.publish (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:976:18)
at Server.publishBridge (/usr/local/lib/node_modules/homebridge/src/server.ts:192:17)
at /usr/local/lib/node_modules/homebridge/src/server.ts:164:24
at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:163:5)
[08/01/2021, 09:48:08] Got SIGTERM, shutting down Homebridge...
[08/01/2021, 09:48:08] [Hue] Heizung: set homekit in use to 1
HAP Warning: Characteristic 000000D2-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000047-0000-1000-8000-0026BB765291. Adding anyway.
[08/01/2021, 09:48:08] [Hue] Ventil Gartenbewässerung: set homekit in use to 0
HAP Warning: Characteristic 000000D2-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000047-0000-1000-8000-0026BB765291. Adding anyway.
[08/01/2021, 09:48:08] [Hue] last heartbeat 0, drift 1
[08/01/2021, 09:48:13] [Hue] goodbye

////////////

Even in the Apple Home app nothing changed.

grafik
grafik

@ebaauw
Copy link
Owner

ebaauw commented Jan 8, 2021

[08/01/2021, 09:48:08] Error: listen EADDRINUSE: address already in use :::51970

This usually means Homebridge is already running.

Best set DEBUG in the Homebridge UI (under Homebridge Settings) and the issue Restart from the UI.

@NicolaiBre
Copy link
Author

Hmmm...

Even with the activated debug mode, the same notification appears.

What I've tried additionally:
-Total shut down
-Restart
-Deleted the Homebridge in the Home App

Is there another way to set the plugs as sprinklers as they do not need to be shown necessary as valves.

/////
[08/01/2021, 14:31:25] [Hue] Heizung: set homekit in use to 0
HAP Warning: Characteristic 000000D2-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000047-0000-1000-8000-0026BB765291. Adding anyway.
[08/01/2021, 14:31:25] [Hue] Ventil Gartenbewässerung: set homekit in use to 0
HAP Warning: Characteristic 000000D2-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000047-0000-1000-8000-0026BB765291. Adding anyway.
[08/01/2021, 14:31:25] [Hue] Lichterkette: set homekit in use to 1
HAP Warning: Characteristic 000000D2-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000047-0000-1000-8000-0026BB765291. Adding anyway.
////
grafik
grafik

Just as info:
grafik

@ebaauw
Copy link
Owner

ebaauw commented Jan 8, 2021

HAP Warning: Characteristic 000000D2-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000047-0000-1000-8000-0026BB765291. Adding anyway.

UUID D2 is the In Use characteristic for the Valve service, but UUID 47 is the Outlet service. Do you have the same /lights resource in both outlet and valve resource links?

@NicolaiBre
Copy link
Author

Not sure if I got you right.

I ve used the code as following for the Valve "Heizung"

6 is the code id I got via http://192.168.2.106/api/4ykDL4AMvv-1L4C7wjEEXAMPLEEXAMPLEEXAMPLE/lights
grafik

ph -H 192.168.2.106 -u R6FP2WrmtUjvxxxxxxxxxxxxxxxx post /resourcelinks '{ "name": "homebridge-hue", "description": "valve", "classid": 1, "links": [ "/lights/6" ] }'

Not sure what mean with same resource for outlet and valve.
(Physically the valve is connected to the Plug above so it only has to options - 1 is Open, when Current is on / Closed when current is off)

@NicolaiBre
Copy link
Author

NicolaiBre commented Jan 8, 2021

Just saw that in the home app all the plugs that I've changed with the above command appear 2 times maybe this is the issue, but don't know what to do - How to avoid.

They appear as Plug and as a Light.

grafik

@ebaauw
Copy link
Owner

ebaauw commented Jan 8, 2021

Not sure what mean with same resource for outlet and valve.

That the same light is mentioned in multiple resource links. Check through ph get /resourcelinks.

Just saw that in the home app all the plugs that I've changed with the above command appear 2 times maybe this is the issue

Are you still exposing the lights natively through the Hue bridge?

ebaauw added a commit that referenced this issue Jan 8, 2021
- Remove _Configured Name_ characteristic, see #861;
- Remove _Unique ID_ characteristic, see #866.
- Handle case where same resource is in different type resourcelinks (`outlet`, `switch`, `valve`), see #882;
@ebaauw
Copy link
Owner

ebaauw commented Jan 9, 2021

v0.12.13 handles the same light in different resource links: outlet trumps switch trumps valve. That should get rid of the HAP warnings.

@NicolaiBre
Copy link
Author

First thanks a lot for all your help :).

I think I got the mistake of exposing both lights via Hue Bridge + Via Homebridge to Home.
grafik

Now only the plugs are exposed via homebridge / the lights via the Hue Bridge to Home.

But still the same problem with the valves.

After installing the Update to v.0.12.13 I receive the following:
grafik

@NicolaiBre
Copy link
Author

Sorry for that stupid question.

How to apply the ph get advise
Is it for example
ph get 192.168.2.106
(Ip of the Hue Bridge, or which address needs to be used)

@ebaauw
Copy link
Owner

ebaauw commented Jan 9, 2021

It's ph -H 192.168.2.107 get. Alternatively, set PH_HOST.

$ ph get /config/name
"pi2"
$ echo $PH_HOST
pi2
$ PH_HOST=hue-3
$ ph get /config/name
"hue-3"
$ ph -H pi1 get /config/name
"pi1"

Issue ph -h for help.

$ ph -h
Command line interface to Philips Hue or deCONZ API.

Usage: ph [-hVDp] [-H hostname[:port]] [-u username] [-t timeout] command [argument ...]

Parameters:
  -h, --help
  Print this help and exit.

  -V, --version
  Print version and exit.

  -D, --debug
  Print debug messages for communication with Hue bridge / deCONZ gateway.

  -p, --phoscon
  Imitate the Phoscon app.  Only works for deCONZ.

  -H hostname[:port], --host=hostname[:port]
  Connect to hostname:80 or hostname:port instead of the default localhost:80.

  -u username, --username=username
  Use username instead of the username saved in ~/.ph.

  -t timeout, --timeout=timeout
  Set timeout to timeout seconds instead of default 5.

Commands:
  get [-hsnjuatlkv] [path]
  Retrieve path from bridge/gateway.

  put [-hv] resource [body]
  Update resource on bridge/gateway with body.

  post [-hv] resource [body]
  Create resource on bridge/gateway with body.

  delete [-hv] resource [body]
  Delete resource from bridge/gateway with body.

  discover [-hv] [-t timeout]
  Discover bridges/gateways.

  config [-hs]
  Retrieve bridge/gateway configuration (unauthenticated).

  description [-hs]
  Retrieve bridge/gateway description.

  createuser [-hv]
  Create bridge/gateway API username.

  unlock [-hv]
  Unlock bridge/gateway so new API username can be created.

  touchlink [-hv]
  Initiate a touchlink.

  search [-hv]
  Initiate a seach for new devices.

  lightlist [-hv]
  Create/update lightlist resourcelink.

  outlet [-hv]
  Create/update outlet resourcelink.

  switch [-hv]
  Create/update switch resourcelink.

  probe [-hv] [-t timeout] light
  Probe light for supported colour (temperature) range.

  restart [-hv]
  Restart Hue bridge or deCONZ gateway.

For more help, issue: ph command -h

See https://github.com/ebaauw/homebridge-hue for more info.
(homebridge-hue v0.12.13, node v14.15.4)

@ebaauw
Copy link
Owner

ebaauw commented Jan 9, 2021

After installing the Update to v.0.12.13 I receive the following:

That's not looking good. As workaround, could you try adding the bridgied / username from the log to config.json anyway and restart Homebridge?

EDIT Looking at the code, that's indeed a bug. The base path isn't set to the new API key, after it is created. Will be fixed in next version.

But still the same problem with the valves.

Could you please enable Homebridge DEBUG mode in the Homebridge UI (under Homebridge Settings), and capture and attach the Homebridge log?

ebaauw added a commit that referenced this issue Jan 9, 2021
Bug fix: URL base path not updated after creating an API key.  See #882.
@NicolaiBre
Copy link
Author

ph get ... gave out:

If I get it right the plugs are registered 2 times one time as outlet 1 time as valve
grafik
grafik

@ebaauw
Copy link
Owner

ebaauw commented Jan 9, 2021

If I get it right the plugs are registered 2 times one time as outlet 1 time as valve

That's what I thought. v0.12.12 and earlier don't cope with that. v0.12.13 and later simply ignore the valve link when outlet has already been set.

@NicolaiBre
Copy link
Author

Ah ok.

So as a walk around shall I edit the config json?

If so where / how shall I add the Bridge ID / Username=

Thats the current config.
grafik

@ebaauw
Copy link
Owner

ebaauw commented Jan 9, 2021

Under the Hue section under platforms. See the Wiki for examples.

@NicolaiBre
Copy link
Author

OK got it, now it looks better but still, the plugs are not shown as valves.

grafik

@ebaauw
Copy link
Owner

ebaauw commented Jan 11, 2021

You need to remove them from any outlet resource links. outlet trumps switch trumps valve.

@NicolaiBre
Copy link
Author

Ok, deleted them via
ph -H 192.168.2.106 -u 4WTVcsVRWEXAMPLEXAMPLEEXAMPLE delete /lights/6

Shall I add the device via the Hue app or how to proceed?

@ebaauw
Copy link
Owner

ebaauw commented Jan 11, 2021

Now you’ve deleted the light itself. I said to remove it from the outlet resource link. Anyways, the Hue API should have removed the light from any resource links on deletion, so, yes, re-add the light and re-add it to the valve resource link. Note that it will likely get a new resource id (different from /lights/6) when you re-add it.

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

No branches or pull requests

2 participants