GithubHelp home page GithubHelp logo

fillefilip8 / hass.agent-notifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lab02-research/hass.agent-notifier

0.0 1.0 0.0 75 KB

HASS.Agent Notifier integration. Adds notifications to HASS.Agent - a Windows based client for Home Assistant.

License: MIT License

Python 100.00%

hass.agent-notifier's Introduction

Validate GitHub release License buymeacoffee Discord

hacs_badge

HASS.Agent Notifier

This Home Assistant integration allows you to send notifications to HASS.Agent, a Windows-based Home Assistant client.

Need help? Check the documentation, 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

Currently, it's possible to send normal (text-based) and image notifications.


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:

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

  action:
    - service: notify.hass_agent_test_device
      data:
        message: "This is a test message."

Text notification with title and duration

  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

  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 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:

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:

Script Test Notification

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

Script Test Image 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. It'll help you troubleshoot common problems, and provide some examples.


Debugging

Note: make sure you check the documentation 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:

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:

Debug Output

If not, please open a ticket and post your log output.


License

HASS.Agent Notifier and HASS.Agent are released under the MIT license.

hass.agent-notifier's People

Contributors

lab02-admin avatar fillefilip8 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.