Git Product home page Git Product logo

hass.agent's People

Contributors

justin991q avatar lab02-admin avatar nicolouis-be avatar nsleigh avatar stefterv avatar syntoxr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hass.agent's Issues

Translation: Brazilian Portuguese.

Hello, I would like to translate HASS.Agent into Brazilian Portuguese, do you have any projects in lokalise or in POEditor?
If you have a project, what is the link to it? Thanks.

Availability doesn't change on shutdown

Hi,

Love your work, Sensor updates are OK now.
I use the Agent on my PC that is connected with my wifi.

When I use the shutdown command the PC shuts down. :P
but the "homeassistant/sensor//availability" doesn't change from online to offline.
It would be nice if I can use the availability as status for On or Off.

I know there are other ways to accomplish this. but I realy love the usage of MQTT

Bug: LastActive sensor not working anymore

Hi,

I'm having issues with the last active sensor.
In my HA I see it was stuck to a date from 2 weeks ago.
When I modify the name, or delete and readd it, the state in HA stays 'unknown'.
I'm on the latest agent version 2022.3.27.0.

I'm seeing this error in the logs:
2022-04-14 08:44:36.515 +02:00 [FTL] [SENSOR] [hass_agent_laptop_lastactive] Error publishing state: Value was either too large or too small for an Int32.

Bug: "failed to connect" triggers too fast after waking up

Shortly after my PCs/laptops are waking up from sleep the HASS.Agent complains once about not being able to connect to the MQTT broker faster than Windows is reconnecting to the network again:

image

This always happens when waking up, on multiple different devices.

Perhaps allow for some more retries (always or just during x secons window after waking up) before raising the "failed to connect" error?

Feature: pass custom data to commands

Hi,

I'm wondering if it's possible to pass data to commands ?

My goal is to implement TTS using powershell. I would trigger the command from HA and pass the text as data of the command.

But I need a way to get said text in my Powershell script to handle the TTS part.

Is it possible at the moment ? I couldn't find it in the documentation. I know that notifications can accept additional data.

Thanks again for the great tool !

Features: support certificates, low-integrity commands

Hello! Great project and has quite the feature scope. I ended up going a different route but a few suggestions to consider:

  • You start the Notifications local server no matter if the user wants to listen to notifications or not. You also listen on all ips. It would be a better security practice to only start the server if they enable it (especially as you require restarts for config changes generally). I would also recommend offering the user to specifiy what IP to bind to. A quick toggle on the entire server initialization like:
                if (Variables.AppSettings.NotificationsEnabled)
                    Task.Run(NotifierManager.Initialize);

could work, although the status page probably should be updated to show something other than loading then.

  • There is an alternative to the push to client method with the web socket api home assistant has for events. It has the benefit of working for dynamic clients that have IP's that change or are behind firewalls that cannot be modified. I am guessing this is known, and what exist works, so it may not be worthwhile.
  • The app requires running as administrator, but I am not quite sure why. The only code reference I see is for the notifications local server but you should be able to do this as a standard user. I figured maybe one of your sensor pulls but briefly looking at them I didn't see which. You may want to give the user the option if it is required for something. Given the fact it can run local commands, and runs a local server running as administrator further exposes the potential attack surface. It seems the functionality I tested had no issue running as a normal user.
  • If you wanted to support client certificates this is possible (both native and user specified) see qJake/HADotNet#24 (comment)

UI: change 'store configuration' caption

Minor request: I see the "close without saving" button at the bottom of the configuration window. So where is the save button? I'm guessing it's "store configuration" If so, my request is to change that to "save configuration"

Feature: broadcast to all HASS.Agent clients in a /24 subnet

Firstly, what a great little app, thankyou - this should be an integral part of Home Assistant...!

My wishlist would be a single command to "Notify all PC's", so don't have to manually repeat everything.
Ideally with a Broadcast sent to the /24 subnet, so then most users don't need to have fixed IP address and edit the configuration.

And then even better, enchanced with a "Notify Everything" command - PC's, iPhones, Android, Browser Mods, Remote Users, etc etc - all at one go! (I appreciate that is really a much-needed Core issue not yours...!)

Can't store LockPC command

Thanks for creating such an awesome application!

I have tried repeatedly to add the "LockCommand". Each time it appears to create, but when "Store and activate commands" and then go back in to the Commands section, it is empty. I did check on HA for the entity and it did not appear either.

