OpenZWave / qt-openzwave

QT5 Wrapper for OpenZWave
GNU Lesser General Public License v3.0
105 stars 30 forks source link

RaZberry card on remote Pi not seen by OZW #136

Closed danielbrunt57 closed 3 years ago

danielbrunt57 commented 4 years ago

I have a RaZberry card on a Pi which is available via ser2net at tcpip_addr:port_4000. Why can ozw not see/use the device created by socat on my HASSIO platform?

kpine commented 4 years ago

Pass the device as a volume. Except if you're using the Addon you probably can't do that.

kpine commented 4 years ago

For a more detailed answer:

  1. You're not going to get much support here for using network serial devices. See closed issue #79 for example.
  2. Assuming you are using the OpenZWave Addon, the Home Assistant organization manages their own docker image for use with the addon. You'll need to ask them how you can configure the addon to use the socat device. I presume that is your problem (?), but you didn't give any details.
  3. If you are able to run the Docker standalone images provided by OpenZWave, a user in the HA Discord has had initial success using a socat serial device. The solution was to pass in the socat device as a volume, not a device. You could try reading these posts in the OpenHAB forum and see if that works for you. You're basically on your own though if it has issues...
danielbrunt57 commented 4 years ago

Yes, I am trying/would like to use the HA OZW add-on.
However, I did try the ozw docker standalone on the pi itself and while it seems to be be able to open the local physical port, it seems to not be able to communicate with the RaZberry...just a whole lot of nothing as compared to a spare HUSBZB-1 plugged into the pi as a test and I'm wondering if that could be because the RaZberry was/is configured in HomeSeer and perhaps needs a factory reset? Before starting ozw on the pi I did disable Z-Wave in HS AND also terminated ser2net on the pi so that /dev/ttyAMA0 was free and clear. I'm pretty sure I need to overcome that hurdle before trying ser2net...

The OpenHAB implementation of rfc2217://{ip_addr}:{ip_port} looks like it might be the way of the future in eliminating socat. I hope OZW is looking at this!

danielbrunt57 commented 4 years ago

So, I used Z-Way (on a separate SD card) to reset my RaZberry, It was in SIS mode (something to do with HomeSeer?). I disabled SUC/SIS mode, changed SD cards & started my OZW all-in-one docker on the Pi and it could then communicate with /dev/ttyAMA0. I have successfully included 2 nodes now and HASS saw the remote ozwdaemon (via MQTT I presume) and the 2 devices now show in HA. My first node was Monoprice RGB Controller and is unrecognized but the 2nd was Monoprice On/Off switch and it works. Only 20 more to go...

scyto commented 3 years ago

@danielbrunt57 nice, i just got a RazBerry. Do you have a write up you could share?
Why zwave2mqtt in docker on the pi vs on the pi natively? anything i should know in terms of using zwave me software? (also you might want to close this issue :-) )

danielbrunt57 commented 3 years ago

Z-Way software is not required. I only had to use it to reset the controller after having used it with HomeSeer. I'm not using zwave2mqtt in docker on Pi. I am using OpenZWave Version 1.6.1545 / qt-openzwave Version 1.2.0 / QT Version 5.12.8 via docker pull openzwave/ozwdaemon:allinone-latest. I also have the Windows version of OZWAdmin ver 0.1.74 on my PC. It seemed the easiest and quickest way I've found to get/maintain/upgrade OpenZWave on a single-purpose, dedicated machine (my Pi) and also the closest to what you would have if you added the OpenZWave add-on into HA (all supervisor add-ons are docker containers in HA). I run HA on my HP ProDesk where I have the Mosquitto broker add-on, the MQTT Mosquitto broker integration and the OpenZWave (Beta) integration.

docker run -d \
 --name ozw \
 --restart=unless-stopped \
 --security-opt seccomp=unconfined \
 --device=/dev/ttyAMA0 \
 -v /opt/ozw/config:/opt/ozw/config \
 -v /etc/localtime:/etc/localtime:ro \
 -e MQTT_SERVER="192.168.1.104" \
 -e MQTT_USERNAME="homeassistant" \
 -e MQTT_PASSWORD="A----#--V-#----#-----#---#---#E----------#C-----#T---H-----#---" \
 -e USB_PATH=/dev/ttyAMA0 \
 -e OZW_NETWORK_KEY=0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x## \
 -p 1983:1983 \
 -p 5901:5901 \
 -p 7800:7800 \
openzwave/ozwdaemon:latest
scyto commented 3 years ago

Thanks, will give that a try too, will post back with a yaml once i have converted it.

