Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 88 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
#configuration: [Debug, Release]
configuration: [Release]

runs-on: windows-latest # For a list of available runner types, refer to
runs-on: windows-2022 # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on

env:
Expand All @@ -87,9 +87,9 @@ jobs:

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4.2.0
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
#- name: Setup MSBuild.exe
Expand All @@ -112,67 +112,111 @@ jobs:
dotnet restore "src\\HASS.Agent\\HASS.Agent\\HASS.Agent.csproj"
dotnet restore "src\\HASS.Agent\\HASS.Agent.Satellite.Service\\HASS.Agent.Satellite.Service.csproj"

- name: Build & Publish HASS.Agent
- name: Build & Publish HASS.Agent x64
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent\\HASS.Agent"
run: "dotnet publish -c Release -f net6.0-windows10.0.19041.0 -o bin\\Publish-x64\\Release\\ --no-self-contained -r win-x64 -p:Platform=x64"
run: "dotnet publish -c Release -f net8.0-windows10.0.22621.0 -o bin\\Publish-x64\\Release\\ --no-self-contained -r win-x64 -p:Platform=x64"

- name: Build & Publish HASS.Agent.Satellite.Service
- name: Build & Publish HASS.Agent.Satellite.Service x64
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent\\HASS.Agent.Satellite.Service"
run: "dotnet publish -c Release -f net6.0-windows10.0.19041.0 -o bin\\Publish-x64\\Release\\ --no-self-contained -r win-x64 -p:Platform=x64"
run: "dotnet publish -c Release -f net8.0-windows10.0.22621.0 -o bin\\Publish-x64\\Release\\ --no-self-contained -r win-x64 -p:Platform=x64"

- name: Compile InnoSetup Installer - Satellite Service
- name: Compile InnoSetup Installer - Satellite Service x64
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent.Installer"
run: |
& "${Env:ProgramFiles(x86)}\\Inno Setup 6\\iscc.exe" InstallerScript-Service.iss

- name: Compile InnoSetup Installer - Client
- name: Compile InnoSetup Installer - Client x64
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent.Installer"
run: |
& "${Env:ProgramFiles(x86)}\\Inno Setup 6\\iscc.exe" InstallerScript.iss

- name: Build & Publish HASS.Agent x86
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent\\HASS.Agent"
run: "dotnet publish -c Release -f net8.0-windows10.0.22621.0 -o bin\\Publish-x86\\Release\\ --no-self-contained -r win-x86 -p:Platform=x86"

- name: Build & Publish HASS.Agent.Satellite.Service x86
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent\\HASS.Agent.Satellite.Service"
run: "dotnet publish -c Release -f net8.0-windows10.0.22621.0 -o bin\\Publish-x86\\Release\\ --no-self-contained -r win-x86 -p:Platform=x86"

- name: Compile InnoSetup Installer - Satellite Service x86
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent.Installer"
run: |
& "${Env:ProgramFiles(x86)}\\Inno Setup 6\\iscc.exe" InstallerScript-Service-x86.iss

- name: Compile InnoSetup Installer - Client x86
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent.Installer"
run: |
& "${Env:ProgramFiles(x86)}\\Inno Setup 6\\iscc.exe" InstallerScript-x86.iss

- name: Decode the pfx
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent.Installer"
run: |
$pfxBytes = [System.Convert]::FromBase64String("${{ secrets.BASE64_ENCODED_PFX }}")
$certificatePath = [IO.Path]::GetFullPath(".\\HASS.Agent.Installer.pfx")
[IO.File]::WriteAllBytes($certificatePath, $pfxBytes)

- name: Sign the installer
- name: Sign the x64 installer
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent.Installer"
run: |
$certificatePassword = ConvertTo-SecureString "${{ secrets.BASE64_ENCODED_PFX_PASSWORD }}" -AsPlainText -Force
$certificate = Get-PfxCertificate -FilePath ".\\HASS.Agent.Installer.pfx" -Password $certificatePassword
Set-AuthenticodeSignature -FilePath ".\\bin\\HASS.Agent.Installer.exe" -Certificate $certificate -HashAlgorithm SHA256 -TimestampServer http://timestamp.digicert.com

