Is polling possible?

New HA install here. I have 40+ devices. Some old, some new. The new devices such as a Zooz72 dimmer reflect state nicely in HA when I turn them on/off at the switch. Old devices such ad enbrighten Jasco dimmers only update their state in HA when I turn them on, but not off.

Is there a solution for this? I’ve been searching about possibly configuring HA to poll these other devices but the articles I’ve been reading suggest maybe it’s not possible with Zwave JS? Of course those articles are somewhat old.

So thought I’d ask here if there is a solution for this kind of problem…?

Thx!

does this force an update on those devices?

  service: homeassistant.update_entity
  target:
    entity_id: <your entity here>

put it in dev-tools → service
and see if it does anything…

I had an old Jasco dimmer that would not report its current state in HA when turned on or off, so I ended up querying immediately afterwards in any automation, and that would cause it to report correctly in HA. So I think that means that it did support polling?

I was using Node Red to do it - the Current State Node specifically. It would not report correctly in HA if it was turned on or off manually at the switch, only when I queried its current state after my automation toggled it. You could query it on a repeating schedule to get its status when turned on manually, but in my case I didn’t need to as I only switched it via automation (via motion sensor). I’m guessing that the service armedad referenced will work and is doing the same as the Current State in Node Red.

something like this? I’ve never been in this menu so quite likely could be doing something wrong. But it complains about the YAML.

you have the indents wrong…
somehow when you copied from mine (i think i have the indents right) you added a space. take a look at my original post again

or better yet, switch that to ui mode… and do it via the ui… then switch to yaml mode if you want the proper yaml

Thank you…

I was able to press the call service button and got a green check mark. I don’t think it did anything though? The switch still shows as on in the HA UI even though I turned it off manually before hitting the call service button. That is, if the idea is that should’ve updated the state of that device.

image

yes, that call is supposed to cause the entity to refresh it’s data… docs here:

if that didn’t update it’s info, i dunno how to do it via code in another way :frowning:

Hmm well thanks for your help regardless. That’s unfortunate.

It seems like there must be a way. How do so many HA users put up with not having the current state of their older devices?

With Homeseer (where I come form) you could click the device, then manage it’s z-wave, and there was a polling setting that was normally set to 0. I would change it to something like 5 for ever 5 seconds and it’d update it’d update it’s state accordingly. It worked great. It seems like something similar with HA should exist.

From the docs:

Some legacy devices don’t report all of their values automatically and require polling to automatically update their values. Some platforms poll such devices automatically whether you need them polled or not. Because such polling can have detrimental effects on your mesh network, Z-Wave JS does not poll devices by default. Polling can quickly lead to network congestion and should be used very sparingly and only where necessary.

Z-Wave JS UI allows you to configure scheduled polling on a per-value basis, which you can use to keep only the values that you need updated. It also allows you to poll individual values on-demand from your automations, which should be preferred over blindly polling all of the time, if possible.

1 Like

I think I found the solution. You were very close with your suggestion. chatgpt to the rescue…

Rather then using the “Home Assistant Core Integration: Update entity” service call, you use “Z-Wave: Refresh values”

Per chatgpt:

When I tried this using the developer tools, it updated my device perfectly. Now I just need to create an automation to trigger it periodically. Note that this relates to my using Z-Wave JS.

1 Like

I’d like to take this a step further…

Rather then listing every device that needs polling, can I just assign a label “polling_needed” to the older devices that need to be polled periodically, then create an automation that only actions on those?

I’m struggling to get this to work. Note that the entity has the label assigned to it. I did not assign the label to the device itself.

I was hoping to do something like this but it does not seem to work. I’ve been googling around trying to figure out how to apply an action on only the devices/entities with a particular label and am struggling…

Anyone know how to do this?

alias: Poll Old Devices Every 5 Seconds
description: Any devices with the polling_needed label will be polled every 5 seconds
trigger:
  - platform: time_pattern
    seconds: /5
condition: []
action:
  - service: zwave_js.refresh_value
    target:
      label_id: polling_needed
    data:
      refresh_all_values: false
mode: single

Ah interesting! Thank you for sharing that. I don’t know why it didn’t occur to me to read through the Zwave JS documentation.

In order to enable polling of specific values you need to go to the Settings page, expand the General section and add a new value to the Device values configuration table.

I’m confused by the docs though. It talks about going to the setting page and expanding the general section. I see no general section. Whether I go to setting in HA, or poke around Z-wave JS configuration.

I do see this under system options which I thought was interesting that it was turned on.

i don’t use zwave, so i’m not able to test to verify, but if you got the single refresh_value to work, the doc says entity_id takes a list, so perhaps try… but of course only after you enable polling on the devices…:

alias: Poll Old Devices Every 5 Seconds
description: Any devices with the polling_needed label will be polled every 5 seconds
trigger:
  - platform: time_pattern
    seconds: /5
condition: []
action:
  - service: zwave_js.refresh_value
    target:
      entity_id: "{{ label_entities('polling_needed') }}"
    data:
      refresh_all_values: false
mode: single
1 Like

Bingo! This worked. I am also able to add the label to other old legacy devices and their state is being updated properly.

Now I just need to decide whether every 5 seconds is too much traffic. It didn’t seem like much in a world where things happen in milliseconds but I’m new and have no direct experience with how often one should do this for 10 or 20 devices. I guess I’ll try it and just see how it goes…

I’ve also realized that the suggestion early about the general tab relates to the Z-wave JS UI addon which I am not running. I am running the default Z-wave JS addon instead. Initially I thought the UI addon just gives you a UI and is installed on top of the Z-wave JS addon however I see now with some reading that that is not correct. That if I want that UI capability, I need to migrate from the one to the other.

I think for now I’ll forgo that since this solution is working quite nicely and I don’t yet have a need for the UI.

Thank you again for your help! This allows me to easily label any device that needs polling and it is working as I’d hoped.