(i have zwave2mqtt working since i posted, found z-way and openzwave in that container hated sharing the serial port - no surprise!, also as i understand in zwave2mqtt is just a web interface to the latest openzwave?)

I had tried both openzwave and zwave2mqtt on a NAS with USB (where the HA and MQTT run too) but wanted to switch to a dedicated unit for z-wave. What i liked about zwave2mqtt is it appears to have more of the zwave options around inclusion and multiple controllers i expected to see. I couldn't see that in open zwave - but will keep looking!

thanks for prompt response, I apprecaite it.

my draft yaml file (yes i know they have one on their guthub, i prefer mine with my changes)

version: '3.7'
services:
  openzwave:
    container_name: openzwave
    image: openzwave/ozwdaemon:latest
    security_opt:
      - seccomp:unconfined
    restart: unless-stopped
    tty: true
    stop_signal: SIGINT
    networks:
      - zwave
    devices:
      - '/dev/ttyAMA0:/dev/ttyAMA0'
    volumes:
      - ./config:/opt/ozw/config 
      - /etc/localtime:/etc/localtime:ro
    ports:
      - '1983:1983'
   environment:
      MQTT_SERVER: "192.168.0.1"
      MQTT_USERNAME: "my-username"
      MQTT_PASSWORD: "my-password"
      USB_PATH: "/dev/ttyAMA0"
      OZW_NETWORK_KEY: "0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##"

networks:
  zwave:
# volumes:
#   openzwave:
#     name: openzwave
danielbrunt57 commented 3 years ago

I never looked at zwave2mqtt so I don't know what the core of it is, whether it's OpenZWave based or not. Maybe I should revisit it!

blhoward2 commented 3 years ago

I never looked at zwave2mqtt so I don't know what the core of it is, whether it's OpenZWave based or not. Maybe I should revisit it!

zwave2mqtt runs on top of ozw 1.6. The maintainer has created the new zwavejs2mqtt, which does not.

scyto commented 3 years ago

I never looked at zwave2mqtt so I don't know what the core of it is, whether it's OpenZWave based or not. Maybe I should revisit it!

FWIW these are the instructions i wrote up so i don't forget, i won't assume you have docker-compose installed so include those instructions too :-)

$ sudo apt install python3 
$ sudo apt install python3.pip
$ sudo pip3 -v install docker-compose 

