Code Monkey home page Code Monkey logo

mqtt-chromium-control's Introduction

MQTT Chromium Control

Monitoring and control of a chromium browser via MQTT. Connects to chrome using chrome debug protocol.

Intended for use with Home Assistant and a Chromium instance as kiosk.

Installation

git clone https://github.com/functionpointer/mqtt-chromium-control.git
cd mqtt-chromium-control
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Usage

  1. Launch your chrome with --remote-debugging-port=9222 --remote-allow-origins=* More complete example:
/usr/bin/cage -- /usr/bin/chromium --enable-low-end-device-mode --renderer-process-limit=2 --disable-features=IsolateOrigins,site-per-process --disable-site-isolation-trials --noerrdialogs --disable-infobars --kiosk --remote-debugging-port=9222 --remote-allow-origins=* http://127.0.0.1:8123/dashboard-kiosk/0 &
source venv/bin/activate
python -m mqtt_chromium_control

The program will connect to chrome and MQTT, and provide the following entities (with Home Assistant auto-discovery):

  • Camera entity, showing a screenshot
  • Sensor entity, containing size of the screenshot (useful for simple sanity check of displayed image)
  • Button entity, causing chrome to load about:blank and then http://127.0.0.1:8123 (configurable with --tgt-url)

For an overview of available options, run python -m mqtt_chromium_control --help

Systemd Service

There is an example .service file included.

It can be used like this:

ln -s $(pwd)/mqtt_chromium_control.service /etc/systemd/system/mqtt_chromium_control.service
systemctl daemon-reload
systemctl start mqtt_chromium_control

mqtt-chromium-control's People

Contributors

functionpointer avatar

Stargazers

Milan Jelicanin avatar

Watchers

 avatar

mqtt-chromium-control's Issues

Documentation

I'm interested in using your work the same way you do - Home Assistant and Linux kiosks. I will be very appreciated if you can do a bit of documentation. :)

Also, I see there is hardcoded stuff here and there, would be awesome if this is made as generic as possible.

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.