uvjim / linksys_velop

Home Assistant integration for the Linksys Velop
MIT License
50 stars 7 forks source link

Help: Template for detecting online device #351

Closed mschingel closed 1 year ago

mschingel commented 1 year ago

Use Case: Create an automation that alerts me when the Drive Way Camera is detected on the Correct Node being the Garage Node. When it is Not I will then restart it via a smart Plug.

image

{{ is_state_attr('sensor.garage_velop_connected_devices',Name,Value) }}

Would the proper way to make this work be:

{{ is_state_attr('sensor.garage_velop_connected_devices','Garage-Drive-Way-Camera',True) }} # This didnt work for me.

Name: being the Garage Drive Way Camera

Edit (uvjim): I've split the possible issue into another issue so that the two can be handled separately

uvjim commented 1 year ago

Try the following, changing the details as necessary.

{{ "Driveway - Camera" in (state_attr("sensor.velop_utility_connected_devices", "devices") | map(attribute="name")) }}
uvjim commented 1 year ago

See #352 for the issue that's been split out

uvjim commented 1 year ago

352 is now resolved

mschingel commented 1 year ago

Try the following, changing the details as necessary.

{{ "Driveway - Camera" in (state_attr("sensor.velop_utility_connected_devices", "devices") | map(attribute="name")) }}

That worked. But I’m noticing every hour it somehow find the device on the wrong node. Think this has to do with Velop and nothing ca be done here.

I’m considering switching my nodes to full bridge mode. Will the device card continue to show devices and names? I’m trying to get a more reliable network and figured I would try it but live these cards. I know parental controls and advance features will not work in bridge mode. But I hope it picks up the name and my samba drive works.

uvjim commented 1 year ago

Has the device actually moved nodes? If so, does it believe it has a better connection?

You could try looking at this, I've never needed to play with these settings myself.

https://www.linksys.com/support-article?articleNum=316222

RE: what's missing in bridge mode... https://www.linksys.com/gb/support-article/?articleNum=243551#sf6

From what I've read in the forum post on HA for people using the integration, some are in bridge mode, so it seemingly works but I'm not sure if they're using the example cards or not.

uvjim commented 1 year ago

Oh, and the backhaul section of the example cards will break in the next release (as in, not be shown) because the sensor and attributes have all been split into their own sensors.

mschingel commented 1 year ago

Okay good to know on the backhaul.

The device is connected to a child node but every hour I will get a notification it’s on the primary node when it’s not.

Once I get the notification I immediacy check and it’s not on the primary node. I may need to somehow link it to a sensor and do a count grater than 2 within an hr.

uvjim commented 1 year ago

I have devices that occasionally move around the nodes. They don't seem to have problems with it. Sometimes connections are weaker than others but they eventually move back again.

That template would check if the device name is connected on the given node. I'm assuming that you would want the automation to trigger if it isn't connected to the node - you may have already tweaked it to do that.

There's a number of reasons it could move nodes. Assuming that the camera doesn't support steering it could be because: -

This definitely doesn't sound like something that the integration can resolve but I guess if the automation is correctly determining that the camera is disconnecting from the node, then you could link it to something like a counter helper to track how many times it's disconnected and then react to that.

Shall I close this off for now?

mschingel commented 1 year ago

Yea, it can be closed but.

I upgraded the Velop FW's and did a Factory Reset to 3 Nodes. Reset them up and only 2 of the nodes show in the card. But all 3 are discovered in HA. Any idea why that is?

uvjim commented 1 year ago

IIRC the filter for that card looks for binary_sensors that have an entity_id that ends in _status and has a guest_network attribute that is either true or false; but isn't the mesh one.

I have seen this mean a node isn't shown until it comes fully online and meets those criteria.

There's a better set of filters that can be used but I haven't updated those cards for a while, and auto-entities didn't have the features when I did the last updates.

uvjim commented 1 year ago

If you want to make the filter slightly better for getting the nodes on the card you could try this...

filter:
  exclude:
     - entity_id: /\.mesh_/
  include:
     - integration: linksys_velop
       domain: binary_sensor
       entity_id: /_status$/
       attributes:
         device_class: connectivity

You may need to change the exclude to line up with the entity_id format that your mesh entities use.

mschingel commented 1 year ago

Dont think i had to change the entity id field.

image

Here you can see the Garage Node, the sensors seem to work.

image

I I rolled back the firmware and Im just going to re-do the entire mesh and maybe make this problem node the primary and see if that makes a difference. I delete just the node itself under the devices and it just pops back but never in the cards.

--Updated, Swapping the Routers from Child to Parent Worked. I think its a HA bug.