Plugwise Home Automation binding for OpenHAB

Hi,

I got the communication with the stretch working through the HTTP binding, just for switching the circle’s since I’m at the moment not interested in reading the states.

Switch Achtertuin_licht   "Achtertuin"      <light>       (Backyard)   ["Lighting"] { http=">[ON:POST:http://IPadresstretch/core/appliances;id=*applianceID*/relay{authorization=Basic *base64 encoding of stretch username:pwd*&Content-Type=text/xml}:<relay><state>on</state></relay>] >[OFF:POST:http://IPadresstretch/core/appliances;id=*applianceID*/relay{authorization=Basic *base64 encoding of stretch username:pwd*&Content-Type=text/xml}:<relay><state>off</state></relay>]" }

cpmeister did a review for the PR. Seems nothing big :slight_smile: @QNimbus don’t want to push too much, but you are still around?

Hi @QNimbus

During the adding of the Adam I do get the following fault code.
I am using the 2.5.2. snapshot.
To be sure I also added the xml file from the adam.

Would it be possible to take a look?
Thanks in advance!

Gerwin

2020-07-31 17:50:42.541 [DEBUG] [ha.internal.PlugwiseHAHandlerFactory] - Creating new Plugwise Home Automation Bridge

2020-07-31 17:50:42.574 [DEBUG] [discovery.PlugwiseHADiscoveryService] - Start Plugwise Home Automation background discovery

2020-07-31 17:50:42.621 [DEBUG] [rnal.handler.PlugwiseHABridgeHandler] - Initializing the Plugwise Home Automation bridge handler with config = PlugwiseHABridgeThingConfig{host = adam, port = 80, username = smile, smileId = *****, refresh = 5}

2020-07-31 17:50:43.132 [TRACE] [pi.model.PlugwiseHAControllerRequest] - >> GET http://adam/core/domain_objects;@locale=en-US

2020-07-31 17:50:43.153 [ERROR] [rnal.handler.PlugwiseHABridgeHandler] - Unknown error while configuring the Plugwise Home Automation Controller

org.openhab.binding.plugwiseha.internal.api.exception.PlugwiseHAException: java.net.UnknownHostException: adam: Name or service not known

	at org.openhab.binding.plugwiseha.internal.api.model.PlugwiseHAControllerRequest.getContentResponse(PlugwiseHAControllerRequest.java:241) ~[bundleFile:?]

	at org.openhab.binding.plugwiseha.internal.api.model.PlugwiseHAControllerRequest.getContent(PlugwiseHAControllerRequest.java:194) ~[bundleFile:?]

	at org.openhab.binding.plugwiseha.internal.api.model.PlugwiseHAControllerRequest.execute(PlugwiseHAControllerRequest.java:156) ~[bundleFile:?]

	at org.openhab.binding.plugwiseha.internal.api.model.PlugwiseHAController.executeRequest(PlugwiseHAController.java:369) ~[bundleFile:?]

	at org.openhab.binding.plugwiseha.internal.api.model.PlugwiseHAController.getDomainObjects(PlugwiseHAController.java:198) ~[bundleFile:?]

	at org.openhab.binding.plugwiseha.internal.api.model.PlugwiseHAController.getUpdatedDomainObjects(PlugwiseHAController.java:210) ~[bundleFile:?]

	at org.openhab.binding.plugwiseha.internal.api.model.PlugwiseHAController.refresh(PlugwiseHAController.java:101) ~[bundleFile:?]

	at org.openhab.binding.plugwiseha.internal.api.model.PlugwiseHAController.start(PlugwiseHAController.java:92) ~[bundleFile:?]

	at org.openhab.binding.plugwiseha.internal.handler.PlugwiseHABridgeHandler.initialize(PlugwiseHABridgeHandler.java:105) [bundleFile:?]

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_252]

	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_252]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]

	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]

	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_252]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]

