thanks for the tip.
I agree the - sensor option will be easier to read.
Hi Petro,
I got around to playing with this again and edited an existing automation you helped me with to set the group using this code
- service: group.set
data_template:
name: Zwave kWh
object_id: zwave_kwh
entities: '{{ states.sensor | selectattr(''object_id'', ''search'', ''(powerboard|powernode)'')
| selectattr(''object_id'', ''search'', ''(_energy)$'') | map(attribute=''entity_id'')
| list }} '
This created the group" group.zwave_kwh " which contains all the energy entities (currently 113) I need to refresh using the zwave js refresh service. So i donāt have to write or copy/paste all the entities
First test seems to pass and its refreshing.
So I set an automation to fire off every 30 minutes to replace the polling I was doing in zwave.js mqtt
id: '1643717044642'
alias: Refresh Z-wave Energy Readings
description: ''
trigger:
- platform: time_pattern
minutes: '30'
condition: []
action:
- service: zwave_js.refresh_value
data:
entity_id: group.zwave_kwh
mode: single
Iām hoping that its setup to do go off at :00 and :30 so its two refreshes per hour.
Iāll let it run over night and review in the morning.
Thanks to you and @finity for your responses.
113 entities polled in one call, interested if it might cause some network congestion. Is there a way to check that ?
Look in the zwavejs logs. Youāll see that it does infact negatively impact your system. There should be no reason you have to poll unless your device requires it (like if you want an instant light switch thatās polling only).
So far, so good.
Functionally its working and rudimentary testing (i.e turning lights on the hour or half hour works with minimal delay)
Looking at the controller stats
Iāll need to look into what CAN is.
Iāll set the logging to silly and save to a file so I can review more on the weekend.
I suspect there will be some delay as I had setup polling and offset each nodes entity by 1 second.
This automation will be doing a blanket poll.
TL;DR
In terms of congestion, I found in the older zwave setup, I had to poll both the power nodes/boards for everything. Then when I moved to zwave.js I was polling both W (every 60 seconds) and kWh (every 5 minutes). I recently doubled the number of power boards and power nodes in the network and noticed it was slowing everything down.
I found that the Watt sensors were updating before the 60 seconds, I paused the polling for them and that helped remove the 113 polls for those and so its now just the 113 polls for the kWh.
I have another few more power boards to go so I might look to changing the group and break it up and poll those groups with a 1 or 2 second offset.
I have the old greenwave power boards, if i donāt poll or refresh, i canāt get the values.
Its a pain, but they were free as part of a project i was working on.
its what got me into home assistant so they canāt be all bad
Yes I understand, I was just explaining to others that you donāt want to do this unless you have to. Itās a āLast Resortā scenario in most cases. You happen to have one of those cases.
I was so excited to give this upgrade a try, but I canāt get past the first step. I paste the code in the Developer Tools/Template/Template Editor box but no node string information generates. Am I missing something?
Are you using zwave 1.4 or openzwave currently? You should have zwave entities in your states list in developer tools ā states. Zwave entities start with zwave.xxx
I currently have a Z-stick connected to my server and passed through to my HA VM which is using Zwave 1.4. I plan on using these instructions to migrate to ZwaveJS2MQTT but in that process move my Z-stick to a RaspberryPi running ZwaveJS2MQTT. So I believe I would install the ZwaveJS integration and point it at ws://IP_of_Pi:3000.
The problem Iām trying to figure out is I also have a detached garage that is out of range so currently for devices in the Garage I have another Pi with a separate Z-stick connected to it that is currently running zwave2mqtt which I believe is openzwave, communicating to the MQTT broker on my HA VM. I want to also convert this Pi from openzwave/zwave2mqtt to zwavejs2mqtt. Is it possible to setup a second ZwaveJS integration that connects to ws://IP_of_Garage_Pi:3000 or would I need to have the Garage zwavejs2mqtt Pi still send as MQTT back to HA?
What are the pros/cons of using websocket connections vs just using mqtt?
yes.
You can have more than one zwavejs integration connected to individual zwavejs servers (which is what zwavejs2mqtt is).
the only one I can really think of is that you have one less middle-man to go thru so you should have less latency and less complication in the setup.
Can I do this when my network key is set to ānullā, or do I have to create/change this?
I only have 2 sensors configured and donāt use a secure node atm.
ānetwork_keyā: null,
pansaer
Correct me if Iām wrong, but I believe the most important difference is that with the websocket connection the ZwaveJS integration in Home Assistant will be used. The ZwaveJS integration will manage device auto-discovery and create devices/entities automatically in Home Assistant. This is much easier to use and generally what most people want.
If you connect to ZwaveJS2MQTT via MQTT, the ZwaveJS Home Assistant integration is not used so any of the functionality that provides isnāt available. All of the devices are considered part of the MQTT integration.
There is a feature that can be enabled in ZwaveJS2MQTT where MQTT configuration topics for Home Assistant autodiscovery will be created. My understanding is these are a little less fleshed out than the more tightly integrated ZwaveJS devices.
MQTT integration might give somewhat more control for Zwave devices that arenāt well supported by ZwaveJS. Though with ZwaveJS you can get access to low level details like command classes and parameters, which can be used with automations to implement functionality that isnāt currently available through the ZwaveJS integration.
I donāt believe ZwaveJS will start unless āS0 Legacyā contains a valid key. This is what used to be the network key.
I donāt have any experience with not having a network key. I was under the impression that was required in the old Zwave integration.
I think if you donāt have a network key to put in the S0 Legacy field, youāll probably need to create one and you might wind up having to exclude and re add your two existing devices.
When I migrated, I only had the network/S0 legacy key. I was able to use ZwaveJS to set the other 3 keys when I migrated. This didnāt cause any problems since I didnāt have any S2 devices at that point, but left me ready for them.
Correct me if Iām wrong,
It all looks correct to me.
Is it possible to upgrade devices from S0 to S2? I have S2 devices that are connected with S0 according to the zwavejs interface, I believe that was a limitation of Zwave 1.4 as it didnāt support S2.
I had something weird happen to me that took a while to debug. I thought Iād share in case it helps anyone else out. I had the legacy Zwave configured with yaml. I followed the steps above, but my locks werenāt working. To make a long story short, the network key I got in step 1 didnāt match what I had in my secrets that I was configuring in yaml. I have no idea why. Once I updated the value in the preferences to my old value (and hit return to make it stick), then reinterviewed, everything started working.
Yes, but it involves excluding and re-adding them to the network.
Plus side is that the QR codes can be used to pre-enter the key for you.
So it seems some of my door and window sensors are remaining stuck in an unknown state. Under interview it says ProtocolInfo and just has a spinner. I have went around and opened each door and when that did not work I removed and reinserted the battery. Still nothing.
Further my lights/switches have no entities in HA. Any ideas here? I am seeing nothing useful in the logs at this time.
What do the zwave logs show?