- name: Sign the x86 installer
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent.Installer"
run: |
$certificatePassword = ConvertTo-SecureString "${{ secrets.BASE64_ENCODED_PFX_PASSWORD }}" -AsPlainText -Force
$certificate = Get-PfxCertificate -FilePath ".\\HASS.Agent.Installer.pfx" -Password $certificatePassword
Set-AuthenticodeSignature -FilePath ".\\bin\\HASS.Agent.Installer.x86.exe" -Certificate $certificate -HashAlgorithm SHA256 -TimestampServer http://timestamp.digicert.com

- name: Remove the pfx
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent.Installer"
run: Remove-Item -path ".\\HASS.Agent.Installer.pfx"

#Upload project artifacts: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload build artifacts (HASS Agent)
# Upload x64 project artifacts: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload build artifacts x64 (HASS Agent)
uses: actions/upload-artifact@v4.6.0
with:
name: HASS.Agent
path: "src\\HASS.Agent\\HASS.Agent\\bin\\Publish-x64\\Release"

- name: Upload build artifacts (HASS Agent Satellite Service)
- name: Upload build artifacts x64 (HASS Agent Satellite Service)
uses: actions/upload-artifact@v4.6.0
with:
name: HASS.Agent.Satellite.Service
path: "src\\HASS.Agent\\HASS.Agent.Satellite.Service\\bin\\Publish-x64\\Release"

- name: Upload build artifacts (HASS Agent Installer)
- name: Upload build artifacts x64 (HASS Agent Installer)
uses: actions/upload-artifact@v4.6.0
with:
name: HASS.Agent.Installer
path: "src\\HASS.Agent.Installer\\bin\\HASS.Agent.Installer.exe"

# Upload x86 project artifacts
- name: Upload build artifacts x86 (HASS Agent)
uses: actions/upload-artifact@v4.6.0
with:
name: HASS.Agent.x86
path: "src\\HASS.Agent\\HASS.Agent\\bin\\Publish-x86\\Release"

- name: Upload build artifacts x86 (HASS Agent Satellite Service)
uses: actions/upload-artifact@v4.6.0
with:
name: HASS.Agent.Satellite.Service.x86
path: "src\\HASS.Agent\\HASS.Agent.Satellite.Service\\bin\\Publish-x86\\Release"

- name: Upload build artifacts x86 (HASS Agent Installer)
uses: actions/upload-artifact@v4.6.0
with:
name: HASS.Agent.Installer.x86
path: "src\\HASS.Agent.Installer\\bin\\HASS.Agent.Installer.x86.exe"

#- name: Debugging artifact paths
# run: |
# Set-Location src\HASS.Agent
# Get-Childitem

#draft a release, https://github.com/actions/create-release
# Draft a release, https://github.com/actions/create-release
publish:
runs-on: ubuntu-latest
needs: [build]
Expand All @@ -184,43 +228,62 @@ jobs:
mkdir HASS.Agent
mkdir HASS.Agent.Satellite.Service
mkdir HASS.Agent.Installer
mkdir HASS.Agent.x86
mkdir HASS.Agent.Satellite.Service.x86
mkdir HASS.Agent.Installer.x86
ls -la

- name: Download Build Artifacts (HASS Agent)
# x64 download
- name: Download Build Artifacts x64 (HASS Agent)
uses: actions/download-artifact@v4.1.8
with:
name: HASS.Agent
path: HASS.Agent

- name: Download Build Artifacts (HASS Agent Satellite Service)
- name: Download Build Artifacts x64 (HASS Agent Satellite Service)
uses: actions/download-artifact@v4.1.8
with:
name: HASS.Agent.Satellite.Service
path: HASS.Agent.Satellite.Service

