TazUk
(Taz Uk)
March 6, 2021, 1:44pm
1
I’ve switched across to the zwavejs integration this morning in a relatively smooth fashion, however I’m struggling with the last piece of the puzzle.
I like to display z-wave network and device status on my dashboard which I did previously by reading the zwave.* entities.
Is there an equivalent way of retrieving this from the new integration someone can point me to?
I’m using zwavejsmqtt (with mqtt disabled) over websocket to homeassistant container (core running in docker).
1 Like
TazUk
(Taz Uk)
March 6, 2021, 6:26pm
2
I think what I’m after ideally is the same information as displayed against the integration details, namely a count of the total number of nodes and the number of ready nodes.
Looks like Node status is on the roadmap:
opened 02:55PM - 21 Jan 21 UTC
Roadmap for the Z-Wave JS integration.
Note: for a list of all that is already … supported see [here](https://www.home-assistant.io/integrations/zwave_js/).
# Open Tasks
## General
- [ ] Complete certification requirements [[Board](https://github.com/orgs/home-assistant/projects/11/views/3)]
## Maintenance
- [ ] https://github.com/home-assistant-libs/zwave-js-server-python/issues/590
- [ ] Refactor discovery so that discovery logic for each platform lives in each platform - use Matter as a reference
- [ ] Explore using `stateful` metadata parameter for value notification discovery in device triggers
## Platform support/features
- [ ] set date/time entity (when support for this entity type is added)
- [ ] add `is_opening` and `is_closing` support for covers [[PR](https://github.com/home-assistant/core/pull/90492)]
- [ ] Ensure that when secure inclusion fails, the reason is passed back to the user in the UI
- [ ] Handle inclusion initiated outside of HA
- [ ] Add a `lastSeen` sensor
## Service calls
None
## Z-Wave control panel (UI)
### WS API Ready, awaiting frontend changes
- [ ] Refresh Node (re-interview, refresh values, refresh CC values)
- [ ] Replace Failed Node
- [ ] Show node metadata on the device page (exclusion, inclusion, reset, wakeup, manual, device database URL)
- [ ] UI for managing node associations
- [ ] Add support for changing wakeup time to config panel (separate CC from normal configuration)
- [ ] add rfRegion to device info for controller node
### Lib ready, WS API support missing
- [ ] NVM backup and restore
- [ ] Let users view, add, delete, and update provisioning entries
- [ ] Node diagnostics (checking route health, testing power level, etc.)
- [ ] Record events and commands, see options (in either case we can have a stop button to stop recording because we can see whether recording is enabled or not):
- reload config entry after setting a parameter that tells the config entry to start recording when initializing the client during setup
- Update the parameter live, downside is we miss past events
- [ ] Controller hard reset
### Z-Wave JS ready, lib support missing
None
### zwave-js support missing
None
### Unclear yet on what's needed
- [ ] Some form of network health check, make it easier to point out dead nodes or nodes that are slow to respond or having communication failures.
- [ ] Network visualization of the mesh (like ZHA)
Note: Full configuration of the options are already available in the zwavejs2mqtt control panel.
## Other
- [ ] Better documentation! (this will likely never be checked off unless and until the zwave-js project stops maturing)
- [ ] Improve the Core config flow for add-on config options. Provide a list of USB devices to select device, and validate that security keys have the correct format.
# Finished
## Services
- [x] Set configuration parameter service.
- [X] Poll node/value service.
- [x] Bulk set partial configuration parameter service.
- [x] Multicast support
- [x] Reset meters
## UI
- [x] UI for updating node configuration settings
- [x] Adjust logging level of zwave-js server from UI
- [x] Subscribe to logs in the frontend
- [x] Node specific page
- [x] Log config update handling
- [x] Heal network
- [x] Show parameter number on node config page (most device manuals refer to parameter numbers instead of descriptions)
- [x] Heal node
- [x] Remove failed node
- [x] metadata comments (e.g. known issues with the device)
- [x] QR code (SmartStart) inclusion [[2021.12](https://github.com/home-assistant/core/pull/59037)]
- [x] Controller statistics [[2022.6](https://github.com/home-assistant/frontend/pull/12668)]
- [x] Node tx/rx statistics [[2022.7](https://github.com/home-assistant/frontend/pull/12794)]
- [x] Node Firmware Updates [[2022.7](https://github.com/home-assistant/frontend/pull/12910)]
- [x] Controller firmware updates [2023.3]
- [x] DSK only QR code support [2023.3]
## General
- [x] Add sensor for node status (awake/asleep/dead/etc)
- [x] SoundSwitch (siren) support [2021.8]
- [x] Support setting default tone and volume [2021.9]
- [x] Device conditions (config parameter state, any value state, node status) [2021.8]
- [x] Device triggers for value notifications, notifications, and node status [2021.8]
- [x] Protection Command Class (`select` entity) [[2021.9](https://github.com/home-assistant/core/pull/54717)]
- [x] Automation triggers (non-device) for any value update [[2021.9](https://github.com/home-assistant/core/pull/54897)]
- [x] Device triggers for any value update [[2021.9](https://github.com/home-assistant/core/pull/54958)]
- [x] Device actions [[2021.10](https://github.com/home-assistant/core/pull/53038)]
- [x] Migration wizard from (deprecated) `zwave` integration [[2021.10](https://github.com/home-assistant/core/pull/56159)]
- [x] S2 support [2021.10]
- [x] Automatic firmware updates [2022.9]
- [x] Manual idling buttons for notification CC values [[2023.5](https://github.com/home-assistant/core/pull/91446)]
- [x] perform optimistic state updates for multilevel switch entities [[2023.6](https://github.com/home-assistant/core/pull/90490)]
- [x] improve Indicator CC support [[2023.6](https://github.com/home-assistant/core/pull/90248)]
- [x] Controller and node statistics sensors [[2023.6](https://github.com/home-assistant/core/pull/91714)]
- [x] config parameter entities [[2023.6](https://github.com/home-assistant/core/pull/92223)]
- [x] Add support for window covering CC [[2023.6]]
- [x] add support for Energy Production CC [[2023.6]]
- [x] Add "identify" event handler to generate a persistent notification in HA
## Obsolete
- [ ] ~~Some sort of UI for configuring complex device settings, like notifications for Inovelli switches: https://nathanfiscus.github.io/inovelli-notification-calc/ or aeotec energy monitor reporting configs.~~ (solved by partial parameter service)
- [ ] ~Migration wizard from `ozw` integration~ (based on current analytics and the low usage of the `ozw` component, we feel a migration wizard is significantly more effort than its worth)
Some form of network health check, make it easier to point out dead nodes or nodes that are slow to respond or having communication failures.
In the meantime I guess there is currently no way to retrieve the node status:
So unless there is a stop gap method of either showing node status or simply integration status I’ll have to drop this element from my dashboard.
You can use curl to monitor Zwavejs2Mqtt as shown here . This will show you if the Z-Wave server is healthy.
Add the following binary sensor to you configuration.yaml, make sure the IP address matches your Zwavejs2Mqtt docker container.
binary_sensor:
- platform: command_line
command: 'curl 192.168.10.100:8091/health/zwave -H "Accept: text/plain" > nul && (echo "Ok") || (echo "Error")'
name: "Z-Wave JS Status"
device_class: connectivity
scan_interval: 30
payload_on: "Ok"
payload_off: "Error"
This will at least allow you to monitor the health of the Z-Wave JS Server.
4 Likes
TazUk
(Taz Uk)
May 30, 2021, 11:59am
4
That looks rather neat, thank you.
I wound up building a workaround template sensor that depends on having a group with all my zwave devices which I nearly added to this thread the other day.
#groups.yaml
zwave_devices:
name: "zwave Devices"
entities:
- switch.spare_room_lamp_switch
- switch.kitchen_lamp_switch
- sensor.spare_room_trisensor_sensor
- sensor.kitche_trisensor_sensor
- sensor.dining_room_trisensor_sensor
- switch.living_room_lamp_switch
- binary_sensor.garden_gate
- binary_sensor.doorbell_sensor
- switch.network_modem
#sensors.yaml
- platform: template
sensors:
summary_zwave:
friendly_name: "Zwave Overview"
value_template: >
{% if states('group.zwave_devices') not in ['unavailable', 'none', 'unknown'] %}
{% set total = (state_attr('group.zwave_devices','entity_id') | count) %}
{% set unavail = (states | selectattr('entity_id','in', state_attr('group.zwave_devices','entity_id')) | selectattr('state','eq','unavailable') | list | count) %}
{{ total - unavail }}/{{ total }}
{% else %}
Unknown
{% endif %}
icon_template: >
{% if states('group.zwave_devices') not in ['unavailable', 'none', 'unknown'] %}
{% set total = (state_attr('group.zwave_devices','entity_id') | count) %}
{% set unavail = (states | selectattr('entity_id','in', state_attr('group.zwave_devices','entity_id')) | selectattr('state','eq','unavailable') | list | count) %}
{% if unavail == 0 %}
mdi:z-wave
{% elif unvail == total %}
mdi:alert-circle-outline
{% else %}
mdi:cached
{% endif %}
{% else %}
mdi:alert-circle-outline
{% endif %}
1 Like
finity
August 9, 2021, 6:37am
5
Since the addition of the “node status” in the latest release I’ve updated my sensor to the following:
group:
zwavejs_devices:
name: "ZwaveJS Devices"
entities:
- sensor.computer_room_motion_node_status_js
- sensor.deck_camera_outlet_node_status_js
- sensor.doorbell_node_status_js
- sensor.east_livingroom_lights_node_status_js
- sensor.foyer_door_sensor_node_status_js
- sensor.west_livingroom_lights_node_status_js
- sensor.z_stick_gen5_usb_controller_node_status_js
sensor:
- platform: template
sensors:
summary_zwavejs:
friendly_name: "ZwaveJS Overview"
value_template: >
{% set total = (state_attr('group.zwavejs_devices','entity_id') | count) %}
{% set dead = expand('group.zwavejs_devices')|selectattr('state', 'eq', 'dead')|map(attribute='entity_id')|list|count %}
{{ total - dead }}/{{ total }}
icon_template: >
{% set total = (state_attr('group.zwavejs_devices','entity_id') | count) %}
{% set dead = expand('group.zwavejs_devices')|selectattr('state', 'eq', 'dead')|map(attribute='entity_id')|list|count %}
{% if dead == 0 %}
mdi:z-wave
{% elif dead == total %}
mdi:emoticon-dead-outline
{% else %}
mdi:alert-outline
{% endif %}
2 Likes
finity
August 13, 2021, 8:55pm
6
Actually…I just realized that there could be a couple more states that the devices could be in.
So here is the updated template:
sensor:
- platform: template
sensors:
summary_zwavejs:
friendly_name: "ZwaveJS Overview"
value_template: >
{% set total = (state_attr('group.zwavejs_devices','entity_id') | count) %}
{% set dead = expand('group.zwavejs_devices')|selectattr('state', 'in', 'dead, unavailable, unknown')|map(attribute='entity_id') | list | count %}
{{ total - dead }}/{{ total }}
icon_template: >
{% set total = (state_attr('group.zwavejs_devices','entity_id') | count) %}
{% set dead = expand('group.zwavejs_devices')|selectattr('state', 'in', 'dead, unavailable, unknown')|map(attribute='entity_id')|list|count %}
{% if dead == 0 %}
mdi:z-wave
{% elif dead == total %}
mdi:emoticon-dead-outline
{% else %}
mdi:alert-outline
{% endif %}
wvella
(Wvella)
September 13, 2021, 12:57pm
7
Thank-you! How did you manage to have the Z-Wave sensors appear as entities in Home Assistant?
In Home Assistant, I can see all my Z-Wave devices and for each device I can see the Node Status as Alive and Node Ready as Yes but I cannot see the sensors as entities when I search Current entities in Developer Tools .
Is there anything I need to configure in Z-WaveJS2MQTT (I’m running version 5.5.4)? The Home Assistant documentation indicates “…the node status sensor (disabled by default ) to track the node’s status” but I cannot find where to enable the node status sensor?
finity
September 13, 2021, 11:17pm
8
@wvella
If you go to the zwavejs integration page then click on the device.
on the left side at the bottom there will be something that says “+x disabled entities”.
click on it then click on the entity that is disabled and click the “enable entity” switch in the box that pops up.
1 Like
wvella
(Wvella)
September 14, 2021, 9:49am
9
Amazing! Thank-you that worked
1 Like
One way to do it without having to list each device, though you DO need to manually enable the node_status entity in the integration config: make a template sensor that looks for entities with the name *node_status*
in state dead/unavailable/unknown.
- platform: template
sensors:
failed_zwave:
value_template: >
{{ states | selectattr("entity_id", "search", "node_status") |
selectattr('state', 'in', 'dead, unavailable, unknown') |
map(attribute='entity_id') | list }}
Then do what you want when this sensor isn’t an empty list, example:
- alias: "Alert on failed Zwave Nodes"
trigger:
platform: state
entity_id: sensor.failed_zwave
condition:
condition: template
value_template: '{{ states.sensor.failed_zwave.state != "[]" }}'
action:
- service: notify.email
data_template:
title: "ZWave node failed"
message: "{{ states.sensor.failed_zwave.state }}"
4 Likes
I tried adding your template sensor but I get this error in the log trying load it:
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.failed_zwave. State max length is 255 characters.
Well, I was testing with including ‘asleep’ sensors (since I don’t have any dead/unknown ones right now) and I think that’s why it was producing the error. Too many entities returned that maxed out that 255 character limit I guess.
Hello,
I’m trying to understand and spent a lot of time with my friend google but I did’nt manage to do it
Here is what I have add in my configuration.yaml
binary_sensor:
- platform: command_line
command: 'curl 192.168.1.33:8091/health/zwave -H "Accept: text/plain" > nul && (echo "Ok") || (echo "Error")'
name: "Z-Wave JS Status"
device_class: connectivity
scan_interval: 30
payload_on: "Ok"
payload_off: "Error"
But it’s always reported as disconnected
To be honnest I don’t uderstand the command with curl
So I try and test to better understand but I guess I missed some point .
I tryed the curl command in a terminal
But without success.
I must admit I 'm not sure about the port but I don’t know how to check it …
Can someone help me or redirect me to some usefull information ?
guixop
(Gui Xop)
November 18, 2021, 1:10pm
14
Thanks, it seems to work well for me by simulating the state
it would be great to have this feature with #zigbee2mqtt
finity
November 20, 2021, 2:48pm
15
Just to add a bit more info here…
I just noticed a “new” file in my config directory and traced it back to the command_line binary sensor above. Apparently the “> nul…” portion tells it to create a file named nul and put the results into it (Ok or Error).
I found that part isn’t needed for the sensor to function (at least I’m pretty sure since it still seems to be working).
I changed it to this:
command: 'curl 192.168.1.11:8091/health/zwave -H "Accept: text/plain" '
And that matches the syntax of the example in the linked zwavejs docs as well.
no more mystery file.
Hi all,
I come back to you because I progress a little bit but desperately need some help for some “basic” stuff like docker an HA supervised.
My config look like this (I have also tried without the “>null” and with the ip of HA instead of localhost
binary_sensor:
- platform: command_line
command: 'curl 127.0.0.1:44920/health/zwave -H "Accept: text/plain" > nul && (echo "Ok") || (echo "Error")'
name: "Z-Wave JS Status"
device_class: connectivity
scan_interval: 30
payload_on: "Ok"
payload_off: "Error"
The entity is created but is 'disconnected"
One thing I did change is the port number from 8091 to 44920.
This is actually what I have found in the log of the supervised add-on
I also manage to use the curl command.
The curl command was not working from the ‘Terminal SSH’ add on
But is working if I launch it from the container console within Portainer
So I guess I missed some basic knowledge regarding ha supervised and docker
Actually I don’t know how to start to upskill myslef regarding this with a (not too long) tuto from A to Z
Or maybe there is just a little trick where you can help me
Hi and thanks for perfect templates! How do I make an automation that automatically pings the dead nodes that is in the “sensor-list”? I know how to use the zwave_js.ping service, but I don’t know how to reference a list instead of a single node.
How do you add name to the template list?