Bug: 'execute port reservation' doesn't run under expected elevation

Attempts to create firewall rule for notifications fails during install and normal application launch. Only way to get successful reservation is to start agent as administrator.

2022-04-17 11:56:57.156 +12:00 [INF] [NOTIFIER] Executing port reservation for port: 5115
2022-04-17 11:56:57.258 +12:00 [WRN] [PROCESS] Execution returned non-ok exitcode (exitcode: 1): netsh
2022-04-17 11:56:57.258 +12:00 [INF] [NOTIFIER] Port reservation already exists, nothing to do
2022-04-17 11:56:57.259 +12:00 [INF] [PORTRESERVATION] Port reservation completed
2022-04-17 11:56:57.354 +12:00 [WRN] [PROCESS] Execution returned non-ok exitcode (exitcode: 1): netsh
2022-04-17 11:56:57.428 +12:00 [WRN] [PROCESS] Execution returned non-ok exitcode (exitcode: 1): netsh
2022-04-17 11:56:57.456 +12:00 [ERR] [FIREWALL] Error creating firewall rule, console output:
{
  "Error": true,
  "ExitCode": 1,
  "Output": "The requested operation requires elevation (Run as administrator).\r\n",
  "ErrorOutput": ""
}
2022-04-17 11:56:57.456 +12:00 [ERR] [PORTRESERVATION] Unable to create firewall rule, notifier api might not receive connections
h

Take note, this is after an uninstall and install of the beta version, so I suspect that's why the logs state "port reservation already exists".

Anyway, I read on another issue you prefer to keep the agent in non-elevated privileges for security reasons. Would it be possible to request the OS temporary elevate privileges for the firewall editing operation? I ask cause I have no idea how that process works, and seems like the preferred solution. That way when a the installer or agent begins the firewall reservation process the user will get the UAC prompt for the action, and if they say no, some feedback can show of insufficient privileges.

I had a quick look at how 1 might do it and yeah... not pretty, doesn't seem like a very clean way to do it other than using something like Powershell Start netsh -Verb Runas. Where your relying on the PC to have PS active, which IDK if is a guarantee.

Webcam usage sensor with "windows hello" feature

I have a Logitech BRIO and it supports Windows Hello. I am using the webcam in use sensor to show whether I am in a meeting or not. However, when I lock my pc, the webcam enables windows hello so it can be unlocked automatically.

However, the sensor then thinks that the webcam is in use. Is there a different way to detect whether the camera is being used?

Feature: Quick Actions based on domain and get variables send from HA

Hello Sam,

I hope you are doing well. Thank you very much for your time spending on this wonderful project.
Was wondering if is possible to have a dynamically change action menu in quick actions, based on the domain of the entity so to have any possible action taken (i.e. volume_up if media_player domain is choosed).

Also as I mentioned in #34 (comment) this option would open a whole new world of possibilities for everyone.

Thank you again and enjoy your coffee :)

Sensor update interval not working

Hi,

sensor update interval is not working.
tried: 15 sec and 60 sec for volume.
GPU usage is by default at 300 sec.
but al sensors announce every second.

Hotkeys for each action?

Just a suggestion, I'm using another utility from github for this now, but it would be cool if it were in your app as well.

Now it's possible to open window with the launch of scripts and automation using hotkeys, . But it would be very cool if the application had the ability to set hotkeys for each automation and script that will immediately launch them.

"unable to connect, check uri and config" when using https

Attempting to setup the Agent for the first time and I get unable to connect, check uri and config.
image

I have verified the url and long-lived token via this test. Both were copied from their original source and pasted into the HASS.Agent installer so unlikely to be a entry error.

$ curl --insecure -I -X GET https://192.168.1.105:8123/api/ -H 'Authorization: Bearer <long-lived-token>'
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 27
Date: Sun, 06 Mar 2022 21:03:50 GMT
Server: Python/3.9 aiohttp/3.8.1 

Note that without the --insecure flag I get the follow error

$ curl -X GET https://192.168.1.105:8123/api/error/all -H 'Authorization: Bearer <long-lived-token>’
curl: (60) SSL: no alternative certificate subject name matches target host name '192.168.1.105'
More details here: https://curl.haxx.se/docs/sslcerts.html

Thus, I believe this may be due to having a self signed certificate when connecting over https?

When hitting my instance locally (i.e. https://192.168.1.105:8123 I have to confirm I want to proceed due to the invalid cert and know this can cause problems elsewhere with other integrations.
image

I think HASS.Agent installer may be failing for this reason. Not sure if the installer saves more detailed logs anywhere that I can check.

It's broken, and marked as a virus(

Hey, thanks for adding keyboard shortcuts, but I haven't been able to test them yet. Already when downloading, my browser detected a threat in the archive, so I downloaded the new version through another browser, but when unpacking Windows Defender detected a Trojan:Win32/Sabsik.TE.A!ml in HASS.Agent.exe so I uploaded both the archive and only one the exe file on Virustotal, and nothing was found there. So I decided to add this to the exception, but the app just won't start. Windows Defender doesn't have any complaints at all anymore, but even after restarting PC, when I try to launch the app, nothing happens :c

Bug: quickaction-bound hotkeys not working

Hey there! First of all I would like to say thanky soooo much! This little program is just a dream! :)
But unfortunately I'm unable to get the quick actions hotkeys working.
On the other hand the shortcut for opening the quick action gui is working fine.

Please respond to this issue if you need any additional information.

Feature: seperate service for specified commands/sensors

Hi,

I have a computer that is used by more then one person.
the startup is a scheduled task at login. it would be nice if the program can run as a service.

I think the sensors as service is enough. so the administrator can setup the sensors.
the users should be able to setup the commands.

in my case the config part could be shared between users. I made a new user for every computer and used that access token.
but maybe someone else prefers it other.

Allow MQTT clientId to be set in config

Hy,

I use VerneMQ as my mqtt broker and this broker (and alos the MQTT 5 specs as i understand) require every client to have a static and unique cleintId for authentication. As i reviewed the code i found out that the code generates a random Id every connection attemp. Colud you make this possible to configure it in the UI, and if its not set generate a random one?

Enhancement: grouping point in port field

This is just a very small thing.
A grouping point gets displayed in port fields when onboarding and in the Notifications tab. It's just a cosmetic thing but may be a bit confusing, especially when talking about IP-addresses:
image

How to get enrolled in BPost My Mil

Hello,
looks like a nice extension for Home Assistant. But just wondering how to be able to participate in this My Mail program from BPost? Been searching in the Bpost mobile app and in "My preferences" on the Bpost website but can't seem to find a way to enrol in that program.

Feature: sync sensor state with HA api's current value

When I wake up my laptop from Sleep, the SessionState sensor goes from Unavailable to Locked, but doesn't seem to then update to Unlocked.

I can manually force it to update by locking the screen and unlocking again.

