Hi,
I’m looking for some help with learning how to use the Plugwise Binding. It seems there are two bindings, I’m referring to this one here.
Some info:
I’m totally new to openHAB 4.3.5 (the version I’m running), so please bear with me.
I have openHAB running on a Raspi 3B.
My issue is as follows:
I have in total 3 of these sticks, each with their own bunch of Plugwise Plugs.
I have fairly succesfully added the first USB stick (serial device), and this USB stick auto-started to scan for the zigbee Plugs, and found a bunch.
I then have been searching on how to “see” and use the capabilities of these Plugs: power, electricity consumption, status etc (channels).
I still need to come to grips on how the UI works and how I can setup a page with the Plugs and their switch + possibly graph or chart out the comsumption.
So far so good.
Now I want(ed) to add my 2nd usb stick. No problem there, I set the /serial/port, no problem there either.
But then nothing happens…
I would have hoped or expected that the 2nd stick would start scanning automatically, but this does not seem to be the case.
The documentation wiki states that [Discovery] (Plugwise - Bindings | openHAB) should run every 3 minutes and can be sped up by starting a manual discovery.
I assume you created a new Thing for this second stick, right? Each stick needs its own Thing. Does the Thing show as online?
To initiate a manual scan go to Settings → Things → + icon at the bottom → Plugwise.
This will initiate a scan for new devices.
If a new device was discovered automatically without manually triggering a scan, you’ll find it in the Inbox. Settings → Things → Inbox (bottom of the screen).
Ok, I’ve been dabling along all day to try and get this going. I’m fairly sure, that at a certain point in time, I had a blue rectangular button => scan.
I tried to find that button back but did not quite succeed. It looked very similar to the image below, but I’m quite sure I did not go into Developer.
I think the problem is with the Circle+. It does not seem to connect.
That one I have tried to add manually (I have the correct MAC address)
It then showed up at various trials with various status messages:
pending initialisation
needs config (or similar and I think one more)
Colors of the icon varying from red to orange.
I did as you suggested and found a way to scan, but I doubt that it will scan using the correct USB stick (which one of three?)
So I wonder whether it is good practise to e.g. the two other USB sticks and repeat the scan?
The Circle+ is not in the INBOX.
Also: I’ve tried multiple times to reset the Circle+ (found a document via Wayback Machine documenting multiple methods to reset.)
Maybe tomorrow I will try to put the stick back in to a Win machine that has the Plugwise Source software, and maybe find out what firmware is on that Plug)
Would it be feasible to create some rule, schedule or script (I’m not familiar with either) to use a specific (functioning and controllable) Plug.
The idea being, that I know from experience that sometimes it is not easy to correctly time the on/of/on timed procedure.
If that were possible, I could e.g. write out 2 or 3 scripts or scenes or whatever to simulate the on/of/on reset procedure.
That’s kind of the whole point of OH. To connect to lots of different technologies and let you write “rules” to create automations. Once you can send commands to the device you can write a rule to do just about anything with that device.
You have lots of choices in languages but I recommend getting started with simple UI rules and Blockly. Then if you find that too limiting or you want to learn a programming language look to JS or jRuby.
I’ve tested using multiple Sticks in openHAB some time ago so it should work.
It’s probably best to check with Source if the Circles work and are online. You need Source to add them back to the network after you’ve reset them.
If you reset Circles and add them in Source you could also just add them to one big network instead of multiple. That probably also results in a better working mesh network. Then you also have some spare Sticks and Circle+s when they break down one day.
It’s already quite old technology (~2003?) but it keeps on working without any issues for me.
B.t.w, is there a special procedure to add them back to the network?
As, in this specific case, I experience problems in joining the circle+.
But I do remember last time I had a look, that in the Plugwise Source software, the circle+ could not be joined either?
I do hear the circle+'s relay clicking…
Will test and update!
Thanks!
P.S. Are you from Belgium by any chance? If so, what region are you based?
As I was experiencing quite some problems getting things to work, but most of all I felt like many of my Plugwise Plugs were missing.
Please note, that at this point it is rather difficult to point out what has been done automatically and what has been done manually.
I just knew that plugs were missing, but I was not sure at all from which of my 3 sticks and how many.
Then, following up on @wborn’s comment / advise, I took the openHAB Pi down and plugged the 3 sticks back in the Win machine that has Plugwise Source running.
Within Source, I did a whole bunch of plug juggling, to get as much as possible Plugs in a single USB stick “network”.
While doing this, I had to “reset” most of the Plugs.
In doing so, I found that (most probably) one of my 3 Circle+ Plugs would not connect. One can hear the relay clicking, but it does not connect to the Stick and will not show up in Plugwise Source software.
In the end I had approx 38 modules from which 36 online.
Back to the openHAB Pi:
Plugged in the single Plugwise stick and booted.
found nearly all in error (logic, 2 Plugwise sticks missing, and serial port of a lot of Plugs changed…)
Deleted the Thing for the 2 removed Plugwise sticks
Updated the serial port for the Plugs
Result:
All plugs are either offline (most) and two are config pending.
I realize that if the Circle+ is not seen (offline) then neither of the other plugs will be reachable…
I’ve rebooted a couple of times hoping things would remedy but they don’t.
What I also wonder:
Serial ports can apparently be configured in two ways, either /dev/ttyUSB0 or like usb/FTDI_FT232R_bla_bla_etc
Could something be wrong in this perspective? Meaning that the mapping of the stick does not correspond to the “name” in the Circle config?
What can I do to bring the Circle+ back on-line? And then the rest…
Thanks for your help and explaining.
I’ve done what you suggested today. (Not entirely sure, but I think one Circl+ is disfunct, I do hear the relay clicking, but it will not connect in Plugwise Source)
Then added the stick back to openHAB Pi, but now apart from the Plugwise Stick, all the Plugs are either Offline or config pending. I’ve tried to adjust the serial port to the one of the current single Plugwise stick, but nothing works.
Also, the network should now have +30 Plugs / Things.
Will they be recognized automatically if and when the Circle+ reconnects?
Or should they be added manually?
I can’t help with the specific Plugwise stuff as I’ve never used the technology.
But if you have more than one USB serial device connected to the RPi, which /dev/ttyUSB# each shows up under is not deterministic. It might show up on 1 on one boot and 2 on the next. You can verify this is happening by experimenting with the different files to see if one of them works.
Another issue that can crop up is the binding might not release the lock on the file when you unplujg the stick. Thus, when you plug it back in it canot appear under the same /dev/usbtty anymore so it shows up under the next number in the sequence.
There are tutorials to create a link to a file that doesn’t change between boots. I don’t have the ability to search one up right now though. I’ll try to come back later when I have time. But this might give you enough to start debugging at least.
First thing I would do is shutdown the machine and make sure only one USB device is plugged in. Try to add that one stick as a Thing and see if that works and your devices appear in a scan. If that works, definitely search out a tutorial to map each device to a file that won’t change, reboot and change your Things to point to the serial file you created that won’t change.
Thanks!
In the meantime, seeing all the trouble I’m going through, and having nothing else but the Plugwise binding on my openHAB install, I wonder if it would not be better to reformat the microSD and start from scratch…
If the Circles don’t work in Source they also won’t work in openHAB.
It can take several minutes before Circles are properly discovered and added to the mesh when you add them in Source.
Use the same Stick and Circle+ in openHAB as you used/configured with Source.
A mesh can only have one Circle+ (network coordinator).
The Stick communicates only with the Circle+ so they should be located close together or all Circles will stay offline.
If you disconnect/reconnect/relocate Circles it can take a while before your mesh works properly again as the Circles need to find new neighbors and adjust the routing.
What firmware do your Circles use? IIRC older firmware versions won’t work due to breaking changes in the protocol.
Well, I spent near the whole day in Plugwise Source. What I did is move most if not all of my Circle’s to a single Plugwise Stick. (As you suggested, thanks for that.)
It took me a while to get back into the Plugwise Source software, but in the end it worked out quite well.
I think I had about 38 modules, 36 online.
I dug up the attached document (in Dutch) from Wayback Machine.
This document made me focus on the firmware dates too.
My Firmware dates are not 100% identical with the ones in the document.
But I think all firmwares are from around 2011.
I then plugged that single Plugwise Stick in my openHAB raspi, and boot it up. The only thing that showed up green was the Plugwise Stick.
At the moment the circle+ is showing too.
2 are marked “CONFIG PENDING”
11 are marked “OFFLINE”
I have rebooted a couple times.
@ rlkoshak wrote something about a possible lock file, but that is where I am at the moment.
I’m not sure, but I think that if the binding works, and if plugs are zigbee-discovered, they will end up in the inbox? Can you confirm that?
Do you know of a way to bring OFFLINE back to ONLINE?
The Circle+ keeps track of all known Circles which are read by the binding during discovery and added to the Inbox. Once you add them as Things the binding will send messages to the Circles and if they respond they will be marked as ONLINE.
Maybe try deleting all the plugwise Things in openHAB helps as some Circles moved from Sticks/Circle+s?
This won’t delete them from your mesh so it is safe to do.
If that does not help you can enable debug or trace logging on the binding so it will log details about what is happening which may help further explaining this.