Closed Alessiou78 closed 4 months ago
Unfortunately it is not possible from a card to create sensors or services, but you can use Browser Mod to do this: https://github.com/thomasloven/hass-browser_mod
First install Browser Mod from HACS, and configure it by following the documentation here: https://github.com/thomasloven/hass-browser_mod?tab=readme-ov-file#quickstart
Once you have registered your web browser with Browser Mod, you can run javascript code to the browser from a Home Assistant service called browser_mod.javascript
.
For example if you want your browser to go fullscreen, call this service with your browser as target:
Then you can call this service from automation, or from a button card...
There are some other javascript codes, e.g. to refresh the page the javascript code is document.location.reload();
TOP ! Thanks a lot
Unfortunately it is not possible from a card to create sensors or services, but you can use Browser Mod to do this: https://github.com/thomasloven/hass-browser_mod
First install Browser Mod from HACS, and configure it by following the documentation here: https://github.com/thomasloven/hass-browser_mod?tab=readme-ov-file#quickstart
Once you have registered your web browser with Browser Mod, you can run javascript code to the browser from a Home Assistant service called
browser_mod.javascript
.For example if you want your browser to go fullscreen, call this service with your browser as target:
Then you can call this service from automation, or from a button card...
There are some other javascript codes, e.g. to refresh the page the javascript code is
document.location.reload();
did try this but didn't seem to work which is a shame..the command was sent and a green tick to state as much, but no change at the device itself. other than having browsermod in place, are there any other things that would stop this from working or would be required to ensure this works?
Maybe a javascript blocker can be the cause. You can try to disable any adblocker / use a private browsing window. Under "Targets" > "Choose device" are you able to select your browser?
i can choose the browser correctly...it sees it...but it just doesnt seem to do anything
1st, TKS for your work. Is it possible to implement a "full screen button" control, and maybe other buttons, directly from HA? (perhaps through a creation of the related entities)