Releases: LAB02-Research/HASS.Agent
b2022.3.25
Note: this is a beta release!
This release contains the new 'satellite service'!
You can use it to run commands and sensors without having to be logged in, and configure sensors that require elevated privileges (not added yet, but the first round will be hardware-info sensors like CPU temp, etc.).
I tried my best to make it really easy to use, all through HASS.Agent's UI. If you use the installer (which by now is recommended), everything will be setup for you. There are two places where you can tinker with it:
-
Main window -> new 'Satellite Service' button
- Configure the fun stuff, ie. the sensors and commands, and the not-so-fun (MQTT) configuration
- Use the 'copy from hass.agent' button on the MQTT tab to easily copy the current configuration (will use its own client id)
- Remember to always click 'send and activate' afterwards
-
Configuration window -> new 'Satellite Service' tab
- Configure the service itself, ie. start/stop/disable/reinstall
- Normally you shouldn't have to use this, only when debugging
- Use the 'open service logs folder' to go to the service's logs
Some more notes:
-
You can optionally set an 'auth ID'
- When configured, only HASS.Agents that have to correct ID set can communicate with the service
- Leave empty to allow all instances to connect (which is the default)
- Only relevant when you use multiple HASS.Agent instances on the same PC
-
Not all sensors and commands can be executed through the service
- The 'create new command/sensor' windows will tell you what's possible
- Note that you have to think about this yourself when setting a custom command
-
All settings on the 'general' tab of the new service window are optional
-
The service installs into your ProgramFiles directory
-
You can choose to disable the service through Configuration -> Satellite Service
- If you don't configure the service, it'll do nothing, but you may still want to disable to save cpu/battery
- Don't uninstall; if you do, it will be reinstalled during the next update (only if you use the installer)
If something goes wrong, please send me as much info as possible, and the logs of both HASS.Agent and the satellite service.
Features & improvements
-
Added 'open logs folder' to Configuration -> Logging
-
Added 'execute port reservation' to Configuration -> Notifications
- This will recreate the firewall rule en port reservation
- Use this to make sure your PC can be contacted, normally done through onboarding
-
Added 'show test notification' button to Configuration -> Notifications
- This will show a test notification, to make sure Windows is configured correctly
- This does not prove your PC can be contacted
-
Added show/hide password buttons to password fields
-
Added 'close without saving' button to Configuration
Known bugs
- I've spent many hours trying to get DPI scaling to work nicely, but it just won't look completely ok since switching to .NET 6
- So for now, I've reverted to basically no scaling
- If you have Windows set to 100% scaling, there's no difference
- But otherwise, the interface will be a bit blury instead of crisp (like a badly resized picture)
- This is really annoying, and I'll keep working on it, sorry
v2022.3.8
TL;DR
This is the last version that uses .NET 4.8. Starting with the next version, HASS.Agent will use .NET 6. You'll need it installed on your machine, but the installer will help you by then. And no, Linux/macOS won't be supported (yet), sorry!
Extended version
Just a small update with a new command and a new sensor (useful ones though, thanks for all the ideas and suggestions!) - but with good reason: this is the last HASS.Agent version that's built upon .NET 4.8, it's moving to the shiny new .NET 6 platform.
If that doesn't tell you much: it's what developers can use to develop software with, like a set of building blocks. HASS.Agent currently uses .NET 4.8, which was released in 2019 - ancient in the world of IT. By switching to .NET 6, which was released last november, HASS.Agent can start using all the latest and greatest techniques.
For those that do know what it is, a heads up: this does not mean HASS.Agent will run on Linux and/or macOS (anytime soon). HASS.Agent is currently a Windows-focused application. Making it cross-platform is something I'd love to tinker with in the future, but don't hold you breath, there are a bunch of features I want to implement first.
This version will be archived, so users that can't or won't install .NET 6 can always use this one. If you have situations in which .NET 6 is a problem for you (for whatever reason), please open a ticket so we can discuss!
So, in conclusion: you'll need .NET 6 installed on your machine for the next version(s). If you want to prepare, you can download Microsoft's installer from this link:
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-6.0.2-windows-x64-installer
It's a one-time installation that enables you to run all modern .NET 6 applications.
Features & improvements
-
New command: MultipleKeysCommand (thanks ChrisRosenkreuz23)
- You guessed it: able to press multiple keys in a row
- There are a few tricks you can use:
- Special keys go between { }, like {TAB} or {UP}
- Put a + in front of a key to add SHIFT, ^ for CTRL and % for ALT
- So, +C is SHIFT-C. Or, +(CD) is SHIFT-C and SHIFT-D, while +CD is SHIFT-C and D
- For multiple presses, use {z 15}, which means Z will get pressed 15 times
- More info: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys
- You need to put [ ] between every key, otherwise HASS.Agent can't tell them apart
- So say you want to press X TAB Y SHIFT-Z, it'd be [X] [{TAB}] [Y] [+Z]
- All of this can be found in the command's info panel as well
-
New sensor: LoggedUserSensor (thanks @bverkron)
- Reports only the currently logged user
- Use a LoggedUsersSensor to get a list of all logged users
b2022.3.14
Note: this is a beta release!
The first .NET 6 public beta :)
A lót of work went into getting everything ready 'under the hood', so please keep an eye on memory/cpu usage. Otherwise everything should work just like before. You don't need to have .NET 6 on your system, the installer will handle that for you.
Note: ignore the placeholders for the new 'satellite service', it isn't included in this beta. Almost ready though!
Features & improvements
-
User interface improvements!
- Manage commands/sensors/quick actions:
- Cleaner way to show the stored items
- Naming has been simplified and made more human-readable
- Add commands/sensors:
- Easier to see which commands/sensors are available
- Naming has been simplified and made more human-readable
- Handling of scaling has been improved (let me know if it's still not ok)
- Multiple small tweaks throughout
- Manage commands/sensors/quick actions:
Bugfixes
-
When using automated updating, HASS.Agent now removes its icon from the tray (thanks Nejc)
- Manually updating will still leave a ghost icon in the system tray
-
The custom executor command now correctly shows its description in the info pane
-
Not really a bug, but Coderr has been removed
- The logs provide more info than a single exception report
- Wasn't really comfortable with anything being sent from your PC, even if it was opt-in
b2022.3.7.1
Note: this is a beta release!
Sorry beta testers! I've made a small mistake in release 2022.3.6 considering the new MultipleKeysCommand, which slipped through the cracks.
HASS.Agent incorrectly stores it as a MediaVolumeUpCommand..
Feel free to run the automated installer, but afterwards close HASS.Agent and follow the below instructions (click on release page
to have a reference).
If you aren't using the new MultipleKeysCommand, you don't have to do anything. You can either update to make sure you can create them if you'd want, or just wait until the next (beta) release which of course includes the fix.
Sorry for the extra work, but thank you for beta testing!
Bugfixes
- Storing the new MultipleKeysCommand gets mixed up with MediaVolumeUpCommand
- If you made a MultipleKeysCommand:
- Completely close HASS.Agent
- Open your config folder (normally
%appdata%\LAB02 Research\HASS.Agent\config
) - Open
commands.json
- Find your MultipleKeysCommand entity, and change the type from
MediaVolumeUpCommand
toMultipleKeysCommand
- Store changes and restart HASS.Agent
- If you made a MultipleKeysCommand:
b2022.3.7
b2022.3.6
Note: this is a beta release!
Features & improvements
- New command: MultipleKeysCommand (thanks ChrisRosenkreuz23)
- You guessed it: able to press multiple keys in a row
- There are a few tricks you can use:
- Special keys go between { }, like {TAB} or {UP}
- Put a + in front of a key to add SHIFT, ^ for CTRL and % for ALT
- So, +C is SHIFT-C. Or, +(CD) is SHIFT-C and SHIFT-D, while +CD is SHIFT-C and D
- For multiple presses, use {z 15}, which means Z will get pressed 15 times
- More info: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys
- You need to put [ ] between every key, otherwise HASS.Agent can't tell them apart
- So say you want to press X TAB Y SHIFT-Z, it'd be [X] [{TAB}] [Y] [+Z]
- All of this can be found in the command's info panel as well
v2022.3.1
Small out-of-band release to fix a nasty HA api disconnect bug. As a bonus, you can now set a MQTT client ID.
Features & improvements
- You can now configure a MQTT client ID [#35] (thanks @Zolli)
- This can be set in the Configuration -> MQTT panel
- If you don't set one, it'll be random generated and then stored for consistency
- Note: normally you don't have to change this (not part of username/password, just identifies the client)
Bugfixes
- HASS.Agent fails to reconnect to the HA api after a longer disconnect (thanks djagerif)
- This would get triggered for instance when you'd reboot the HA host
- It could also potentially trigger on random moments
- When triggered, it'd fail to reconnect to the HA api until HASS.Agent was restarted
b2022.2.28
Note: this is a beta release!
Features & improvements
v2022.2.27
Features & improvements
-
You can now choose to get notified of beta updates as well (thanks Shupershuff)
- Beta updates are generally stable, they're used to push new functions sooner
- Regular channel only gets updates every few weeks, to prevent update fatigue
-
New multi-value sensors: audio (thanks Nejc)
- Provides information about various aspects of your device's audio:
- Current peak volume level (can be used as a simple 'is something playing' value)
- Default audiodevice: name, state and volume
- Summary of your audio sessions: application name, muted state, volume and current peak volume
- Possible thanks to @morphx666's great audio library CoreAudio and his awesome support, thank you!
- Provides information about various aspects of your device's audio:
-
New multivalue-sensor: Displays (thanks dino)
- Amount of displays
- Name of primary display
- Per display: name, resolution and bits per pixel
-
New configuration page: External Tools
- Configure a specific browser and -executor
- Allows you to add a
incognito
field for the new LaunchUrl command- I've added the args for a few browsers (detected when you select the binary)
- If your browser isn't included, please let me know the arg and I'll add it
- If you select a custom browser, it'll be used throughout HASS.Agent
- In normal mode, not incognito, that's only for the LaunchUrl command
- Executor can be used in the new CustomExecutor command
-
New command: LaunchUrl
- Launches the specified url in your default browser
- Optionally launch incognito (thanks duceduc)
- For this to work, you need to config a custom browser
-
New command: CustomExecutor [#32] (thanks @scrthq)
- Execute commands through your favorite executor (set in
Configuration
->External Tools
) - Handy for instance if you use a lot of python scripts, no more copying the binary in custom commands
- Your command is provided as an argument 'as is', so you have to take care of quotes etc. yourself
- Execute commands through your favorite executor (set in
-
Disconnection grace period [#29] (thanks @amplitur)
- Set a grace period (default 60 seconds) in which HASS.Agent tries to recover from a failed connection before logging
- Useful for example when it takes Windows a while to connect, or when updating HA
- Applies to MQTT and HA's API
-
QuickActions now have support for covers [#28] (thanks @ipd-otto)
- Also added:
climate
andmedia_player
- Also added:
-
Sensors and commands are now still processed while the config window's open [#30] (thanks @amplitur)
-
New command: Sleep (thanks bverkron)
- Note: due to a limitation in Windows, this only works if hibernation is disabled
- You can use something like NirCmd to circumvent this
-
New sensor: Process active
- Returns the number of active instances of the provided process
-
New sensor: Service check
- Returns the current state of the provided service
-
New sensor: Logged users
- Returns a json-formatted list of currently logged users
-
New command: Publish all sensors (thanks djagerif)
- Resets all sensor checks, forcing them to resend their values
- Useful for example when you want HASS.Agent to resend all values after rebooting HA
-
WMI sensors now support configuring its scope (thanks zlodei2000)
- This allows for instance to fetch AID64 or openhardwaremonitor sensors
- Example cpu temperature query for the latter:
- Scope:
\\.\ROOT\OpenHardwareMonitor
- Query:
SELECT value FROM Sensor WHERE Name LIKE "%CPU Core%" AND SensorType = "Temperature"
- Scope:
-
HASS.Agent will now try to resend all sensor values after reconnecting to HA (thanks djagerif)
-
Added a fancy 'restarting' interface
-
Various UI tweaks
Bugfixes
- WMI queries don't return any value
- Removed unnecessary exceptions when 'extended logging' is enabled
- You can now set your device name during onboarding, as intended
- Powershell's binary is now located and launched instead of using PATH [#26] (thanks @scrthq)
- Powershell scripts containing a space in their path aren't being executed (thanks Shupershuff)
v2022.1.24
In addition to 2022.1.23:
- Bugfix: sensor publish-intervals aren't being respected and stuck on 1s (thanks nejc)
As promised, a more interesting update than the last one: new sensors, commands and configuration options - thanks a ton for all the reports/tips/ideas! Keep them coming :)
Unfortunately (but it kinda feels mature), this update also contains the very first breaking change. It's only relevant if you have a network- or disk multivalue sensor configured. Nothing too bad, read the Breaking changes section below.
Features & improvements
-
HASS.Agent now has a Discord channel! Find us on https://discord.gg/nMvqzwrVBU (thanks @Syntoxr)
- Ask for help, share ideas, tips, nuisances as well as anything you like
- Feel free to report bugs, although GitHub tickets are prefered (especially for high-impact issues)
-
New command: Powershell
- You can now add your own Powershell-based commands
- This can either be a script (ending with .ps1), or a single-line command
-
New multivalue-sensor: Windows Update
- Currently adds 2 sensors: pending driver updates count and pending software updates count
- Code's already complete to add sensors containing more detailed info about the individual pending updates
- This first requires some MQTT code upgrades, as it has to be sent as 'attributes' (too long otherwise)
- So, those are for next time :)
-
New multivalue-sensor: battery state
- Current charging status
- Estimated amount of minutes on a full charge
- Remaining charge in percentage
- Remaining charge in minutes
- Powerline status
-
New sensor: custom performance counters
- You can now create your own performance counter-based sensors
- Launch perfmon.exe to find interesting counters
- Example for an 'available memory' counter:
- Category:
Memory
- Counter:
Available MBytes
- Instance: leave empty
- Category:
-
HASS.Agent updates can now be installed directly from the 'new update' dialog
- If enabled, the update dialog shows a button to download & launch the installer for you
- Enabled by default, but can be disabled through the Configuration window
- The update is downloaded from GitHub, same link as usual
- After downloading, HASS.Agent checks the file to see if it's signed with the right certificate to prevent tampering
-
Custom commands can now be executed as 'low integrity' for added security [#15] (thanks @mitchcapper)
- That means it will only be able to save and modify files in certain locations:
%USERPROFILE%\\AppData\\LocalLow
HKEY_CURRENT_USER\\Software\\AppDataLow
- That means it will only be able to save and modify files in certain locations:
-
Connecting to HA's API now supports client certificates [#15] (thanks @mitchcapper)
- You can either provide your own, or use automatic selection (it'll try to find the right one)
- Not tested: if you use this, let me know if something doesn't work
-
You can now change your device's name [#25] (thanks @Avishadur)
- Default is the machinename as configured in Windows
- Used as the device name in HA
- Used as the default prefix for new sensors and commands
- Note: the default name is a suggestion, you can change it for every individual sensor or command
- Note: when you change this value, all your sensors and commands will be temporarily unpublished
- HASS.Agent will restart and then republish them, with the same ID's but under the new name
-
MQTT got some new connection options:
- Support for client certificates
- You can provide a root and client certificate
- The option to (dis)allow untrusted certificates
- This is set to
allow
by default to avoid breaking connections for existing users
- This is set to
- The option to disable the retain flag
- These new options aren't tested: if you use this, let me know if something doesn't work
- Based on @prestomation's excellent work for hass workstation service
- Support for client certificates
-
Added a help dialog with pointers to GitHub, Discord and the HA forum
-
Added an exit dialog
- When clicking the exit button, or 'exit' on the trayicon menu, you'll be presented a small dialog
- You can use this to (obviously) exit, but also to restart HASS.Agent
- Useful for instance when you want to reload and reregister all sensors
-
New sensors and commands now get a suggested name based on
{machinename}_{sensor/commandname}
[#25] (thanks amplitur and @Avishadur) -
Dropdown menus now have the same background color as textboxes (thanks amplitur)
-
Sensor values consisting of arrays now only contain values (no array descriptor) (thanks amplitur)
-
Custom- and Powershell commands are now executed as non-blocking
- This means they get launched and forgotten
- You'll still get an error entry in your log if execution fails to start
- Output doesn't get parsed nor exitcode checked
- The code's completed to perform 'smarter' executions and respond on the final outcome
- If there's interest in this, let me know and I'll make it an optional setting
-
Only one log message when disconnected from HA's API, and one when reconnected, to prevent spamming
-
Modifying sensors and commands is now locked until they're all loaded, to avoid accidental deletion
Breaking changes
- The sensors of multivalue sensors now correctly get the user provided prefix [#25] (thanks amplitur and @Avishadur)
- Previously, all sensors of the network sensor started with
nic
, and storage withdrive
- That's fine for one PC, but not fine for multiple
- From now on, every sensor that's part of a multivalue sensor will have the name of its parent sensor as a prefix
- For instance, if you made a network sensor called
pc1_nics
, the sensor containing the amount of cards is now calledpc1_nics_network_card_count
- You can opt to delete your PC from the
Devices
list to get a clean slate- You can do this by going to HA, press
e
for the shortcut menu, search for and opendevices
- Search and open your machine, and look for
DELETE
underDevice info
- Make sure there's a button called
MQTT INFO
to the left of it, and double check that you have the right one - Make sure HASS.Agent is completely closed (not minimized to tray)
- When you're ready, click and confirm
DELETE
- All sensors and commands will get recreated after you launch the new HASS.Agent release, your scripts/automations keep working
- You can do this by going to HA, press
- Previously, all sensors of the network sensor started with
Bugfixes
- Dragging windows can cause drawing issues [#23] (thanks @petarvucetin)
- Parsing port-reservation output isn't language independent (fix applied to v2022.1.17 release as well) [#22] (thanks @Syntoxr)
- Quickaction-bound hotkeys not working when only one quickaction is present [#20] (thanks @b26x and @Syntoxr)
- Onboarding doesn't show when launching with 'update' parameter (fix applied to v2022.1.17 release as well)
- Configuration window won't close when choosing not to restart
- Application crash when storing configuration without a registered hotkey
- Loading cpu-heavy sensors freezes HASS.Agent on startup
- Powershell commands get executed twice (thanks Shupershuff)
- Sensors won't get a value in HA until the value changes or HASS.Agent restarts