sleevezipper / hass-workstation-service

Provide useful sensors and services from your workstation to Home Assistant.
Apache License 2.0
613 stars 54 forks source link

Feature Request: IP Address #62

Open pqpxo opened 3 years ago

pqpxo commented 3 years ago

Hi there,

Would it be possible to include a sensor to display the IP Address of the Windows host?

I've tried using the WMIQuery however nothing I've tried has worked

Many thanks

sleevezipper commented 3 years ago

Good idea! Thanks!

raviwarrier commented 3 years ago

In addition to that, could we also have the SSID sensor? I would like to be able to do a few things based on which SSID the laptop is connected to - for example, turn off AdGuard when connected one SSID, but turn it on when connected to another.

Also, with regards to IP Address, could we have both Wifi IP (192.X.X.X) and Public IP?

SecretiveShell commented 2 years ago

I just looked into this and encountered 1 major problem. If the host has multiple NICs than it would be difficult to determine what IP to return.

It seems better to get the IP of a specific NIC than of the host in order to resolve any possible inconsistencies.

Also there are many guides on getting IP addresses in BGinfo so they might help as a workaround.

raviwarrier commented 2 years ago

I might sound stupid, but is BGInfo a tool/app? Thanks for replying though.

SecretiveShell commented 2 years ago

BGinfo is a tool that you can use to get sys info. It is designed for admins to display system info like MAC addresses and hostnames on the desktop. Because it supports WMI there are many tutorials that may work for HWS, like this one. https://superuser.com/a/1592568

raviwarrier commented 2 years ago

That's helpful. Thanks mate! Have a good evening and stay safe!

pqpxo commented 2 years ago

BGinfo is a tool that you can use to get sys info. It is designed for admins to display system info like MAC addresses and hostnames on the desktop. Because it supports WMI there are many tutorials that may work for HWS, like this one. https://superuser.com/a/1592568

I've tried a few things mentioned in that URL but still unable to return an IP address.