- name: Download Build Artifacts (HASS Agent Installer)
- name: Download Build Artifacts x64 (HASS Agent Installer)
uses: actions/download-artifact@v4.1.8
with:
name: HASS.Agent.Installer
path: HASS.Agent.Installer

# x86 download
- name: Download Build Artifacts x86 (HASS Agent)
uses: actions/download-artifact@v4.1.8
with:
name: HASS.Agent.x86
path: HASS.Agent.x86

- name: Download Build Artifacts x86 (HASS Agent Satellite Service)
uses: actions/download-artifact@v4.1.8
with:
name: HASS.Agent.Satellite.Service.x86
path: HASS.Agent.Satellite.Service.x86

- name: Download Build Artifacts x86 (HASS Agent Installer)
uses: actions/download-artifact@v4.1.8
with:
name: HASS.Agent.Installer.x86
path: HASS.Agent.Installer.x86


- name: Compress HASS Agent directories for manual install
run: |
cd HASS.Agent
ls -la
zip -r HASS.Agent.zip ./
cd ../
cd HASS.Agent.Satellite.Service
zip -r HASS.Agent.Standalone.zip HASS.Agent HASS.Agent.Satellite.Service HASS.Agent.x86 HASS.Agent.Satellite.Service.x86
ls -la
zip -r HASS.Agent.Satellite.Service.zip ./

