I have a idea that I want to access a razberry Z-wave on a remote raspberry pi while I run my openhab in a hyper-V inviroment.
Anyone who done this allready?
So I would like to keep my openhab running in a virtual machine (MS Hyper-V) to have the power and redundency. I have a raspberry pi with razberry hat that I like to use for Z-wave.
I’ve been testing ser2net and socat by following some guides för serial over tcp but I don’t seem to get it right.
Is it a dead end or is it possible?
I am running a usb stick in a hyper-v environment with a Debian VM. Windows on the host detects the stick as serial and it is mapped to the VM.
I don’t think the baremettal hyper-v (2012R2 hyper-v) allows you to do that but I can be misstaken. Intresting thoug.
Anyway the razberry is connected to GPIO on the PI and it wont fit a pc.
Another benefit whould be to place the Z-wave central to the house meenwhile the server is more offset and maybe not optimal for the radio
I remember something here where people used ser2net and socat to transport serial over the network. I assume the razzberry presents itself to the OS as serial.
I don’t think this is uncommon - I think quite a few people are using socat or something similar to transport this. The binding uses the OH serial abstraction so it’s possible to use RFC2217 out of the box (I believe - I’ve not done this myself).
I am running exactly this setup successfully for over a year.
My RasPi is sitting in the middle of the house with a Razberry-Me-GPIO-Module and even a zigbee-dongle connected to USB.
On my Windows Hyper-V-Server I have a debian VM running OH 2.5.
The RPI uses ser2net for the razberry-dongle with the following /etc/ser2net.conf
3333:raw:0:/dev/ttyAMA0:115200 8DATABITS NONE 1STOPBIT
On the debian-machine I use the following /etc/default/socat.conf
“zigwave.space.flo” is the hostname of my RPi.
The Z-Wave-Binding uses /dev/ttyUSB0 for the Z-Wave-dongle and everything works as expected.
I have both, ser2net on the RPi and socat on my debian VM set to autostart on reboot - nevertheless, if socat loses connection to ser2net it wont reconnect automatically . at least I was not able to configure that correctly…
Oh Now I only want to go home and try this out.
Socat/ser2net is fairly commonly used so it’s definitely not a dead end.
Another approach is to use an instance of OH with MQTT 2.5 Event Bus.
zwave2mqtt is another option. Means the zwave instance can run on somethign with the physical zwave controller, and mqtt is used for all your openhab items. Probably very manual with mqttv2 binding as I doubt there is discoverability from 2wave2mqtt
Is there firmware for the Razzberry though?
Not an answer directly to what you’re asking, but might be relevant. I’m running OH on Windows Server 2016 in a Hyper-V environment and have had no issues with a Silex SX-3000GB USB network device server. They’re going for under $20 on eBay (US) now and just worked for me (in Windows at least). No issues auto-reconnecting on startup/plugging back in or anything like that.
Edit: Maybe not useful at all if you’re using the RPi-integrated z-wave rather than a USB stick
Depends on whether or not it supports Homie or Home Assistant MQTT standards. If so, than automatic discovery would work. The docs on their GitHub indicates there is beta support for the HA standard so automatic discovery should work I would think. https://github.com/OpenZWave/Zwave2Mqtt#robot-home-assistant-integration-beta
It’s beta so YMMV. Similarly, I’m not sure how many people are using HA discovery in OH2, but issues have been quick to be fixed on the binding so I’m sure any discovered problems would be addressed.
Well It seems to me that I got some testing to do.
I got some connection between my OH and Pi with ser2net & socat but it jumps up & down like an bungy jumper. At least I got this far.
Hmm another OH to handle z-wave as a slave OH sounds interesting. Will look in to that aswell. Is there autodetection?
I know there is the Z-way binding and it’s also an alternative .
Is there any prefered solution regarding to reliability, speed and ease of handling?
I personally am VERY happy with the Z-Wave binding and the support from the developer here. He is very capable and the community maintained device database works quite well, much better than the openzwave (non-OH) system I tried earlier.
In fact, Chris, the developer’s assistance was instrumental in me coming to OH as a user.
On the “slave” instance you will get autodetection of the Zwave devices per usual from the Zwave binding. You will need to create Items and add them to one or two Groups (see the Event Bus link above). The Rules will publish all updates and all commands to the Items that are members of the two respective Groups to a well known topic structure.
On the “master” instance you need to create a Trigger Channel on the MQTT Broker Thing with a wild card subscription to the root of that well known topic structure and create Items of the same type and same name as those that are on the “slave”. The Rules on the “master” will figure out what Item the message is from and update or command the local Item of the same name as necessary.
I’ve seen lots of reports that the Z-Way binding is kind of slow and not super reliable. But that was a long time ago. Maybe it has improved since then.
Yes I have read some about it and so I would like to try it out.
Yeah the Z-way to it self had some issue in the past and I know the first version of the Z-way binding had some issue but what I know sens the rework it works fine. Latency I dont know… Still if the Z-way it self stops nothing else will work.
I will go deeper into OH to OH and read more. Sound to me like something I really want to try out. Thanks.
The Z-Wave device database is here.
If you need to turn on debug logging, there is also a log viewer to help parse that out.
You can have a look at this:
Forwarding of serial and USB ports over the network to openHAB