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