Restructuring complete. Timeouts on popups. Fully Kiosk compatibility.
This commit is contained in:
71
README.md
71
README.md
@@ -7,10 +7,11 @@ A Home Assistant integration to turn your browser into a controllable entity - a
|
||||
|
||||
## Example uses
|
||||
|
||||
- Make the camera feed from your front door pop up on the tablett in your kitchen when someone rings the doorbell.
|
||||
- Make the camera feed from your front door pop up on the tablet in your kitchen when someone rings the doorbell.
|
||||
- Have a message pop up on every screen in the house when it's bedtime.
|
||||
- Make the browser on your workstation switch to a specific tab when the kitchen light is on after midnight
|
||||
- Play a TTS message on your work computer when the traffic sensor tells you it's time to go home.
|
||||
- Display a full screen clock on your screen if no one's touched it for five minutes
|
||||
|
||||
# Installation instructions
|
||||
|
||||
@@ -49,38 +50,73 @@ Since the deviceID can be a bit hard to remember for devices you use often, you
|
||||
browser_mod:
|
||||
devices:
|
||||
99980b13-dabc9563:
|
||||
name: Arrakis
|
||||
name: arrakis
|
||||
d2fc860c-16379d23:
|
||||
name: dashboard
|
||||
```
|
||||
This binds the *aliases* `Arrakis` to `99980b13-dabc9563` and `dashboard` to `d2fc860c-16379d23`.
|
||||
This binds the *aliases* `arrakis` to `99980b13-dabc9563` and `dashboard` to `d2fc860c-16379d23`.
|
||||
|
||||
Note: Aliases must be unique.
|
||||
|
||||
## media\_player
|
||||
Once `browser_mod` is installed, loading up your Home Assistant frontend on a new *device* will create a new `media_player` device.
|
||||
## Entities
|
||||
Once `browser_mod` is installed, loading up your Home Assistant frontend on a new *device* will create three or four new devices.
|
||||
|
||||
Any sound played on this media player will be played by the *device*.
|
||||
- `sensor.<device>`
|
||||
- `media_player.<device>`
|
||||
- `light.<device>`
|
||||
- If you're using Fully Kiosk Browser `binary_sensor.<device>`
|
||||
|
||||
The `media_player` entity also has some extra attributes presenting the current state of the *device*.
|
||||
`<device>` here will be the `deviceID` of the *device* but with the dash (`-`) replaced by an underscore (`_`). If you've defined an alias, it will be that instead.
|
||||
|
||||
E.g:
|
||||
Connecting your phone with `deviceID: ded3b4dc-abedd098` will create the entities `sensor.ded3b4dc_abedd098`, `media_player.ded3b4dc_abedd098` and `light.ded3b4dc_abedd098`.
|
||||
Connecting with the computer named `Arrakis` above with `deviceID: 99980b13-dabc9563` will create the entities `sensor.arrakis`, `media_player.arrakis` and `light.arrakis`.
|
||||
|
||||
### sensor
|
||||
|
||||
The `sensor` will display the number of connected views (tabs/windows) of the device. Note that using multiple view isn't really recommended, and any action targeting a device will happen in the last loaded view.
|
||||
|
||||
The sensor also has the following attributes:
|
||||
|
||||
| attribute | content |
|
||||
| --- | --- |
|
||||
| `type` | `browser_mod` |
|
||||
| `last_seen` | The time when the *device* was last seen |
|
||||
| `deviceID` | The deviceID of the *device*. |
|
||||
| `path` | The currently displayed path on the *device*. |
|
||||
| `visibility` | Whether the frontend is currently visible on the *device*. |
|
||||
| `userAgent` | The User Agent of the associated browser. |
|
||||
| `currentUser` | The user currently logged in on the *device*. |
|
||||
| `blackout` | Whether the view on the *device* is currently blacked out (see below). |
|
||||
| `fullyKiosk` | True if the *device* is a Fully Kiosk browser. Undefined otherwise. |
|
||||
| `width` | The current width of the browser window in pixels. |
|
||||
| `height` | The current height of the browser window in pixels. |
|
||||
|
||||
**NOTE: Because apple is apple; on iOS you need to touch the screen once after loading the frontend before any playback will work.**
|
||||
### media\_player
|
||||
|
||||
The `media_player` can be used to play sounds on the *device*.
|
||||
|
||||
**NOTE: Because Apple is Apple; on iOS you need to touch the screen once after loading the frontend before any playback will work.**
|
||||
|
||||
### light
|
||||
|
||||
The `light` can be used to blackout the screen.
|
||||
For Fully Kiosk Browser, the screen will actually turn off.
|
||||
For other browsers, the interface will just be covered with black (the screen is still on, will have a visible glow in the dark, and you won't save any battery).
|
||||
|
||||
### binary\_sensor
|
||||
|
||||
The `binary_sensor` will only be available for Fully Kiosk Browser PRO *devices*.
|
||||
It's state will be the state of the camera motion detector of the *device* (5 second cooldown).
|
||||
|
||||
## `browser_mod.command` service
|
||||
|
||||
Call the `browser_mod.command` service to control your *device* in various ways.
|
||||
|
||||
All service calls have two parameters in common, `command` which is the command to execute, and `deviceID` which is a list of *devices* to execute the command on. If `deviceID` is omitted, the command will be executed on **all** currently connected *devices*.
|
||||
All service calls have two parameters in common, `command` which is the command to execute, and `deviceID` which is a list of *devices* to execute the command on. If `deviceID` is omitted, the command will be executed on **all** currently connected *devices*. `deviceID` may also contain aliases.
|
||||
|
||||
`deviceID` may also contain aliases, and there's a special alias named `this` which will evaluate to the *device* from which a command was initiated (if from the frontend).
|
||||
There is a special function that will replace the special alias `this` with the current deviceID in the list `deviceID` for any service call from the frontend. In the examples below it will be shown used for the `browser_mod.command` service, but it also works e.g for calling scripts from the frontend.
|
||||
|
||||
All examples below are given in the syntax used for calling them from lovelace via e.g. an entity-button card with `tap_action:` set to `call-service`. If you call the service from a script or an automation, the syntax will be slightly different.
|
||||
|
||||
### debug
|
||||
|
||||
@@ -90,7 +126,7 @@ service_data:
|
||||
command: debug
|
||||
```
|
||||
|
||||
Display a popup with the deviceID *and* a javascript allert with the deviceID on all connected *devices*.
|
||||
Display a popup with the deviceID *and* a javascript alert with the deviceID on all connected *devices*.
|
||||
|
||||
### set-theme
|
||||
|
||||
@@ -153,8 +189,9 @@ will display the specified `entities` card as a popup on the current device.
|
||||