Caused by: java.net.UnknownHostException: adam: Name or service not known

	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:1.8.0_252]

	at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929) ~[?:1.8.0_252]

	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324) ~[?:1.8.0_252]

	at java.net.InetAddress.getAllByName0(InetAddress.java:1277) ~[?:1.8.0_252]

	at java.net.InetAddress.getAllByName(InetAddress.java:1193) ~[?:1.8.0_252]

	at java.net.InetAddress.getAllByName(InetAddress.java:1127) ~[?:1.8.0_252]

	at org.eclipse.jetty.util.SocketAddressResolver$Async.lambda$resolve$1(SocketAddressResolver.java:170) ~[?:?]

	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) ~[?:?]

	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) ~[?:?]

	... 1 more

domain.txt (39.9 KB)

Hi @lampy,

At a first glance it seems that you might have misconfigured the hostname of the Adam. Could you try to use it’s IP address instead of the ‘adam’ hostname?

The ‘adam’ hostname in the bridge configuration is just a default placeholder and is not likely to work for everyone since it depends on your local network configuration. IP addresses should always work and if you have properly configured your hostnames (e.g. via DHCP/DNS) you can also use a hostname instead of an IP address.

Hope this helps you out!

1 Like

Hi @lsiepel,

Sorry for the late reply! I have not (yet) been able to get around to fixing the PR because I ran into a few issues compiling the suggested changes. (I’m not extremely experienced in Java and OSGI to be honest) Also RL gets in the way lately :wink:

I do intend to get back to this but I cannot say for certain when this will be. In the meantime I would be more than happy if anyone is willing to look at the PR and suggested fixes and push their own PR for this binding!

Perfect, works! Thanks

I’m thinking about buying a plugwise adam and a Tom with a Lisa. I’m curious if the binding sees if the heater is on or not.

The case is, i own a 1 zone underfloor heating connected to my Heater, for the complete ground floor. I want to shut off the pump for the floorheating to stop heating the groundfloor with a simple zigbee powerswitch. (It’s almost impossible to use the Koen modules from plugwise, I have to buy the Koen-6, it’s 250 euro and the purpose of the koen-6 is to control 6 zones, and all 6 are 1 zone in my house.)

So i want to turn on the underfloor heating pump when the heater is on. On my normal Remeha iSense thermostat, it’s visible when the heater is on, so can imagine it should be visible from the Adam. The other situation is our office room. When the Tom is open to heat up the room, the underfloor pump has to shut off so the ground floor isn’t overheating, and is safes a lot of gas that way.

Hope someone has an anwser for my situation!

Jeroen

Hi Jeroen,

I would strongly advise you to use a Tom to control the floorheating. The Tom can be placed right in front of the distribution block. That way the adam itself can control the zone just like a single room with a radiator. I have this setup and it works great.
It saves you a Floor or Koen devices and it would be less error prone. I think i have uploaded some pictures but not sure if it was here or at tweakers.

1 Like

@QNimbus At Tweakers someone showed the API does support waterpressure information and domestic hot water heating. I would really love this to be added to the binding.

I see i replied to you on tweakers as well. Thanks for the tip. I thought of it, but that means I should drain all the water from the heating system from upstairs, but it sounds like the best sollution. I couldn’t find the picture on tweakers. I think i know what you mean, but just to be sure i made a awesome drawing of how i would place the Tom, is this what you mean?:.

@djpsycho82 Hi Jeroen, I took a picture of my underfloor heating distributor a while back and seems your drawing is correct (at least to me :wink:)

1 Like

Exactly what i meant. Installation and draining maight be a bit more work, but imho it is the best solution to your problem. While you work on the valve, don’t forget to add another powersocket to power the usb adapter for the Tom. :wink:

1 Like

I also see in your picture that you use a plugwise Plug. I think i could only use the plug to switch off the floor heating pump and save a lot of work on installing the Tom on the floor heating system. Why do you have both installed?

Hi Bas,

First of all: great work! It functions like a charm, however, I get the repeated error below:

[ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-plugwiseha'

I have the “org.openhab.binding.plugwiseha-2.5.2-SNAPSHOT.jar” in my “X:\openhab2-addons”-directory, which I presume is the correct one…

Is there a way to fix that?

I started to look into your code this weekend. Never used Java, Git or any of this, so it was a steep learning curve. But i managed to extend your work and add an Appliance_boiler thing, with some channels i really need.
You did all the hard work, so how do you suggest to proceed? I can create a pull request to your repo, but i can also make a new PR against OH.

Made a version for 3.1.0, not sure if i’m going to backport it to 2.5.x (that is currently my main instance)
Binary : Release 202012212255 · lsiepel/openhab-addons · GitHub
Repo: https://github.com/lsiepel/openhab-addons/tree/plugwiseha

My goal is to support all the available points/channels available. I don’t have any documentation for the API, is it available somewhere? I currently just look at the XML from the Plugwise service, but that is probably not covering all options.

2 Likes

@lsiepel Thanks for your hard work on this - If you can manage to create a PR I can merge it into the main branch.

I’m not using OpenHAB at the moment so I have no way to really test your work, but you can compile your work and add the binding manually to your OpenHAB instance.

I’m not at home at the moment (and on mobile) but I will check your PR at the earliest convenience and see if I can merge it for you.

You sir, are a hero! (Bas also off course)

I’m currently on 2.5.10 but am planning to migrate to 3.0, but not sure when i’m going to migrate. I’m willing to test this when needed. I guess the binding doesn’t work on 2.5?

As a side note - since I’m not actively using OpenHAB anymore myself (and this binding) I suppose it would make sense if I handover the plugwiseha binding github repository to someone who is able and willing to further develop this binding.

So if anyone wants to ‘adopt’ this repository I would be more than happy to give them full access (or even change ownership) to the GitHub repository

Ah too bad your not using openHAB anymore. Thanks for all the effort, without you starting the binding i wouldn’t be able to finish it. I copied your binding code to my repo and because a lot has changed since yours was updated, i would like to continue on my own repo, if you agree.
I’m not sure how to proceed with all the copyright stuff (signing off et cetera).

Did you reverse engineer the service or do you have some kind of documentation?

Just did some more development, and back ported it to 2.5.x

*Zone *
Added channel presetScene

Lisa
Added channel offsetTemperature
Added thing properties: vendor, model, hardware, firmware, mac, zigbee_reachable, zigbee_powersource, zigbee_type

Tom/Floor
Added channel valve_position
Added thing properties: vendor, model, hardware, firmware, mac, zigbee_reachable, zigbee_powersource, zigbee_type

Some PR feedback was allready fixed, i did some more, but not all is done.

2.5.x => https://github.com/lsiepel/openhab-addons/tree/2.5.x =>

Binaries for both openHAB versions are available from here: https://github.com/lsiepel/openhab-addons/releases/

2 Likes

Hi @lsiepel,

First of all, I appreciate the work you are willing to put into this binding - it’s people like you who make this community really great. The reason I’m not using OpenHAB at the moment is because I decided to try out Home Assistant a while back. And while Home Assistant is a really nice platform (like OpenHAB!) I definitely miss the OpenHAB community. The OpenHAB community is (as far as my first impressions go with the HA community) a lot more welcoming and supportive! That’s a huge ‘plus’ for OpenHAB in my book!

Now back on topic:

Did you reverse engineer the service or do you have some kind of documentation?

I had to reverse engineer the XML output of the Plugwise API since I had no documentation. I’m not even sure if there is any documentation. If you run into issues you can always ‘sneek-a-peak’ at the Home Assistant integration for Plugwise which seems to be working pretty good as well (link to GitHub repo)

I’m also not really experienced in the Java programming language and the OSGI platform used by OpenHAB. That made developing the binding in the first place a bit harder for me and involved a lot of reading Java documentation, much like what you had to do to pick up the development of this binding.

I copied your binding code to my repo and because a lot has changed since yours was updated, i would like to continue on my own repo, if you agree.

You’re more than welcome to start your own repository, but if you want I can transfer ownership of my forked repo to you. You would also need access to the Plugwise Home Automation binding on the Eclipse Marketplace. Which is the place where OpenHAB users can download the binding before it’s merged into the main release of OpenHAB. (Also a lot quicker for updates instead of waiting for a more recent OpenHAB release)