github LAB02-Research/HASS.Agent v2022.1.23

latest releases: 2022.14.0, 2022.14.0-beta1, 2022.13.0...
2 years ago

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
  • 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
  • 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
    • 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
  • 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 with drive
    • 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 called pc1_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 open devices
      • Search and open your machine, and look for DELETE under Device 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

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

Don't miss a new HASS.Agent release

NewReleases is sending notifications on new releases.