https://github.com/lab02-research/hass.agent-notifier
HASS.Agent Notifier integration. Adds notifications to HASS.Agent - a Windows based client for Home Assistant.
https://github.com/lab02-research/hass.agent-notifier
hacs home-assistant integration notifications
Last synced: about 1 year ago
JSON representation
HASS.Agent Notifier integration. Adds notifications to HASS.Agent - a Windows based client for Home Assistant.
- Host: GitHub
- URL: https://github.com/lab02-research/hass.agent-notifier
- Owner: LAB02-Research
- License: mit
- Created: 2021-11-24T10:29:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-17T13:29:03.000Z (over 3 years ago)
- Last Synced: 2023-03-05T17:49:43.025Z (about 3 years ago)
- Topics: hacs, home-assistant, integration, notifications
- Language: Python
- Homepage:
- Size: 43.9 KB
- Stars: 67
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/LAB02-Research/HASS.Agent-Notifier/actions?query=workflow:"Validate")
[](https://github.com/LAB02-Research/HASS.Agent-Notifier/releases/)
[](#license)
[](https://www.buymeacoffee.com/lab02research)
[](https://discord.gg/nMvqzwrVBU)
[](https://github.com/hacs/integration)
# HASS.Agent Notifier
⚠️❗**YOU DON'T NEED THIS INTEGRATION IF YOU'RE USING THE NEW [HASS.AGENT](https://github.com/LAB02-Research/HASS.Agent-Integration) INTEGRATION!** ❗⚠️
----
Note: this integrations has been replaced by the [new integration](https://github.com/LAB02-Research/HASS.Agent-Integration). It will keep working, but for new functionality, consider switching to the new one.
----
This Home Assistant integration allows you to send notifications to HASS.Agent, a Windows-based Home Assistant client.
Need help? Check [the documentation](https://hassagent.readthedocs.io/), visit the dedicated HA forum thread or join on Discord.
Note: it won't be of much use if you don't have HASS.Agent installed & configured on at least one PC (or Windows based device).
----
### Contents
* [Functionality](#functionality)
* [Installation](#installation)
* [Configuration](#configuration)
* [Installation and Configuration Summary](#installation-and-configuration-summary)
* [Usage](#usage)
* [Help](#help)
* [Debugging](#debugging)
* [License](#license)
----
### Functionality
Send normal (text-based) and image notifications, and configure them to be *actionable* to directly interact with Home Assistant.
----
### Installation
The easiest way to install is to use HACS. Simply search for **HASS.Agent Notifier**, install and restart Home Assistant.
If you want to manually install, copy the `hass_agent_notifier` folder into the `config\custom_components` folder of your Home Assistant instance, and restart.
----
### Configuration
This integration exposes itself as a notifications integration, and can be configured by adding this snippet in your `configuration.yaml` file:
```yaml
notify:
name: "hass agent test device"
platform: hass_agent_notifier
resource: http://{device_ip}:5115/notify
```
Replace `{device_ip}` with the IP of the device that has an HASS.Agent instance running. To find your IP, run `ipconfig` in a command prompt on your PC. Look for the value after `IPv4 Address`. Optionally replace `5115` if you've configured a different port, normally you shouldn't have to.
Restart Home Assistant to load your configuration.
The port needs to be open on the target device. HASS.Agent will offer to do this for you during the onboarding process.
To do so manually, you can run this command in an elevated prompt:
`netsh advfirewall firewall add rule name="HASS.Agent Notifier" dir=in action=allow protocol=TCP localport=5115`
----
### Installation and Configuration Summary
Quick summary to get things working:
- Install **HASS.Agent-Notifier** integration, either through HACS or manually
- Reboot Home Assistant
- Create a `notify` entity, make sure you enter the right IP for your PC
- Reboot Home Assistant
- Start adding the new entity to your automations & scripts :)
----
### Usage
#### General
Currently, there are four variables you can set:
* `message`: the message you want to show
* `title`: the title of your popup [optional]
* `image`: http(s) url containing the location of an image [optional]
* `duration`: duration (in seconds) for which the popup will be shown [optional]
#### Text notification
```yaml
action:
- service: notify.hass_agent_test_device
data:
message: "This is a test message."
```
#### Text notification with title and duration
```yaml
action:
- service: notify.hass_agent_test_device
data:
message: "This is a test message with title and 3 sec duration."
title: "HASS.Agent Test"
data:
duration: 3
```
#### Image notification
```yaml
action:
- service: notify.hass_agent_test_device
data:
message: "This is a test message with an image."
data:
image: "http://10.0.0.6:1234/jpeg/image.jpg"
```
#### Camera Proxy
As pointed out by [@brianhanifin]( https://github.com/brianhanifin ) in this issue, you can also use Home Assistant's camera proxy. This way you don't have to share the credentials etc. of your camera. Home Assistant will provide a token that's valid for 5 minutes, so it's safe to use.
Example script:
```yaml
notification_test:
alias: Notification Test
variables:
image: |
{%- set image = "http://hass.local:8123" + state_attr("camera.garden","entity_picture") %}
{{ image }}
sequence:
- service: notify.hass_agent_test
data:
title: Test
message: "This is a test message with an image."
data:
image: "{{ image }}"
mode: single
icon: mdi:bell
```
Optionally change `hass.local` to the mDNS/IP of your Home Assistant instance, and change `garden` to the name of your camera - or use another variable as provided in the linked issue.
#### Script GUI examples
This is the sequence part of a test script to send a text-only message, created through the Home Assistant GUI:

This is the same script, but with an image added to the notification:

You can use the new Button Card to trigger your test scripts.
----
### Help
There's a section dedicated to notification support in [the documentation](https://hassagent.readthedocs.io/). It'll help you troubleshoot common problems, and provide some examples.
----
### Debugging
**Note: make sure you check [the documentation](https://hassagent.readthedocs.io/) for common troubleshooting help.**
If something's not working as it should, while everything's configured and HASS.Agent isn't showing any errors in its logs, browse to the following URL from another PC on the same network as HASS.Agent: `http://{hass_agent_ip}:5115`. Make sure to change `{hass_agent_ip}` to the IP of the PC where HASS.Agent's installed.
If HASS.Agent is configured and the firewall rule's active, you'll see: `HASS.Agent Active`.
If not, something is blocking access to HASS.Agent. Add the following snippet to your configuration.yaml to enable debug logging for the integration:
```yaml
logger:
default: warning
logs:
custom_components.hass_agent_notifier: debug
```
Reboot Home Assistant. Whenever you send a message, this should show up in your logs:

If not, please open a ticket and post your log output.
----
### License
HASS.Agent Notifier and HASS.Agent are released under the MIT license.