|
||||
|
||||
The optional parameter `large: true` will make the popup wider.
|
||||
The optional parameter `style:` will apply css style options to the popup.
|
||||
The optional parameter `style:` will apply CSS style options to the popup.
|
||||
The optional parameter `auto_close: true` will make the popup close automatically when the mouse is moved or a key is pressed on the keyboard. This also removes the header bar.
|
||||
The optional parameter `time:` (only useable if `auto_close: true` is also set) will turn the popup into a "screensaver". See the `blackout` command below.
|
||||
|
||||
Ex:
|
||||
```yaml
|
||||
@@ -185,6 +222,8 @@ service_data:
|
||||
Will cover the entire window (or screen if in full screen mode) with black.
|
||||
Moving the mouse, touching the screen or pressing any key will restore the view.
|
||||
|
||||
The optional parameter `time:` will make the blackout turn on automatically after the specified number of seconds. It works kind of like a screensaver and will keep turning on until `blackout` is called again with `time: -1`.
|
||||
|
||||
Note: This will *not* turn off your screen backlight. Most screens will still emit light in a dark room.
|
||||
|
||||
### no-blackout
|
||||
@@ -224,7 +263,7 @@ The player card also displays the `entityID`. Click it to select, so you can cop
|
||||
# Fully Kiosk Browser
|
||||
If you are using a device running [Fully Kiosk Browser](https://www.ozerov.de/fully-kiosk-browser/) (PLUS version only) you will have access to a few more functions.
|
||||
|
||||
First of all the commands `blackout` and `no-blackout` will controll the devices screen directly.
|
||||
First of all the commands `blackout` and `no-blackout` will control the devices screen directly.
|
||||
`no-blackout` also has an optional parameter `brightness` that can set the screen brightness between 0 and 255.
|
||||
|
||||
Second, there are a few more attributes available
|
||||
@@ -257,7 +296,7 @@ This actually means it pretty much replaces `popup-card` as well.
|
||||
- This works even if the currently logged in user is not in the admin group.
|
||||
|
||||
### Does this replace lovelace-fullykiosk
|
||||
It will, eventually.
|
||||
Yes. You need the paid version, btw.
|
||||
|
||||
### Can the deviceID be used to track me across the internet
|
||||
|
||||
@@ -269,7 +308,7 @@ Some of [my lovelace plugins](https://github.com/thomasloven/hass-config/wiki/My
|
||||
|
||||
### How do I run commands from /dev-service?
|
||||
|
||||
`/dev-service` requires json-formated service data. There's an explanation on the differences between yaml and json [here](http://thomasloven.com/blog/2018/08/YAML-For-Nonprogrammers/).
|
||||
`/dev-service` requires json-formatted service data. There's an explanation on the differences between yaml and json [here](http://thomasloven.com/blog/2018/08/YAML-For-Nonprogrammers/).
|
||||
|
||||
---
|
||||
<a href="https://www.buymeacoffee.com/uqD6KHCdJ" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/white_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
|
||||
|
||||
Reference in New Issue
Block a user