Have you defined a group in yaml before?
Basically, yaml is identical everywhere. Defining listed items does not change from one field to another. It’s all the same. I’m trying to see how much yaml you know.
service: zwave_js.refresh_value
data:
entity_id:
- sensor.kitchen_powernode_fridge_energy
- sensor.kitchen_powernode_dishwasher_energy
or you could separate them with a comma as well
service: zwave_js.refresh_value
data:
entity_id: sensor.kitchen_powernode_fridge_energy, sensor.kitchen_powernode_dishwasher_energy
But I find the "-’ list easier to read tho.
Hi Petro,
yes I have and you also helped me with creating groups based on key words in the entity name.
Are you suggesting I can use that same technique and create another group of zwave energy entities and call the service against that group?
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.