thomasloven / hass-browser_mod Goto Github PK
View Code? Open in Web Editor NEW๐น A Home Assistant integration to turn your browser into a controllable entity and media player
License: MIT License
๐น A Home Assistant integration to turn your browser into a controllable entity and media player
License: MIT License
I have 2 browser devices. How can I select the device to use with this card:
browser-player
I have a few Kindle Fire tablets mounted to the wall. Instead of turning the screen off completely, I'm using Fully Kiosk Browser's Screensaver feature to set the screen to all black and set the brightness to 0. This way I can just tap the screen to wake it back up, instead of needing to hit the lock button.
Could you add an option to either customize what the blackout services do, or add a separate service for fully to start and end the screensaver?
Love the new toast feature. Its the notification system that HA is missing. Would be great if there was an option to include a button that could call a script. This would allow user to act upon different notifications. You can also have toast display time remaining before it's dismissed.
For example I can have it come up when house alarm is being activated with an option to cancel.
I don't now if it's an error, a bug and I don't know even if it's the browser-mod's fault or not so sorry if it's false alarm.
I'm using Hass.io on an Intel NUC with Ubuntu on docker.
HA version 0.103.6
Browser Mod version 15 via HACS
The problem occurs on different browsers: Chrome, Firefox, Fully Kiosk Browser.
Description:
Basically on a page error (I have a camera stream and when the camera disconnects the page gets an error, but not only on camera error.) in developer tools I see this log:
connection-mixin.ts:82 Uncaught (in promise) {type: "result", success: false, error: {โฆ}}
callService @ connection-mixin.ts:82
async function (async)
callService @ connection-mixin.ts:57
e.callService @ browser_mod.js:56
Et @ button-card.js:801
_handleTap @ button-card.js:1720
handleEvent @ button-card.js:243
N.__boundHandleEvent @ button-card.js:232
n @ button-card.js:824
As a result the Custom Header not reloads correctly the header and the whole page is miss formatted. Already submitted this error to Custom Header with the response that probably it's not a Custom Header related error. (see attached file. Sorry for the cut out... sensitive information.)
Hard to explain for me, so some pictures.
Opening a popup with this code from a custom button after browser refresh (CTRL-F5).
type: custom:button-card
entity: sensor.pn_count
color: var(--my-icon-off)
icon: mdi:bell-outline
styles:
label:
- font-size: 14px
show_name: false
show_label: true
label: >
[[[ return 'PN (' + entity.state + ')' ]]]
tap_action:
action: >
[[[
if (entity.state == 0)
return "none";
return "call-service";
]]]
service: browser_mod.command
service_data:
command: popup
title: Persistent Notifications
style:
border-radius: 15px
width: 500px
background: rgba(38, 49, 55, 0.8)
color: var(--my-orange)
card:
type: custom:home-feed-card
#title: Home Feed
show_empty: false
show_notification_title: true
style: |
ha-card {
background: transparent;
}
deviceID:
- this
Shows a big bar with an X for closing, which wasn't there before, and a gap on top of the card.
After closing it, i open a normal more-info dialog.
Now if i open the popup once again, the entity of the more-info shows in popup-card.
I see this issue on all my popups.
Hey, it would be awesome if you could use the device's webcam as a camera entity in home-assistant!
First of amazing plugin! It's a staple in my home automation.
Quick suggestion, anyway you can add a prefix to the generated id's. This would make it easier to figure out that these media player devices belong to Browsermod. You usually run the detect command once, but new devices appear on the network often so I always have some unknown browsermod entities floating around.
Adding a prefix like mod- to device id would help targeting devices. It would be "media_player.mod-1daa8134_e62fdffe" this would allow for customization and regex targeting in HA config.
For example if I don't want to see any of the added browser_mod media players in my Alexa I can just exclude everything with media_player.mod-* Right now there are about 50 browsermod entities in alexa (since it doesn't clear them it just adds them).
Or if I want all of my browser_mod players to have unique icon in lovelace it will be easy to target them as well.
Maybe the prefix can be followed by first thing that's after the "(" in user agent. So _userAgent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148_
would add prefix iPhone to the name as well.
Thank you so much for considering this!
I'm using fully kiosk on a huawei mediapad t5 and fully kiosk is not recognised:
type: browser_mod last_seen: 2020-01-17T12:45:53.601838
deviceID: a016c808-d5f31950
path: /lovelace/beneden
visibility: visible
userAgent: Mozilla/5.0 (Linux; Android 8.0.0; AGS2-W09 Build/HUAWEIAGS2-W09; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.116 Safari/537.36
currentUser: home
width: 1054 height: 659
On my previous tablet fully was recognised. Is there anything I can check?
HA 0.96.3, browser_mod 5, latest FF on Ubuntu
Command popup-close works, but raises error:
2019-07-22 11:31:37 ERROR (MainThread) [frontend.js.latest.201907210] http://192.168.123.67:8123/browser_mod.js:56:2919 Uncaught TypeError: Cannot read property 'close' of undefined
Tested and confirmed with script:
script:
test_popup:
sequence:
- service: browser_mod.command
data:
command: popup
title: Popup example
card:
type: entities
entities:
- light.bed_light
- light.kitchen_lights
- light.ceiling_lights
deviceID:
- d516918a-f3009bc7
- delay: '00:00:05'
- service: browser_mod.command
data:
command: close-popup
I love this custom component. I love the blackout mode but I would love to make it show something else other than a black screen. like the time, notifications (of hass), calendar, etc. If this is possible with the popup feature then can you please guide me. Thanks
i've created an automation that changes the brightness of my dashboard screen based on the others light in the room. it works and the device changes his brightness but the entity doesn't ... any fix?
I have two wall-mounted Android tablets that are unable to access Home-Assistant after upgrading to release 14. Everything works as intended once I downgrade back to 13.2. I have no issues on my Android phone or any other devices (PCs).
I have two wall-mounted Lenovo Tab2-X30F with Android 6.0.1 running the latest version of Chrome/Webview. After upgrading they are stuck on "Loading data..." without ever finishing. I've tried to remove all cache/webstorage data and reboot the two devices without any luck. Downgrading to version 13.2 of browser_mod solves the loading issue. Any ideas?
When I specify a device to target with a command, the command still hits all available devices. I've tried several variations in the json and may still not have it right.
I have tried it using "deviceid", "deviceID", "device_id" and others. I've tried it with just the numeric portion for the device ID itself etc.
Can anyone help with a working snippet?
(This snippet works but hits all available devices)
{
"command": "navigate",
"navigation_path" : "/lovelace/3",
"device": "media_player.d23fd46-be4572f9"
}
It would be useful in backend automation development if you add sensor, which will show current device ids as List!
How can this entity be removed ? It has nothing related to lights. Should be a configuration option to enable/disable this feature.... is there????
It would be useful if the popup card closes itself after a determined time.
How should i write the script in the front-end to use the "deviceId"?
this work:
{ "command": "blackout" }
this do not work:
{ "command": "blackout", "deviceID": "my_device" }
which one is the right syntax to use?
Coming from popup-cards. Is it possible to cause a popup from tapping a card that doesn't support tap-actions? In popup-cards I could use the weather card or mini-graph-card and tapping them would bring up a popup. Since neither of these support tap_actions (that I know of?), I'm not sure how/if this is possible.
edit: mini-graph-card does have a tap_action feature, but haven't gotten it to work yet, still playing with it. The question still stands for the built in weather-forcast card, though.
Now that the popup-card is marked deprecated, i have multiple defined popup-cards that replaced the more-info dialog from some sensors.
That is very usefull if you have the sensors on multiple views.
In browser_mod it seems that i have to define the more-info popup on every entity/button that should show the more-info dialog.
Thanks in advance!
The browser_mod camera is working fine, thank you very much.
I wonder if it would be possible to be able to somehow select (I know, you only did implement the module, but appetite raises :)), which camera would be activated, in case device has more than 1 camera attached and if there is a command to activate camera. At the moment, once you accept the camera being activated, it stays active all the time as long as HA is opened.
EDIT: I have just realized, the camera being used depends on user selection in the browser. So only the second question stays.
Hi,
I'm using Hass.io with browser_mod on a Huawei tablet with Fully (PLUS) with enabled camera access, javascript frontend, and almost everything what i can. In the configuration.yaml:
browser_mod:
prefix: "browser_"
devices:
mydeviceid:
name: my terminal device
camera: true
On the brwoser terminal there is no error, and I can reach every other sensor, binary sensor from this device. Even motion detection!
I have several other generic cameras and those are configured and present in system. Only the camera.my_terminal_device is not showing.
Of course I rebboted the Hass.io, the terminal device after evrey settings change.
In the Fully, (or even in Chrome) the HomeAssistant website is not asking permission for the webcam and/or the microphone. I use it on http.
What am I missing?
Thanks,
Gabor
i use the same sample in the Cookbook.
i was unable to "Displaying a popup via a script" if i use "deviceID: this" as the deviceID in the script, even i run the script directly. But it is working fine if i use the browser's deviceID directly ,
for example" deviceID: 3ads72oj-3jf87rdm"
May be HA cannot recognize "this" of the deviceID in the script???
test_popup:
sequence:
- service: browser_mod.popup
data_template:
deviceID: this <<<< cannot
deviceID: 3ads72oj-3jf87rdm <<<< can
title: Testing script
card:
type: entities
entities:
- light.bed_light
Is there a way to delete entities? I have about 10 of them that accumulated over 2 weeks. Also it looks like once you assign an alias to an entity you can't change the entity to something else you have to create another unique alias.
For example if I assign xxxx_xxxx to ipad and that browser changes then I can't update the ipad alias to the new entity. Some command to purge entities that are in the "unknown" state would be great :)
I am trying to disable the Light entity for all of my devices, but it doesn't seem to be working.
This is what i have in my config:
browser_mod:
prefix: "browser_"
devices:
c18c68f5_a8169add:
name: browser_brodie_macbook_pro
disable:
- light
8551be6a_aab7701b:
name: browser_brodie_iphone
disable:
- light
Both entities still show up in HA
Hi
Can't get browser_mod.lovelace_reload service to work. I have tried it from HA service menu as well as from an automation and can't get it to work. Just for my understanding, I assume that you don't give any service data to browser_mod.lovelace_reload like DeviceId or so.
Best regards Peter
possibility to have a switch that toggles the screensaver functionality in Fully kiosk.
use cases: when nobody is home start screensaver mode
Closely related to #12 but it would be cool if we could target an existing lovelace card for a more-info or pop-up, e.g.:
type: entities
entities:
- entity: climate.hallway
tap_action:
action: call-service
service: browser_mod.popup
service_data:
defined_card: lovelace/2/my_hallway_thermostat_card
The use case here would be for dashboard or floorplan views to use minimal representations for entities (e.g., badges, icons, etc.) but be able to display more detailed cards in the tabs/loveplace view without having to duplicate configuration for existing cards. This may require work in the backend to generate unique id's for cards or to enforce unique titles for cards in a view. This may deviate from the goal of decentralized app routing (which I don't quite get why that's important).
For example, this yaml should still work even when you don't specify the title
for the card:
type: entities
entities:
- entity: light.kitchen_light
tap_action:
action: call-service
service: browser_mod.popup
service_data:
card:
type: entities
entities:
- light.kitchen_light
deviceID:
- this
You can display a blank string or fetch friendly_name
or entity_id
of the first specified entity in the card.
I'm not a developer and would love to help with little things like so I'm trying to set up a dev environment, learn github, home assistant development, etc. but it's taking me a while.
FullyKiosk has Javascript integration (https://www.ozerov.de/fully-kiosk-browser/#websiteintegration) that supports QR code/Barcode Scanning. With this integration devices with front camera could trigger actions for specific codes. For example, to activate and deactivate an alarm with a QR code keychain!
Would it be possible to have the media-player
entities named as per the alias's created in the config.yaml
?
i.e. for
browser_mod:
devices:
99980b13-dabc9563:
name: arrakis
d2fc860c-16379d23:
name: dashboard
have two media_player's created,
media_player.arrakis
and
media_player.dashboard
Love this new browser_mod.
finally got it working (still issiue with Device id to name).
when you have few popups opening in the browser, when you press to close one, they are all closing, can that be changed?
also no way to scroll down.
so in case we are using it for popup of camera picture that shows picture if someone is ringing the bell, in case i have'nt check immidiate then i cant scroll down when have more then 4 pictures sent to me
It would be great to have the option to close the popup on all devices when closed on one device:
service: browser_mod.popup
service_data:
title: Popup example
close_on_all: true
card:
type: entities
entities:
- light.bed_light
- light.kitchen_lights
- light.ceiling_lights
deviceID:
- dashboard_1
- dashboard_2
- dashboard_3
As soon as the popup is closed on e.g. dashboard_2
it gets closed on dashboad_1
& dashboard_3
, too. So you don't have to close it on every dashboard if you already have seen it on one.
Thank you in advance :)
I use the more-info dialog to get a streaming video when someone presses the doorbell and it would be nice to auto-close it like I can with a popup.
Hi, I'm experimenting with Browser_mod. Made some nice things in Lovelace. Thanks for that!
I was wondering if it possible to use items from the browser_mod to show or hide cards in Lovelace. For example show card X on ipadY. Or hide card X with user Z.
I have been puzzeling with the condition card, but I didnt figure it out.
Hope you can help. Grtz, Daniel
Unable to displaying a popup via a script in the latest version browser_mod and cardmod
nonething pop up when i use this example, but service: browser_mod.popup can use in the entity tap action, cannot use in script.
HA VERSION: 99.3
scripts.yaml
test_popup:
sequence:
- service: browser_mod.popup
data_template:
deviceID: "{{ deviceID }}"
title: Testing script
card:
type: entities
entities:
- light.bed_light
ui-lovelace.yaml
...
hello I tried you awesome mod but nfortunately it won't play any sound if device is called via internet. local network works 1a . My hass instance is available and reachable via domain:8123. Is there anything I can do to debug? there's no error in the logs :/
I don't know if that is possible, but I wanted to suggest it anyway:
It would be great if you could select a Tab or iFrame with an URL query. I have dashboards with multiple tabs & frames of lovelace views and can't control the loading order. When I send a popup to one of the devices, the popup would appear on any random tab/frame and might be not visible because of that.
If I could set an URL query as selection, this would be easier. One frame/tabs gets the URL http://hass.ip:port/lovelace/0?myframeid or http://hass.ip:port/lovelace/0?myframeid=callme
An alternative would be a specific view as target. So e.g. the frame with the view "floorplan" gets the popup.
Hi All,
I did everything correct but get this error:
2019-12-26 10:14:00 ERROR (MainThread) [homeassistant.components.hassio] Component error: browser_mod - Integration 'browser_mod' not found.
Everything is in this folder:
/usr/share/hassio/homeassistant/custom_components/browser_mod
drwxr-xr-x 2 root root 4096 Dec 25 11:32 .
drwxr-xr-x 11 root root 4096 Dec 25 11:29 ..
-rw-r--r-- 1 root root 1530 Dec 8 23:33 binary_sensor.py
-rw-r--r-- 1 root root 17449 Dec 8 23:33 browser_mod.js
-rw-r--r-- 1 root root 1123 Dec 8 23:33 camera.py
-rw-r--r-- 1 root root 3702 Dec 8 23:33 connection.py
-rw-r--r-- 1 root root 696 Dec 8 23:33 const.py
-rw-r--r-- 1 root root 2306 Dec 8 23:33 helpers.py
-rw-r--r-- 1 root root 1194 Dec 8 23:33 __init__.py
-rw-r--r-- 1 root root 1597 Dec 8 23:33 light.py
-rw-r--r-- 1 root root 165 Dec 8 23:33 manifest.json
-rw-r--r-- 1 root root 2484 Dec 8 23:33 media_player.py
-rw-r--r-- 1 root root 1098 Dec 8 23:33 mod_view.py
-rw-r--r-- 1 root root 1077 Dec 8 23:33 sensor.py
-rw-r--r-- 1 root root 1140 Dec 8 23:33 service.py
-rw-r--r-- 1 root root 254 Dec 8 23:33 services.yaml
Can someone tell me what im doing wrong?
HA 0.103.4
Can I disable creating the sensors
, lights
etc if I only want to use this on this
device (as a replacement of the popup card)?
Found this in HACS, but HACS is not mentioned in the installation instructions.
After install by HACS, I added this to configuration.yaml
browser_mod:
prefix: "browser_"
After several restarts, and visiting my site from several browsers on different machines, the Entity Registry still doesn't show any entities that include "browser"
I'm running the Nginx reverse proxy with a custom HTTPS domain to my site.
Cheers, Richard
Hello, I am using iobroker. Lovelace, I really need this card, but I find it can only be used based on HA, and I can make appropriate modifications to adapt to iobroker. Lovelace
Any chance the the old method of instantiating popups can be brought into browser_mod? I currently have to keep the old popups plugin installed for a couple of items in my configuration and am concerned that it has been deprecated and will not be maintained.
On example where I use the old version is to pop a thermostat card from a temperature graph on my Home view as a space saving/decluttering measure. Even though I get a more-info popup clicking on the graph when a popup has not been defined the new popup does not work here.
The old popup plugin is tied to the temperature sensor and (in addition to working where the browser_mod popup does not) it is very useful as I can pop up a thermostat from anywhere the temperature sensor has been displayed without having to define it for each entity.
type: custom:mini-graph-card
name: Temperature
hours_to_show: 72
entities:
- entity: sensor.upstairs_thermostat_temperature
name: Temperature
tap_action: #ISSUE doesn't work here
action: call-service
service: browser_mod.popup
service_data:
deviceID: this
title: Upstairs Thermostat
Hi All,
GREAT creation !!! now my tablet at the wall is a media player as well!!
I created something to stream radio channels to tablet but after 30 seconds it stop.
Everything work correct on my iMac browser (media player now as well) without any problem.
Im using Fully Kiosk on my tablet.
open the link directly in Chrome on Tablet everything is ok.
If you have Chrome and FireFox on the same machine, will it be considered as one or two devices?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.