$ mkdir zwave2mqtt
$ cd zwave2mqtt
$ curl -fsSL https://raw.githubusercontent.com/OpenZwave/Zwave2Mqtt/master/docker/docker-compose.yml -o docker-compose.yml
$ nano docker-compose.yml
      Change serial in devices to correct serial port (e.g. ttyAMA0
      Add following to voumes:  - ./openzwave:/usr/local/etc/openzwave
     Exit nano and save
Copy open zwave database to enable updates to be be persistent
        $ APP=$(docker run --rm -it -d robertslando/zwave2mqtt:latest)
        $ docker cp $APP:/usr/local/etc/openzwave ./
        $ docker kill $APP
$ Sudo docker-compose up -d 
scyto commented 3 years ago

zwave2mqtt runs on top of ozw 1.6. The maintainer has created the new zwavejs2mqtt, which does not.

Unless i am missing something that seems to be more of zwave driver at this time, no pretty UI? Does this mean though that zwave2mqtt has limited lifespan?

blhoward2 commented 3 years ago

zwave2mqtt runs on top of ozw 1.6. The maintainer has created the new zwavejs2mqtt, which does not.

Unless i am missing something that seems to be more of zwave driver at this time, no pretty UI? Does this mean though that zwave2mqtt has limited lifespan?

Zwavejs2mqtt looks like the regular zwave2mqtt and has the same web interface. Both are very useable and way more than just a web interface to ozw. The maintainer has said that he will stop development of zwave2mqtt because, in part, the development of ozw (and qt-openzwave) has stalled. There have been practically no updates since July and the ozw maintainer has apparently been fairly silent since then. The only one with active development right now is zwavejs2mqtt.

danielbrunt57 commented 3 years ago

There have been practically no updates since July and the ozw maintainer has apparently been fairly silent since then.

Who would that be?

scyto commented 3 years ago

@blhoward2 thanks for the info, probably explains the slow progress the zwave.me folks have had integrating with ozw. i hope he is ok, i note on that link he posted in Oct - which means he's still alive (with all thats going on being alive is not an assumption one can make :-( )

for this noob, what does this mean in terms of HA's bet on OZW? or is that all still up in the air....

blhoward2 commented 3 years ago

@blhoward2 thanks for the info, probably explains the slow progress the zwave.me folks have had integrating with ozw.

for this noob, what does this mean in terms of HA's bet on OZW? or is that all still up in the air....

I have no insight into their thought process but this feels very much to me like past open source projects I’ve followed where the maintainer loses enthusiasm and the project eventually goes dormant.

danielbrunt57 commented 3 years ago

He's been active since October (barely)...

https://github.com/OpenZWave/open-zwave/pull/2393

image

blhoward2 commented 3 years ago

He's been active since October (barely)...

OpenZWave/open-zwave#2393

image

I edited my post with a correction but then somehow deleted it. He has made a few minor commits but that is it. A bunch of critical bugs have gone unaddressed, like the MQTT disconnection problem. And others like the Leviton flooding bug people had to build custom docker images with he PR incorporated to fix it for months until he accepted the ready fix for it.

blhoward2 commented 3 years ago

Who knows...maybe I’m wrong and he has written some massive update offline that he is going to drop. It is certainly a lot of work to maintain a project like this so I certainly don’t mean to call him out... It is just odd to me the level of response (or lack thereof) that happened almost as soon as HA started pushing people to test it.

danielbrunt57 commented 3 years ago

I could see where once HA people started testing it where the issues could become what could seem insurmountable and cause one to throw up their hands and turn to pig farming...

scyto commented 3 years ago

I certainly don’t mean to call him out.

Oh i didn't think you did. Life happens. People move on. Its the nature of open source and he owes none of us anything (if anything the other way around.

I will switch over to https://github.com/zwave-js/zwavejs2mqtt as i am just at my start of the journey with zwave on hass (in playing around it wiped all devices from my old controller :-) )

danielbrunt57 commented 3 years ago

On the other hand, personal issues could be a major factor...

danielbrunt57 commented 3 years ago

For now, my z-wave lights and switches turn on and off and my one OpenZWave blind opens and closes along with the 5 still in HomeSeer.....

blhoward2 commented 3 years ago

I certainly don’t mean to call him out.

Oh i didn't think you did. Life happens. People move on. Its the nature of open source and he owes none of us anything (if anything the other way around.

I will switch over to https://github.com/zwave-js/zwavejs2mqtt as i am just at my start of the journey with zwave on hass (in playing around it wiped all devices from my old controller :-) )

I’ll say that the maintainer for that project has responded to my few minor issues within a few hours. Looking through he issue list he has been patching bugs in 2-3 days.

danielbrunt57 commented 3 years ago

I have a demo 700 series Z/IP bridge controller the developer wanted me to test in OpenZWave... I'll look at zwavejs2mqtt and the thread mentioned months ago that touches on interfacing bridge controllers...

danielbrunt57 commented 3 years ago

Going to look at moving my OZW container from Pi to HP and getting it to use RaZberry via ser2net first. If that works, then I can load the Z/IP stuff on the Pi and plug in this new stick and have another go at it...

scyto commented 3 years ago

i just shutdown the zwave2mqtt docker, spun up the zwavejs2mqtt - configured my serial port, network key and one time out parameter and 10 seconds later it saw the RaZberry zwave and the one device i have inlcuded. I will try out the MQTT connection and HASS autodetection next.

danielbrunt57 commented 3 years ago

Nice!

blhoward2 commented 3 years ago

i just shutdown the zwave2mqtt docker, spun up the zwavejs2mqtt - configured my serial port, network key and one time out parameter and 10 seconds later it saw the RaZberry zwave and the one device i have inlcuded. I will try out the MQTT connection and HASS autodetection next.

If you haven’t already, pull the dev tag image. He’s pushing commits at a rapid pace so latest was out-of-date and had a startup bug as of a few days ago. He may have rebuilt it since then.

danielbrunt57 commented 3 years ago

I also have a new ZWave Plus RaZberry daughter card for my Pi but I need to modify it for external antenna before implementing it...

scyto commented 3 years ago

i just shutdown the zwave2mqtt docker, spun up the zwavejs2mqtt - configured my serial port, network key and one time out parameter and 10 seconds later it saw the RaZberry zwave and the one device i have inlcuded. I will try out the MQTT connection and HASS autodetection next.

If you haven’t already, pull the dev tag image. He’s pushing commits at a rapid pace so latest was out-of-date and had a startup bug as of a few days ago. He may have rebuilt it since then.

Will do. Yup got hass auto detecting just fine (i adjusted auto detection). So this works (i just turned a light on and off) - what i am not sure is what are the ideal settings, i couldnt find that documented.

image

blhoward2 commented 3 years ago

No idea if it’s right but I set qos 0 as I saw the maintainer recommend that for someone else. I turned on store. I turned off retain discovery as that seems to cause issues as people test and change things. And I turned on send zwave events so I could see in MQTT what it’s doing (probably not necessary).

scyto commented 3 years ago

Thanks, made the qos change. Turned off retain (just incase).

I also just turned on 'use node name instead of numeric node IDs' (note this change doesn't seem to affect things already detected. I do like idea of coding name and area into the device / entity string (note the visible name in HA can still be set).

Shame the MQTT integration can't auto assign to area if there is match :-)

thanks for all your help, you just saved me hours!

scyto commented 3 years ago

oh and if you havent seen this, you may like it :-)

image

blhoward2 commented 3 years ago

Thanks, made the qos change. Turned off retain (just incase).

I also just turned on 'use node name instead of numeric node IDs' (note this change doesn't seem to affect things already detected. I do like idea of coding name and area into the device / entity string (note the visible name in HA can still be set).

Shame the MQTT integration can't auto assign to area if there is match :-)

thanks for all your help, you just saved me hours!

Since you had retain discovery on HA won’t see any changes until you delete the MQTT topic and restart HA.

danielbrunt57 commented 3 years ago

I managed to migrate my ozw from Pi to HP where HA is. Re-activated ser2net for ttyAMA0 on the Pi and configured socat on the HP using ttyZWave. Fired up ozw docker with:

docker run -d \
 --name ozw \
 --restart=unless-stopped \
 --security-opt seccomp=unconfined \
 -v /opt/ozw/config:/opt/ozw/config \
 -v /etc/localtime:/etc/localtime:ro \
 -v /dev/ttyZWave:/dev/ttyAMA0 \
 -e MQTT_SERVER="192.168.1.104" \
 -e MQTT_USERNAME="homeassistant" \
 -e MQTT_PASSWORD="A----#--V-#----#-----#---#---#E----------#C-----#T---H-----#---" \
 -e USB_PATH=/dev/ttyAMA0 \
 -e OZW_NETWORK_KEY=0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x##,0x## \
 -p 1983:1983 \
 -p 5901:5901 \
 -p 7800:7800 \
openzwave/ozwdaemon:latest

and it's working! -v /dev/ttyZWave:/dev/ttyAMA0 versus --device=/dev/ttyAMA0 was the key.

Now to try zwavejs2mqtt...

danielbrunt57 commented 3 years ago

If you haven’t already, pull the dev tag image.

Where do I find the dev tag image?

blhoward2 commented 3 years ago

If you haven’t already, pull the dev tag image.

Where do I find the dev tag image?

If you’re on supervised, no idea. If you’re on docker then just pull the docker image it lists in the instructions but change latest to dev.

danielbrunt57 commented 3 years ago

I'm running this in docker, thanks.

danielbrunt57 commented 3 years ago

Up and running but... 1st issue trying to lock Weiser/Kwikset Smartcode door lock: Driver: Door Lock: "targetMode" must be of type "number", received "string"

scyto commented 3 years ago

I also have a new ZWave Plus RaZberry daughter card for my Pi but I need to modify it for external antenna before implementing it...

Why an antenna? I found it can see some devices on the opposite side of the house (i have the blue board version with the antenna circuit on it). Are you having issues once you put it in a certain location / case?

blhoward2 commented 3 years ago

Up and running but... 1st issue trying to lock Weiser/Kwikset Smartcode door lock: Driver: Door Lock: "targetMode" must be of type "number", received "string"

We should move this over to the zwavejs2mqtt GitHub. Post it there and then I have some ideas depending where you’re getting that.

danielbrunt57 commented 3 years ago

Yes I had issues with the older green board model. I could position the pi in my coat closet to reach window blinds 1, 2 and 3 that face south on the same level (2nd) but then my bedroom blind on 3rd floor facing north was hit and miss. Re-orienting the pi and I could reach bedroom blind but not kitchen blind 3 and sometimes blind 2. Three level townhouse < 1600 sq ft. Once I added an exact length of wire for ¼ wave 908.42 MHz protruding through the cover of the pi all was resolved.

I also have orientation issues with Z-Wave from Nortek USB dongle in HomeSeer which is extended by a 3’ USB extension…

danielbrunt57 commented 3 years ago

Will do. I’ve shutdown zwavejs2mqtt for now and resurrected ozw for the time being. I need to make a list of my current entity names so I can replicate those into zwavejs so as to not have to find and edit all the old references in lovelace, automations, scripts, etc.

scyto commented 3 years ago

I moved my SD card and RaZberry from my pi3 to pi4. Oddly the software couldn't get zwave data from the card, the stdout indicated it could see the serial port just fine (the are dev/ttyAMA0 on both units.

Is the RaZbery in someway locked to the unit is installed on?

scyto commented 3 years ago

Yes I had issues with the older green board model. I could position the pi in my coat closet to reach window blinds 1, 2 and 3 that face south on the same level (2nd) but then my bedroom blind on 3rd floor facing north was hit and miss. Re-orienting the pi and I could reach bedroom blind but not kitchen blind 3 and sometimes blind 2. Three level townhouse < 1600 sq ft. Once I added an exact length of wire for ¼ wave 908.42 MHz protruding through the cover of the pi all was resolved. I also have orientation issues with Z-Wave from Nortek USB dongle in HomeSeer which is extended by a 3’ USB extension…

Interesting, I assumed all z-wave traffic was supposed to go over all nodes - so even if the controller can't see one device it should be able to talk to it via the mesh... that might explain why i had some issues with some exclusions/inclusions setting this up - a couple of devices i had to move to where the z-wave controller was, do exclusion and then inclusion, then move device back to desire location and heal network. Thanks for the tip, i will keep an eye on mine.

scyto commented 3 years ago

I also have orientation issues with Z-Wave from Nortek USB dongle in HomeSeer which is extended by a 3’ USB extension…

USB 3 cables and ports are notorious for noise, i have to distance my mouse and keyboard dongles away from USB3 wires or they get iffy, so that doesn't surprise me.

danielbrunt57 commented 3 years ago

I moved my SD card and RaZberry from my pi3 to pi4. Oddly the software couldn't get zwave data from the card, the stdout indicated it could see the serial port just fine (the are dev/ttyAMA0 on both units.

Is the RaZbery in someway locked to the unit is installed on?

No, I'm sure it's not as I don't see how it could be. However, I think the UART structure might be different on the pi4 than it is on pi3 so it could be the underlying code for the pi3 boot is not working the way you need it to on the pi4? I'd be double checking there for issues. If you remove the hat from the pi4 and boot it back up does /dev/ttyAMA0 disappear? I'd be more inclined to create a fresh SD for the pi4 and then install/copy the software config from pi3 to pi4...

danielbrunt57 commented 3 years ago

If you are playing around with Z-Way Software and OZW make sure only 1 of them is running,,,

beerygaz commented 3 years ago

I moved my SD card and RaZberry from my pi3 to pi4. Oddly the software couldn't get zwave data from the card, the stdout indicated it could see the serial port just fine (the are dev/ttyAMA0 on both units.

Is the RaZbery in someway locked to the unit is installed on?

I went through the same issue. You need to disable bluetooth on the Pi4 as it uses the same UART pins.

scyto commented 3 years ago

Thanks, I eventually found that, also found I still needed to rerun their software and then u install it. Not sure if that was incidental or meaningful.

Get Outlook for iOShttps://aka.ms/o0ukef


From: Gavin Hill notifications@github.com Sent: Saturday, January 30, 2021 10:33:31 AM To: OpenZWave/qt-openzwave qt-openzwave@noreply.github.com Cc: scyto lx_b@msn.com; Comment comment@noreply.github.com Subject: Re: [OpenZWave/qt-openzwave] RaZberry card on remote Pi not seen by OZW (#136)

I moved my SD card and RaZberry from my pi3 to pi4. Oddly the software couldn't get zwave data from the card, the stdout indicated it could see the serial port just fine (the are dev/ttyAMA0 on both units.

Is the RaZbery in someway locked to the unit is installed on?

I went through the same issue. You need to disable bluetooth on the Pi4 as it uses the same UART pins.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FOpenZWave%2Fqt-openzwave%2Fissues%2F136%23issuecomment-770260578&data=04%7C01%7C%7C04dc9b23ebdf4bcef3e408d8c54d8bc9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637476284139025629%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=cTwKhWr2NZMqIsq4vHYlBRk4edLCghVDHLjH395l6pI%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACWXVXCL7JI2OZYWSBNZQ3TS4RGHXANCNFSM4PIOQ75A&data=04%7C01%7C%7C04dc9b23ebdf4bcef3e408d8c54d8bc9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637476284139030623%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mv3sagxhLZIhMENHT4OLKydutmJ4pAWEd1jkK6zDhpE%3D&reserved=0.