github LAB02-Research/HASS.Agent b2022.1.22

latest releases: 2022.14.0, 2022.14.0-beta1, 2022.13.0...
pre-release2 years ago

Note: this is a beta release!


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 eiher be a script (ending with .ps1), or a single-line command
  • New command: hibernate

  • New multivalue-sensor: Windows updates

    • 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 and the 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
  • Updates can now be launched directly from HASS.Agent

    • 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' [#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
  • Experimental: you can now change your device's name [#25] (thanks @Avishadur)

    • Default is the machinename as configured in Windows
    • During onboarding, you get the chance to customize this value (this part isn't experimental, changing later on is)
    • Used as the device name in HA
    • Used as the default prefix for new sensors and commands
    • Note: when you change this value, all your sensors and commands will be temporarily unpublished
      • HASS.Agent will restart and then republish them, under the same ID's
      • In some cases, you need to restart HASS.Agent again (possible through the new exit dialog)
      • In some (other?) cases, your commands stop working
      • I'm looking into this, but the easiest solution for now is:
        • Optionally make a copy of commands.json in the config folder
        • Remove the commands in HASS.Agent (you don't have to change/remove anything in HA)
        • Click store and activate commands
        • Reopen the commands window and add your commands under the same name, optionally cut 'n pasting from your commands.json copy
        • Click store and activate commands
        • They'll work again, and so will your scripts/automations that use them
  • 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 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
    • This way, you can send the next command afterwards, and don't have to worry about time-consuming commands
    • 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 for commands

Breaking changes

Unfortunately (but it kinda feels mature), this update contains our very first breaking change. It's only relevant if you're using multivalue-sensors.

  • 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

Bugfixes

  • Configuration window won't close when chosing not to restart
  • Application crash when storing configuration without a registered hotkey
  • Loading cpu-heavy sensors freezes HASS.Agent on startup
  • Modifying sensors and commands is now locked until they're all loaded, to avoid accidental deletion

Don't miss a new HASS.Agent release

NewReleases is sending notifications on new releases.