As it is mentioned in the credits for this project,I will go and mention that the exact same issue happens for the HassWorkstation Service app ( sleevezipper/hass-workstation-service#172 ), so I am wondering if similar or same code was used in this situation.

Edit: I linked to the wrong issue in HASS Workstation

Bug: notification images aren't downloaded in case of certificate mismatch

Hi - for my particular deployment I use https with DuckDNS. For some reason my company has put DuckDNS on a blocklist so any URL with DuckDNS in it is being blocked so I planned to use the local IP address instead.

Of course that means that the full URL doesn't match the certificate path so I assume that's why the actual picture isn't showing up for notifications (as it works perfectly well if I use an http source, or an https source with the correct URL.

A workaround might be to just ignore, or add an option to ignore, certificate errors? At least for image URLs.

Cheers,
Andy

Feature: PowerShell Enhancments

As a user, it would be beneficial to be able to override the executable being called for the PowerShell based command, either to use a custom compiled binary or to use a different version of PowerShell altogether like PowerShell 7 (pwsh.exe). For security concerns, the default value should be the full path to the system-installed PowerShell.exe (C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe) instead of using a bare powershell.exe call; if a malicious actor places their own powershell.exe in your PATH ahead of the system path, then it will be called instead of the system-installed version unexpectedly.

Working on a PR now.

Also -- would this be better suited as something binary agnostic with the default executor being PowerShell? I could see value in using this for python/node/go/etc as well and wouldn't take much change to enable that.

App crashes on select in taskbar

Was working OK on first install but then when changed username and password to blank it crashed. Now won't stay running, when select icon in tray it quits. Have tried uninstall re-install but the same. Also rebooted Windows (10).

So can't reinstall or anything.

Bug: parsing port-reservation output isn't language independent

Hey,
just updated. Not using elevated rights sounds really great - many thanks 👍.
However, when updating via the installer, I got an error when registering the port. Everything seems to work though.
I guess the problem is that the console output isn't in English and contains special characters like ü. I've added the translations in {{}}:

2022-01-17 18:12:03.525 +01:00 [INF] [PROGRAM] Extended logging disabled
2022-01-17 18:12:03.532 +01:00 [INF] [SYSTEM] Post-update mode activated
2022-01-17 18:12:05.988 +01:00 [INF] [SETTINGS] Config storage path: D:\Programme\HASS.Agent\config
2022-01-17 18:12:06.067 +01:00 [INF] [SETTINGS] Configuration loaded
2022-01-17 18:12:06.088 +01:00 [INF] [SETTINGS_QUICKACTIONS] Loaded 1 entities
2022-01-17 18:12:06.098 +01:00 [INF] [SETTINGS_COMMANDS] Loaded 2 entities
2022-01-17 18:12:06.117 +01:00 [INF] [SETTINGS_SENSORS] Loaded 2 entities
2022-01-17 18:12:06.446 +01:00 [INF] [SCHEDULEDTASK] HASS.Agent task found, checking state ..
2022-01-17 18:12:06.528 +01:00 [INF] [SCHEDULEDTASK] Task in unexpected state, removal might fail: Disabled
2022-01-17 18:12:11.626 +01:00 [INF] [SCHEDULEDTASK] Task succesfully removed
2022-01-17 18:12:11.626 +01:00 [INF] [POSTUPDATE] Legacy scheduled task removed
2022-01-17 18:12:11.631 +01:00 [INF] [POSTUPDATE] Registry based launch-on-login method activated
2022-01-17 18:12:11.645 +01:00 [INF] [NOTIFIER] Executing port reservation for port: 5115
2022-01-17 18:12:12.111 +01:00 [ERR] [NOTIFIER] Unexpected console output, port reservation probably failed
2022-01-17 18:12:12.111 +01:00 [INF] [NOTIFIER] Console output:

Die URL-Reservierung wurde erfolgreich hinzugef�gt. {{The URL-Reservation was added successfully}}


2022-01-17 18:12:12.111 +01:00 [ERR] [POSTUPDATE] Unable to execute port reservation, notifier api might fail
2022-01-17 18:12:23.223 +01:00 [INF] [SYSTEM] Application shutting down
2022-01-17 18:12:23.233 +01:00 [ERR] [SYSTEM] Error shutting down nicely: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. {{The Objectreference didn't get set to an Objectinstance}}
2022-01-17 18:12:34.363 +01:00 [INF] [LOG] Coderr exception reporting disabled
2022-01-17 18:12:34.365 +01:00 [INF] [PROGRAM] Extended logging disabled
2022-01-17 18:12:34.883 +01:00 [INF] [SETTINGS] Config storage path: D:\Programme\HASS.Agent\config
2022-01-17 18:12:34.919 +01:00 [INF] [SETTINGS] Configuration loaded
2022-01-17 18:12:34.929 +01:00 [INF] [SETTINGS_QUICKACTIONS] Loaded 1 entities
2022-01-17 18:12:34.941 +01:00 [INF] [SETTINGS_COMMANDS] Loaded 2 entities
2022-01-17 18:12:34.958 +01:00 [INF] [SETTINGS_SENSORS] Loaded 2 entities
2022-01-17 18:12:34.974 +01:00 [INF] [NOTIFIER] Initializing local API ..
2022-01-17 18:12:35.023 +01:00 [INF] [MQTT] Connecting ..
2022-01-17 18:12:35.141 +01:00 [INF] [HOTKEY] Completed bind for global quickaction hotkey
2022-01-17 18:12:35.142 +01:00 [INF] [HOTKEY] Completed bind for 1 individual quickaction hotkeys
2022-01-17 18:12:35.236 +01:00 [INF] [HASS_API] Home Assistant version: 2021.12.9
2022-01-17 18:12:35.304 +01:00 [INF] [MQTT] Connected
2022-01-17 18:12:35.573 +01:00 [INF] [HASS_API] System connected with http://192.168.10.60:8123
2022-01-17 18:12:35.992 +01:00 [INF] [NOTIFIER] API listening on port 5115
2022-01-17 18:12:37.196 +01:00 [INF] [MQTT] Initial registration completed```

Feature: use scroll-lock in hotkey combinations

I'm using an AHK script to send MQTT requests to my HA, and I use the following combinations:

Scroll Lock + [1-0]

This is handy because Scroll Lock is quite never used anywhere, and I never use Scroll Lock for anything (AHK captures the Scroll Lock and even avoids the misuse of this key).

Just a thought :)

KUTGW

Feature: choose entity type for commands (instead of just switches)

Firstly: thank you very much for this addon. I was looking something similiar for a while.

After maybe a week testing, two sensors not working for me: CPU Load and CurrentClockSpeed. Let me know, if you need more information. I am not expert, but I will do my best.

Another "issue". Auto-creating task in Task manager not worked for me. It asked me to fill the name and password. I do not have windows user account with password. I had to do it manually according this https://www.wintips.org/how-to-start-a-program-at-startup-with-task-scheduler/. Similiar link could be mentioned ;).

Question:
I know it is "beta". It is possible to make switch sensors (volume up, volume down, media mute, media play pause, restart, shutdown) not to be like switches. More logical could be slider and buttons or service. Thank you!

Really high CPU usage

Hi. I have i9-9900K. This is a powerful processor. And for some reason your app uses ~8.5% of it. Even a browser with almost a hundred open tabs uses less than 2%. For comparison, in Call of Duty Warzone used 25%. For what reason does your passive app, which is generally always minimized, use so much? Really much.
image

Bug: Satellite service stops/crashes after an amount of time

I've just today switched from IoTLink to HASS Agent to give it a go. I'm having issues getting the Satellite service to remain running as it seems to randomly stop.

I want to use the service to read CPU & GPU load & system state change to HA and to suspend the PC and start an application on command.

I've tried various methods of starting the service, from using the agent interface, the services app, and manually starting from the executable in program files. All seem to eventually fail on their own. Have also tried reinstalling the service & rebooting the PC.

The service logs don't seem to be much help as it appears to start without issue; then stops without log and restarts (i noticed the service is set to restart 2 times before doing nothing after the third crash).

2022-04-15 22:34:39.467 +12:00 [INF] [MAIN] Version: 2022.3.27.0
2022-04-15 22:34:39.490 +12:00 [INF] [MAIN] Service started, initializing ..
2022-04-15 22:34:39.576 +12:00 [INF] [WORKER] Startup completed, commencing execution ..
2022-04-15 22:34:39.578 +12:00 [INF] [SETTINGS] Config storage path: C:\Program Files (x86)\LAB02 Research\HASS.Agent Satellite Service\config
2022-04-15 22:34:39.639 +12:00 [INF] [SETTINGS] Configuration loaded
2022-04-15 22:34:39.642 +12:00 [INF] [SETTINGS] MQTT configuration loaded
2022-04-15 22:34:39.649 +12:00 [INF] Application started. Hosting environment: Production; Content root path: C:\Program Files (x86)\LAB02 Research\HASS.Agent Satellite Service\
2022-04-15 22:34:39.660 +12:00 [INF] [SETTINGS_COMMANDS] Loaded 2 entities
2022-04-15 22:34:44.304 +12:00 [INF] [SETTINGS_SENSORS] Loaded 3 entities
2022-04-15 22:34:44.305 +12:00 [INF] [MQTT] Identifying as device: AIDAN-PC-satellite
2022-04-15 22:34:44.311 +12:00 [INF] [RPCMANAGER] Listening
2022-04-15 22:34:44.312 +12:00 [INF] [MQTT] Connecting ..
2022-04-15 22:34:44.355 +12:00 [INF] [MQTT] Connected
2022-04-15 22:34:46.330 +12:00 [INF] [MQTT] Initial registration completed
2022-04-15 22:38:28.147 +12:00 [INF] [MAIN] Version: 2022.3.27.0
2022-04-15 22:38:28.169 +12:00 [INF] [MAIN] Service started, initializing ..
2022-04-15 22:38:28.257 +12:00 [INF] [WORKER] Startup completed, commencing execution ..
2022-04-15 22:38:28.258 +12:00 [INF] [SETTINGS] Config storage path: C:\Program Files (x86)\LAB02 Research\HASS.Agent Satellite Service\config
2022-04-15 22:38:28.319 +12:00 [INF] [SETTINGS] Configuration loaded
2022-04-15 22:38:28.323 +12:00 [INF] [SETTINGS] MQTT configuration loaded
2022-04-15 22:38:28.330 +12:00 [INF] Application started. Hosting environment: Production; Content root path: C:\Program Files (x86)\LAB02 Research\HASS.Agent Satellite Service\
2022-04-15 22:38:28.340 +12:00 [INF] [SETTINGS_COMMANDS] Loaded 2 entities
2022-04-15 22:38:32.994 +12:00 [INF] [SETTINGS_SENSORS] Loaded 3 entities
2022-04-15 22:38:32.996 +12:00 [INF] [MQTT] Identifying as device: AIDAN-PC-satellite
2022-04-15 22:38:33.001 +12:00 [INF] [MQTT] Connecting ..
2022-04-15 22:38:33.001 +12:00 [INF] [RPCMANAGER] Listening
2022-04-15 22:38:33.046 +12:00 [INF] [MQTT] Connected
2022-04-15 22:38:35.016 +12:00 [INF] [MQTT] Initial registration completed
2022-04-15 22:38:58.269 +12:00 [INF] [SETTINGS] Configuration stored
2022-04-15 22:38:58.270 +12:00 [INF] [SETTINGS] Received MQTT settings stored
2022-04-15 22:38:58.270 +12:00 [INF] [MQTT] Reloading configuration ..
2022-04-15 22:38:58.276 +12:00 [INF] [MQTT] Initializing ..
2022-04-15 22:38:58.276 +12:00 [INF] [MQTT] Identifying as device: AIDAN-PC-satellite
2022-04-15 22:38:58.276 +12:00 [INF] [MQTT] Connecting ..
2022-04-15 22:38:58.312 +12:00 [INF] [MQTT] Connected
2022-04-15 22:39:00.283 +12:00 [INF] [MQTT] Initial registration completed

I have also looked into the agent logs but the errors in there seem rather mundane from log write errors

2022-04-15 21:28:46.329 +12:00 [FTL] [PROGRAM] FirstChanceException: The process cannot access the file 'C:\Users\aidan\AppData\Roaming\HASS.Agent\logs\[2022-04-15] HASS.Agent_20220415_019.log' because it is being used by another process.
System.IO.IOException: The process cannot access the file 'C:\Users\aidan\AppData\Roaming\HASS.Agent\logs\[2022-04-15] HASS.Agent_20220415_019.log' because it is being used by another process.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at Serilog.Sinks.File.FileSink..ctor(String path, ITextFormatter textFormatter, Nullable`1 fileSizeLimitBytes, Encoding encoding, Boolean buffered, FileLifecycleHooks hooks)
   at Serilog.Sinks.File.RollingFileSink.OpenFile(DateTime now, Nullable`1 minSequence)

To IO operation aborts, likely because I was restarting the agent (there are quite a few variations of these)

2022-04-15 23:18:43.494 +12:00 [FTL] [PROGRAM] FirstChanceException: The I/O operation has been aborted because of either a thread exit or an application request.
System.Net.HttpListenerException (995): The I/O operation has been aborted because of either a thread exit or an application request.
   at System.Net.HttpListener.EndGetContext(IAsyncResult asyncResult)

Upgraded to WIndows 11 before the install if that helps at all.

Any advice on how to further debug this would be appreciated. If you need more info about the setup I should be able to get you what you want.

[Enhancement] Default MQTT broker URL to the home assistant URL

A large majority of home assistant users run Hass OS and the mosquito addon, or otherwise run their MQTT broker from the same machine as their home assistant instance. Because of this it makes sense to use the Home assistant URL provided in step 5 of the onboarding process as the default MQTT broker plugin in step 6.

Enhancement: prefix switches and sensors with definable device name

Not a huge thing; but when you define your sensors and commands, the default that it uses just shows up in hass as "switch.shutdown", "sensor.cpuload", et cetera.
Currently I can obviously manually rename them to show up as _shutdown; but I still have a bunch of MQTT sensors where it isn't clear which device they're from but I am pretty sure it's a windows machine's network cards.

This stands out more if you have multiple PC's and windows devices in the home

Feature: Publish as a media_player (device class speaker)

I find myself using the TTS HASS feature (a nice one is available if you use the premium cloud service) to have text, often notifications, turned into audio that's sent to media players.

It would be stellar if the HASS.Agent could publish itself as a media player (in the "speaker" device class) so Home Assistant could send audio streams to the agent for playback using the Windows audio subsystem, as well as do a few other things available to "speaker" devices such as unmuting and controlling the volume.

This might be better suited for the HASS.Agent-Notifier repository as it would likely be used more as a notification option, but I could also see people wanting to use it to play music or something. Perhaps this could be spun off as another additional service like HASS.Agent-MediaPlayer

Similar ways to accomplish this:

Something that uses native Windows features would be preferred and would be one less thing to install.

Feature: define notifier without an IP address

I'd like to be able to install this on a laptop and still receive notifications when not on the home network (i.e. not at home).

Would be cool to be able to therefore define the notifier without the need for an IP Address

Powershell command issue

Hey,
I am trying to run a python program with home assistant using the power shell command option. I don't know why it does not work. The command I type in is C:/Users/....../AppData/Local/Programs/Python/Python39/python.exe "c:/Users/....../OneDrive/Documents/Python - Sk/PythonKeyPress/1.py". Do you have any solution for why it doesn't work?

Buttons missing

I have trouble configuring new sensors and commands. The buttons shown in readme are not displayed, as you can see here:

hass_agent_malfunction_sensors
hass_agent_malfunction_cmd

Bug: QuickActions not working in 2022.11.0-beta1

2022-04-15 14:52:12.639 -03:00 [INF] [MQTT] Connecting ..
2022-04-15 14:52:12.714 -03:00 [INF] [MQTT] Connected
2022-04-15 14:52:12.827 -03:00 [INF] [HASS_API] Home Assistant version: 2022.4.4
2022-04-15 14:52:13.051 -03:00 [INF] [NOTIFIER] API listening on port 5115
2022-04-15 14:52:13.759 -03:00 [INF] [HASS_API] System connected with https://xxxxxx.duckdns.org:8123/
2022-04-15 14:52:14.651 -03:00 [INF] [MQTT] Initial registration completed
2022-04-15 14:52:15.600 -03:00 [INF] [HASS_API] [.agua] Performing action:
2022-04-15 14:52:15.636 -03:00 [FTL] [HASS_API] [.agua] Error while processing action: Response status code does not indicate success: 404 (Not Found).
System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at HADotNet.Core.BaseClient.Post[T](String path, Object body, Boolean isRawBody)
at HADotNet.Core.Clients.ServiceClient.CallService(String serviceName, String fields)
at HASS.Agent.HomeAssistant.HassApiManager.ProcessActionAsync(HassEntity entity, HassAction action)
2022-04-15 14:52:16.782 -03:00 [WRN] [HASS_API] Server returned 404 (not found) while getting entity state. This can happen after a server reboot, or if you've deleted the entity. If the problem persists, please file a ticket on github.
Entity: light.agua
Error message: Response status code does not indicate success: 404 (Not Found).

Bug: LoggedUserSensor sensor shows wrong value if logged in as another user

If HASS.Agent is installed under user account A which is signed-in in the background but user B is currently logged in and has an active desktop session the LoggedUserSensor reports the name of user A, not user B.

Based on that behaviour I believe that LoggedUserSensor would only ever show the name of the user HASS.Agent is installed under.

I assume this is a side effect of HASS.Agent currently being installed under / tied to a specific user. This will likely be solvable once the 'satellite service' is implemented.

Image display fails on dynamic URL

First, this is nice. Thank you!

I would like to use this to popup a still image of the person at the front door. In my testing I found the following.

The following URL works:

http://homeassistant.local:8123/local/brian.jpg

While a dynamic URL pulled from the entity_picture attribute of a camera does not.

http://homeassistant.local:8123/api/camera_proxy/camera.doorbell?token=da875fe850053b881f2fd8636c73faf7a0fc99ec7e18feb6ee69be992bb4890a

FYI. in my script.notify_pc I use the variables: section to extract the dynamic URL.

variables:
  image: |
    {% set camera = camera %}
    {%- if camera != "" %}
      {%- set image = "http://homeassistant.local:8123" + state_attr(camera,"entity_picture") %}
    {% endif %}
    {{ image }}

Default hotkey for quick actions blocks the @ character on German keyboards

Hey,
the default hotkey for quick actions (CTRL + ALT + Q) blocks the @ character on German keyboards.
Took me a little to figure out whick of my new toys didn't want me to send mails anymore ;-)
May I recommend to pick a different default hotkey, or not to enable it by default, or...

Thanks for your work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.