EDIT: The below info is only relevant if by ‘new pc’ you mean ‘I bought a new pc to replace the old one’. If you’re using HASS.Agent on two pc’s now, you need to give the sensors unique names.
For instance; pc_one_samsung_printer and pc_two_samsung_printer.
That’s why the names HASS.Agent auto-generates for you, contain the device’s name.
Note that you can change that name in the Configuration window.
Let’s remove your device to start with a clean slate (don’t worry, your automations/scripts will keep working).
Could you please try the following:
Close HASS.Agent
Go to your Home Assistant instance
Press c to launch the search bar
Search for devices and press enter
Search for your device and open it
On this page, make sure under Device info it says by LAB02 Research, and there’s a MQTT INFO. This way you know for sure it’s the right device:
Afterwards, press DELETE DEVICE:
Click OK to confirm. You’ll now get this message:
For completeness-sake, please restart your Home Assistant instance. When the restart’s completed, you can also restart HASS.Agent. Your device will now be re-registered, and all entities should be good to go.
If not, please let me know and we’ll debug further!
I did mean that I setup HASS Agent on another PC, but the MQTT info was the same as the old PC.
So fixing the names of the local sensors on the new PC and deleting the device fixed the issue.
The Windows10 printer driver behaves differently than the old Win7 PC that I tested it on so I will have to play with my automatons as the NamedWindow I was using does not seem to exist on Win10.
Hi, love the plugin, been waiting for something like this for awhile. I’m trying to use one of these sensors as an occupancy sensor for a room with a desktop computer. I’ve enabled the lastactive sensor but I’ve noticed that it will 100% always fire the active response, even if my computer is idle and the display is asleep. I’m assuming the culprit is some program I’m running in the background. Is this sensor supposed to only listen for input devices to determine active? If so, I do use a virtual mouse remapper tool, and I’m wondering if it is conflicting with this sensor.
Alternatively, are there any other sensors available or that could be made available that could also get at whether or not a person is using a computer, for the purposes of occupancy detection for light/fan control? Thanks!
Great work on this. I’ve come across from IoTLink which worked great, but seems to be abondoned, and I’d always have the service stop reporting, so I’d have to manually stop and restart it to get it working again.
I am having 1 issue though, and I don’t know if it’s related to HASS.Agent, or something else, but is only happening with HASS.Agent.
I make use of the Hibernate command to put power down my PC of a night. Since moving to HASS.Agent, everytime I wake my PC, it will crash resulting in me having to hard power cycle the PC, which is annoying.
I don’t know what’s different about HASS.Agent, but I would assume it uses the shutdown /h command like one normally would from the Command Prompt.
I think IoTLink did something different, as it’s Hibernate command would allow the PC to wake really really fast rather than the normal way where you see a bit of the Bios and the Windows splash screen with the spinner (which is where it crashes).
UPDATE: So, upon further investigation, it seems that hibernate seems to mess up my PC a bit. Not sure why. IoTLink would put my PC to sleep rather than hibernate for some odd reason, but when using HASS.Agent, it would properly put my PC into hibernate, which has highlighted the issue with my PC.
For now, I’ve disabled hibernate (as I don’t use it) using powercfg -h off and things are working how I like again, and using the Sleep command in HASS.Agent works how it should.
Sorry for the late reply - very busy weeks work-wise. For starters; thanks to you both for the kind words! It’s always nice and motivating to hear
@chadbaum: The value that I use is something that’s provided by Windows itself, so not something I determine - but I’m pretty sure it’s based on keyboard and mouse activity. It’s the same value used to determine when to trigger the screensaver. You can start by disabling applications one by one, and see what comes up. I’ll think about alternative methods, maybe create seperate lastkeyboardevent and lastmouseevent sensors so you can decide for yourself which to use.
@cjsimmons: Glad to hear you fixed it! Hibernation/sleep can be a mess …
@SamKr, thanks for the reply. In the intervening time I’m happy to report I think the sensor is working as expected now. All I did was reboot my computer.
Hi all! Great windows agent! I had been using IOTLink until now and was happy but I never really felt that it was precisely what I was looking for. Specially I was looking for a tool that allows me to play a windows local wav file triggered from HA. I’ve install the HACS media player addon, but it is giving me an error on start:
“2022-05-23 21:23:10 ERROR (MainThread) [homeassistant.components.media_player] hass_agent_mediaplayer: Error on device update!
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 431, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 736, in async_device_update
await task
File “/usr/local/lib/python3.9/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/hass_agent_mediaplayer/media_player.py”, line 119, in update
self._volumeLevel = int(response.text)
ValueError: invalid literal for int() with base 10: ‘Method Not Implemented: Get /media’”
Any idea what could be the problem?
And a wish: one of the things I liked about IOTLink is the automatic screenshot capabilitiy (good to keep an eye on what the kids are doing… ). I can imagine you could implement that with commands in HASS agent, but I am not sure if there is a good screenshot tool that operates from CLI and could be triggered from HASS Agent?
Again, thanks for the awesome work! Installation worked like a charm!