Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data incorrect when the device is disconnected. #40

Open
n00bcodr opened this issue Feb 27, 2022 · 5 comments
Open

Data incorrect when the device is disconnected. #40

n00bcodr opened this issue Feb 27, 2022 · 5 comments

Comments

@n00bcodr
Copy link

Here, the device is disconnected, the connection_type is wired?
The deco_device is null, which is correct. (could it be not_connected?)

image

and here, the device is also disconnected, but the connection_type is band5.

image

So, probably the connection_type needs to be cleared if the device is not connected?

@amosyuen
Copy link
Owner

amosyuen commented Feb 27, 2022

Hmm, you are correct that the value could be considered inaccurate since there's no actual connection, but I think there is some value in showing the last value. For example:

  • You can determine which clients are wired, 2.4G or 5G connected even if they are offline. This can sometimes be useful for identifying mystery devices whose name is not clear.

You could also argue that ip_address is inaccurate, since when a device is not connected, it doesn't actually have an IP address. But it can be useful to know the last assigned IP.

I lean towards keeping the lat values rather than showing null, but interested in hearing what others think. Is this particularly causing you problems? How difficult is it for you to work around it by doing a condition on whether the device is present?

@n00bcodr
Copy link
Author

For ip_address, there is a chance that it might get assigned the same IP if that IP address is reserved.

But there is no guarantee that the device would be connected to the same band when reconnected. (unless they are ESP based smart devices, which only connect to 2.4. Whole other discussion :D )

I agree having the last value is sometimes useful, but it kind of does not add any value in having the last connected band?

May be last connected Deco, yes. Last connected IP, probably?

PS: Totally unrelated, for the first image, it is a phone, and I haven't connected it using Ethernet, not sure why it says wired?

@amosyuen
Copy link
Owner

Agree that band is less guranteed, though I think it's actually fairly likely that stationary devices reconnect on the same band (e.g. TV, xbox, or computers).

Also wired value can be useful and since the band is set in the same connection_type property, it think it's simpler to treat it the same.

PS: Totally unrelated, for the first image, it is a phone, and I haven't connected it using Ethernet, not sure why it says wired?

That's interesting about the phone showing wired incorrectly for the connection_type. I'm unable to repro when turning my phone on and off.

@n00bcodr
Copy link
Author

Agree that band is less guranteed, though I think it's actually fairly likely that stationary devices reconnect on the same band (e.g. TV, xbox, or computers).

But in fairness, people might not use this feature to track stationary devices? 😃

Is this particularly causing you problems? How difficult is it for you to work around it by doing a condition on whether the device is present?

I wouldn't say difficult, but it is kind of inconsistent, don't you think?
I am using a template in Markdown to give me details about a bunch of phones, which floor of the house they are in.

{{ states.device_tracker.galaxy_s8.attributes.deco_device | replace("living_room"," Living Room") }} - {{ states.device_tracker.galaxy_s8.attributes.connection_type | replace("band","") | replace("5","5 GHz")| replace("2_4","2.4 GHz") }}

If the device is disconnected, it shows the deco connected as "none" which is okay. but still shows the band it is connected to.
image

I would just have to write a condition

{% if is_state('device_tracker.galaxy_s8', 'home') %} {{states.device_tracker.galaxy_s8.attributes.deco_device | replace("living_room"," Living Room") }} - {{ states.device_tracker.galaxy_s8.attributes.connection_type | replace("band","") | replace("5","5 GHz")| replace("2_4","2.4 GHz")}} {% else %} Not Connected {% endif %}

@saaubry
Copy link

saaubry commented Jul 21, 2022

Hello
I'm reopening this discussion.
From my point of view if a device is offline it should not be attached to a router.
the attribute deco_device should be null.
I saw your earlier discussion and I understand why to keep a kind of memory about the device.

In my case I'm trying to recreate a map of device with conditional card (The Entity Filter card).
I need two filters
1/ online or offline
2/ which deco device

The Entity Filter card can't combine two filters with an AND but only with a OR.
In conclusion I need an attribute that can show these two states in one attribute (null, deco1, deco2, deco3 ...)

Thank for reading
Have nice day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants