What repo did you use for the OZW beta?
I use the docker image that Fishwaldo puts out: docker pull openzwave/ozwdaemon:allinone-latest
Iām not surprised. I knew (but failed to document) that loading times can be painful. This is part of the reason that my recommended method of adding the GUI is to use an entire view. You should only load this GUI when you actually need to use it.
Have you narrowed down what elements are actually slowing down load times? If youāve managed to find a solution Iād be happy to update the package.
I assume youāre also using a container for home assistant. Can you share how youāre firing that up? Especially any docker-compose
files.
Ah, the beta exists in integrations already. Did you have to disable the non-beta integration first?
After adding the beta integration, do you see multiple ālockā services? For example, lock.clear_usercode is not working in the standard integration, but you said itās working in the beta for your kwikset lock? Are they named the same way?
Yes, I also moved my Home Assistant to a docker container on one of my servers, my Zwave is now decoupled from my HA and running on the rPi3 that used to host HA as well.
No currently you only get lock.lock, and lock.unlock. I can manually add/remove user codes via MQTT.
Iām going to try to see if I can whip up a PR for user codes.
With my UI updates that I posted yesterday, the front end loading is nice and quick on low-end hardware. On high end hardware itās negligible. A ~1 second delay on the lock config page load and 1-2 seconds on the specific code edit popup.
Regarding the actual HA z-wave load, after some monitoring, itās only an extra minute or two to finish z-wave starting, and thatās fine considering I normally donāt restart HA, except when tinkering.
But as I mentioned yesterday, decoupling the Lovelace page with button cards from the actual popup of code config data made a big difference.
Thanks for the awesome package!
So when I delete a use code this happens:
2020-07-02 16:59:17 DEBUG (MainThread) [custom_components.ozw] [VALUE CHANGED] node_id: 14 - label: Alarm Type - value: 33 - value_id: 144115188316782609 - CC: CommandClass.ALARM,
2020-07-02 16:59:17 DEBUG (MainThread) [custom_components.ozw] [VALUE CHANGED] node_id: 14 - label: Alarm Level - value: 3 - value_id: 144396663293493265 - CC: CommandClass.ALARM
Alarm Type: 33 (User Deleted)
Alarm Level: 3 (Code Slot)
This happened when I deleted code slot 3. Guess that could be used to verify the codeās been wiped.
Edit: PRās in.
Iām going to be afk for a few days. My NUC got hit by ransomware. Little fāers
bummer.
First time posting here and thereās a LOT to read through in this thread so apologies if I missed something relevant. Moved to HA from Wink only about a month ago so Iām an HA noob. Be gentle.
I have a single Kwikset 916 lock. First and only lock Iāve ever played with. Iāve got HA running in Qemu on my NAS. Itās the default HASSOS 4.10 (4.11 was JUST released but I havenāt updated yet). Itās a VM that is a very stripped down OS that just runs docker. Itās what you end up when you follow the guides and download their images for running it as a VM. You canāt install gawk or any packages that I can see in that OS so I fired up Debian on WSL and did an apt-get install gawk and after considerabke mucking around was able to get a clean run of setup.sh then moved that folder into my HAās packages folder and it all looks good.
Incidentally, to sum up the problems people are having with setup.sh I think they seem to be one or more of these:
- No gawk and no way to install it.
- They are using the shell you get from TMUX using the Terminal/SSH add-on which seems problematic. It loads Busybox which does not get hung up the below array creation but again no gawk.
- Using the terminal directly from HASS OS produced different results. It errors out on the ā(ā in
files=(*.ini)
whatever version of BASH that is does not apparently like using () to create arrays.files=*.ini
works but does not create an array so the for loop hates it. Probably would have gotten hung up on no gawk anyway if it had gotten that far. - As someone else pointed out
sensorname=
default contains spaces and caps so it makes you think itās just a friendly name thing that can have spaces in it but this does not bode well with setup.sh. I would change that default or add a comment to the FrontDoor.ini - The error message in your else statement
lock_manager.ini is incomplete or does not exist
is kind of misleading. I spent some time looking around for this missing ini file before I realized it was just the generic error thatās thrown when parsing the ini files fails and has nothing to do with a specific ini file. I think this error should be changed to āProblem parsing your ini file(s). Please check the syntax and make sure you have gawk installed.ā or something similar.
There are too many different ways to run HA me thinks. So perhaps a different, more universal, setup script might be in order but itās way out of my league to come up with one. Not sure if HASS OS is also what gets used on the Rasberry Pi loads but if it is that would explain a lot. I think thatās probably the most popular deployment.
One other small thing I noticed was for notifications you use notify.my_devices
which doesnāt work on my system. Iām guessing itās a custom array you setup? I donāt know but changing that to my specific phone worked. I donāt know if thereās a universal value here that would work for any user that might be better or if it should be made into a part of the GUI to choose notification devices. Just thought iād point out that youāre probably publishing something that only works for you.
Anyway, my real reason for posting is that Iām very very close to having this running perfect but I need some help debugging. The GUI is all setup fine. I did the bits with the input_booleans and all that is fine. But the automations never seem to trigger when I set the codes in the GUI. When triggering the Add codes automation manually it still does not set the codes. However, I can go to the node under Z-Wave and Node user codes section and program it fine there. Also, can go to Developer Tools -> Services -> lock.set_usercode and program it using that tool. My lock (I have no idea about others) requires the codes be converted from ascii and sent as hex in this format: \x31\x32\x33\x34
(which is ā1234ā). Even in the lock.set_usercode service I have to do usercode: \x31\x32\x33\x34
.
Is this just my lock or does everyones locks send the codes as hex?
I assume the add usercode automation is supposed to be triggered after you set a pin and toggle enabled right? The execution time does not update on it though. Manually executing it does not set the codes either although iām not sure if itās supposed to work like that or only be triggered by the GUI?
So I guess Iām wondering where I should start debugging here. Is there a log I should be looking at? Do I need to figure out how to modify the code to convert the ascii to hex? Iām a sysadmin by trade and not a developer but I could probably hack that out but I think iām getting hung up somewhere before that process.
Iām using PowerShell to convert the ascii to hex in the format it wants and then paste that into HA:
Function MakeHexforDoorLock { Param([string]$Code); (format-hex -InputObject $Code -Encoding ascii).HexBytes -split(" ") | %{ write-host $('\x' + $_) -NoNewline }}
# then run it like so:
MakeHexforDoorLock -code "1234"
# Output:
\x31\x32\x33\x34
And thatās how Iām setting my codes right now which works but Iād just love to get this GUI up and running 100% with the scheduling and guest codes, etc.
Thanks for reading my small novel. Any help is appreciated.
-Sean
One follow up thing I noticed was that while lock.set_usercode
service seems to work fine when I pass the correct hex code values, running lock.get_usercode
does not seem to do anything. I donāt see anything happen in the OZW log like I do when I trigger lock.set_usercode
. Are these services part of this project or built into the system? Do I need to fix the lock.get_usercode first? Is that my real problem? and where would I look at that code?
Pass the value as a string or int, not a hex value.
They are a service provided by the zwave integration. Short answer: yes the system.
No
No
You canāt really in that version of zwave.
In the ozw beta thatās being tested, all the usercode commands work as advertised. (stay tuned on that).
Thanks for your reply. I see you are right about lock.set_usercode. The hex values are needed only when I program directly from the zwave integration.
But what about the automation? They should work to program whatever codes I have entered into the GUI and upon enabling a code the automation should be triggered right? So it seems I have two problems. The GUI isnāt triggering the automation and the automation doesnāt work when triggered manually. I guess iāll start there. Thanks.
Depends, they should set, but if thereās an error for some reason, it wonāt trigger and set the codes. Check your home-assitant.log
for errors regarding the automations.
There will be a breaking change for this package in ozw.
Example:
- service: lock.set_usercode
data_template:
node_id: >-
{{states.lock.kwikset_touchpad_electronic_deadbolt_locked_frontdoor.attributes.node_id}}
code_slot: >-
{% set index = 17 %}
{% set object_id = trigger.to_state.object_id %}
{% set code_slot = object_id[index:] %}
{{ code_slot }}
usercode: >-
{{ range(1000, 9999) | random | int }}
This will need to be changed to:
- service: lock.set_usercode
data_template:
entity_id: lock.kwikset_touchpad_electronic_deadbolt_locked_frontdoor
code_slot: >-
{% set index = 17 %}
{% set object_id = trigger.to_state.object_id %}
{% set code_slot = object_id[index:] %}
{{ code_slot }}
usercode: >-
{{ range(1000, 9999) | random | int }}
From node_id to entity_id?
Correct, you can also send it a list of locks to update, so you can bulk add/remove codes if you like.
Maybe you can help me get the new OZW installed? Iām using a docker setup btw.
I use docker-compose to manage mine hereās an example you can use to fire yourās up:
version: '3'
services:
ozwd:
image: openzwave/ozwdaemon:allinone-latest
container_name: "ozwd"
security_opt:
- seccomp:unconfined
devices:
- "/dev/ttyUSB0"
volumes:
- ./ozw:/opt/ozw/config
ports:
- "1983:1983"
- "5901:5901"
- "7800:7800"
environment:
MQTT_SERVER: "192.168.0.1"
MQTT_USERNAME: "my-username"
MQTT_PASSWORD: "my-password"
USB_PATH: "/dev/ttyUSB0"
OZW_NETWORK_KEY: "0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00"
restart: unless-stopped
I put my ozw in /opt/ozw
on my āDockerPiā and I renamed my device to /dev/zwave
devices:
- "/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave"
volumes:
- /opt/ozw:/opt/ozw/config
...
USB_PATH: "/dev/zwave"
- That MQTT Server is the one that you were using before?
- Whatās the /dev/ttyUSB0 used for? How does that compare to the /dev/zwave you have below? I take it you renamed it so you didnāt have to modify your existing docker-compose?
- Is the network key the same one you used for the older OZW?