- name: Create Draft Release and Upload Build Artifacts
uses: ncipollo/release-action@v1.10.0
uses: ncipollo/release-action@v1.15.0
with:
name: ${{ github.event.inputs.releasetitle }}
draft: true
prerelease: ${{ github.event.inputs.prerelease }}
tag: ${{ github.event.inputs.releasetag }}
artifacts:
HASS.Agent/HASS.Agent.zip,HASS.Agent.Satellite.Service/HASS.Agent.Satellite.Service.zip,HASS.Agent.Installer/HASS.Agent.Installer.exe
HASS.Agent.Installer/HASS.Agent.Installer.exe,HASS.Agent.Installer.x86/HASS.Agent.Installer.x86.exe,HASS.Agent.Standalone.zip
60 changes: 45 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/hass-agent/HASS.Agent)](https://github.com/hass-agent/HASS.Agent/releases/)
[![license](https://img.shields.io/badge/license-MIT-blue)](#license)
[![OS - Windows](https://img.shields.io/badge/OS-Windows-blue?logo=windows&logoColor=white)](https://www.microsoft.com/ "Go to Microsoft homepage")
[![dotnet](https://img.shields.io/badge/.NET-6.0-blue)](https://img.shields.io/badge/.NET-6.0-blue)
[![dotnet](https://img.shields.io/badge/.NET-8.0-blue)](https://img.shields.io/badge/.NET-8.0-blue)
![GitHub all releases](https://img.shields.io/github/downloads/hass-agent/HASS.Agent/total?color=blue)
![GitHub latest](https://img.shields.io/github/downloads/hass-agent/HASS.Agent/latest/total?color=blue)
[![Discord](https://img.shields.io/badge/dynamic/json?color=blue&label=Discord&logo=discord&logoColor=white&query=presence_count&suffix=%20Online&url=https://discord.com/api/guilds/1173033284519862392/widget.json)](https://discord.com/invite/JfZj98xqJr)

<a href="https://github.com/LAB02-Research/HASS.Agent/">
<img src="https://raw.githubusercontent.com/LAB02-Research/HASS.Agent/main/images/logo_128.png" alt="HASS.Agent logo" title="HASS.Agent" align="right" height="128" /></a>
<a href="https://github.com/hass-agent/HASS.Agent/">
<img src="https://raw.githubusercontent.com/LAB02-Research/HASS.Agent/main/images/logo_128.png" alt="HASS.Agent logo" title="HASS.Agent" align="right" height="128" />
</a>

# HASS.Agent

HASS.Agent is a Windows-based client (*companion*) application for [Home Assistant](https://www.home-assistant.io), developed in .NET 6.
HASS.Agent is a Windows-based client (*companion*) application for [Home Assistant](https://www.home-assistant.io), developed in .NET 8.

Click [here](https://github.com/hass-agent/HASS.Agent/releases/latest/download/HASS.Agent.Installer.exe) to download the latest installer.

Expand Down Expand Up @@ -52,6 +53,14 @@ The original HASS.Agent has been created by [Sam](https://github.com/LAB02-Admin

Unfortunately due to some time constraints, they're not able to provide the constant support and feature updates. That's where we step in - trying to keep HASS.Agent bug free (dreams need to be big right?) and to introduce new features here and there!

#### Note on the organization and project name
*"Why this project is named the same as original HASS.Agent, it's confusing"*

Yes, I agree, you're right. The initial idea after Sam's disappearance was to continue the work and offer it to Sam once they're back.
Well, now that's more than unlikely since it's been quite a long time we last spoke with Sam.

Knowing what we do now, we've probably made a different decision but doing it now it'll only create more confusion. We have a full rewrite project going and it has been already decided the name is going to be altered.

----

### Functionality
Expand All @@ -72,7 +81,7 @@ Summary of the core functions:

* **WebView**: quickly show any website, anywhere - no browser required, for instance a HA dashboard.

* **Satellite Service**: use the service to collect sensordata and execute commands, even when you're not logged in (**not all commands/sensors are available for Satellite Service**)
* **Satellite Service**: use the service to collect sensor data and execute commands, even when you're not logged in (**not all commands/sensors are available for Satellite Service**)

* All entities are dynamically acquired from your Home Assistant instance.

Expand All @@ -88,8 +97,8 @@ Notification examples:


![image](https://user-images.githubusercontent.com/81011038/199956334-642def7d-4cb4-46f3-a73b-25c76e5bd02c.png)
![Text-based toast notification](https://raw.githubusercontent.com/LAB02-Research/HASS.Agent/main/images/hass_agent_toast_text.png)
![261428315-fa66e0cf-bd41-49d6-956c-864eec4bcc70](https://github.com/amadeo-alex/HASS.Agent/assets/68441479/c7e35fb1-59ea-4077-983e-916735dd3901)
![Text-based toast notification](https://raw.githubusercontent.com/LAB02-Research/HASS.Agent/main/images/hass_agent_toast_text.png)


WebView example, showing a dashboard when right-clicking the tray icon:
Expand Down Expand Up @@ -124,11 +133,11 @@ You'll be guided through the configuration options during onboarding:

### Installation

Installing HASS.Agent is easy; just [download the latest installer](https://github.com/hass-agent/HASS.Agent/releases/latest/download/HASS.Agent.Installer.exe), run it and you're done! The installer is signed by us and won't download or do weird stuff - it just places everything where it should, and launches with the right parameter. (optionally installing .NET6)
Installing HASS.Agent is easy; just [download the latest installer](https://github.com/hass-agent/HASS.Agent/releases/latest/download/HASS.Agent.Installer.exe), run it and you're done! The installer is signed by us and won't download or do weird stuff - it just places everything where it should, and launches with the right parameter. (optionally installing .NET8)

After installing, the onboarding process will help you get everything configured, step by step. If you want an introduction into HASS.Agent, be sure to read the [introduction docs](https://www.hass-agent.io/latest/getting-started/).

Original HASS.Agent documentation is available [here](https://hassagent.readthedocs.io/en/latest/introduction/) - please bear in mind however that it may not represent state of things present in this version.
Original HASS.Agent documentation is available [here](https://www.hass-agent.io/latest/getting-started/#introduction) - please bear in mind however that it may not represent state of things present in this version.

[Click here to download the latest installer](https://github.com/hass-agent/HASS.Agent/releases/latest/download/HASS.Agent.Installer.exe)

Expand Down Expand Up @@ -158,19 +167,23 @@ If you want to help with the development of HASS.Agent, check out the [Helping O

### Articles

### Original HASS.Agent
### Original HASS.Agent by Sam/LAB02 Research

Liam Alexander Colman from [Home Assistant Guide](https://home-assistant-guide.com) was kind enough to write an article about HASS.Agent: [Integrate Home Assistant with Windows using HASS.Agent](https://home-assistant-guide.com/2022/04/20/integrate-home-assistant-with-windows-using-hass-agent/). The website's full of useful articles, worth having a look :)

----

### What it's not

A Linux/macOS client!
A Linux/macOS client (at least yet)!

Without getting into much of the details, it's not as easy as you think.

With HASS.Agent "2.X" version it's basically impossible. We are thinking about cross-platform support for the "v3 rewrite" but as of now it's only a hopeful wish.

This question comes up a lot, understandably. However it's currently focussed on being a Windows-based client. Even though .NET 6 allows for Linux/macOS development, it's not as easy as pressing a button. The interface would have to be redesigned from the ground up, sensors and commands would need multiple codebases for each OS, testing would take way more time, every OS handles notifications differently, etc.
You can try the [official companion app](https://apps.apple.com/us/app/home-assistant/id1099568401) for macOS, or [IoPC](https://github.com/maksimkurb/IoPC) which runs on Linux.

You can use the [official companion app](https://apps.apple.com/us/app/home-assistant/id1099568401) for macOS, or [IoPC](https://github.com/maksimkurb/IoPC) which runs on Linux. Note: We haven't tested either.
#### Note: We haven't tested either and we do not track the development efforts.

----

Expand All @@ -180,6 +193,21 @@ The best way to help out is to test as much as you can (or even join the beta pr

Same goes for sharing ideas for new (or improved) functionality! If you want, you can [join on Discord](https://discord.com/invite/JfZj98xqJr) to discuss your ideas.

#### Feature PR Submissions

While all feature PR submissions are welcome, please note that their merging is at ***sole discretion*** of the main developers.

When designing the new feature please take into account:
- **how they fit with the codebase/codestyle** (yes, we are aware the codebase has it's flaws - hence the rewrite efforts)
- **is the feature agnostic enough and will benefit all users**
- **the smaller the PR the better the chance of it being merged**

#### AI Usage

Fully "vibe-coded" submissions will most likely be rejected.

While personal opinions on AI usage and it's impact can vary person-to-person, we'd rather put the effort writing code than reviewing fully AI generated and copy-pasted code.

----

### Credits and Licensing
Expand Down Expand Up @@ -208,12 +236,14 @@ Everything on the HASS.Agent platform is released under the [MIT license](https:

### Legacy

HASS.Agent is a .NET 6 application. If for some reason you can't install .NET 6, you can use the last .NET Framework 4.8 version:
HASS.Agent is a .NET 8 application. If for some reason you can't install .NET 8, you can use the last .NET Framework 4.8 version also developed by Sam:

[v2022.3.8](https://github.com/LAB02-Research/HASS.Agent/releases/tag/v2022.3.8)

It's pretty feature complete if you just want commands, sensors, quickactions and notifications.
Per it's release time it was pretty feature complete if you just want commands, sensors, quickactions and notifications.

You'll need to have .NET Framework 4.8 installed on your PC, which you can [download here](https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net48-web-installer).

If you find any bugs, feel free to [create a ticket](https://github.com/LAB02-Research/HASS.Agent/issues) and I'll try to patch it.
#### Please note
- .NET Framework version is considered legacy and unsupported
- All issues/requests regarding the .NET Framework version of HASS.Agent will be closed
Binary file added assets/logo_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/new_quickaction_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/new_sensor_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/notification_example_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/notification_example_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/notification_example_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/quickactions_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/satellite_config_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sensors_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/webview_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading