From 78afa95a54524b55e02c2d0092bbcdffc479d509 Mon Sep 17 00:00:00 2001 From: DIY techie Date: Sat, 30 May 2020 13:39:32 +0200 Subject: [PATCH 1/5] Create service.yml --- .templates/cec-mqtt-bridge/service.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .templates/cec-mqtt-bridge/service.yml diff --git a/.templates/cec-mqtt-bridge/service.yml b/.templates/cec-mqtt-bridge/service.yml new file mode 100644 index 00000000..8f938a12 --- /dev/null +++ b/.templates/cec-mqtt-bridge/service.yml @@ -0,0 +1,18 @@ + cec-mqtt-bridge: + image: jonaseck/rpi-cec-mqtt-bridge + container_name: cec-mqtt-bridge + devices: + - '/dev/mem:/dev/mem' + - /dev/vcsm + - /dev/vchiq + environment: + - MQTT_BROKER=localhost + - MQTT_PORT=1883 + - MQTT_PREFIX=media + - MQTT_USER=homeassistant + - MQTT_PASSWORD=password + - CEC_ENABLED=1 + - CEC_ID=1 + - CEC_PORT=RPI + - 'CEC_DEVICES=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15' + - IR_ENABLED=0 From df3140379c12d9af084794e0ca98fa62b58a702f Mon Sep 17 00:00:00 2001 From: DIY techie Date: Sat, 30 May 2020 13:42:21 +0200 Subject: [PATCH 2/5] Update menu.sh --- menu.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/menu.sh b/menu.sh index a0a08b60..11d66c68 100755 --- a/menu.sh +++ b/menu.sh @@ -46,6 +46,7 @@ declare -A cont_array=( [python]="Python 3" [gitea]="Gitea" [dozzle]="Dozzle" + [cec-mqtt-bridge]="HDMI-CEC-MQTT-bridge" ) declare -a armhf_keys=( @@ -77,6 +78,7 @@ declare -a armhf_keys=( "python" "gitea" "dozzle" + "HDMI-CEC-MQTT-bridge" # add yours here ) sys_arch=$(uname -m) From 9d8c65b377a9b8d494883729b663bf29c0a480aa Mon Sep 17 00:00:00 2001 From: DIY techie Date: Sat, 30 May 2020 13:52:33 +0200 Subject: [PATCH 3/5] Update menu.sh --- menu.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/menu.sh b/menu.sh index 11d66c68..b2c885bf 100755 --- a/menu.sh +++ b/menu.sh @@ -63,7 +63,7 @@ declare -a armhf_keys=( "adminer" "openhab" "zigbee2mqtt" - "deconz" + "deconz" "pihole" "plex" "tasmoadmin" @@ -78,7 +78,7 @@ declare -a armhf_keys=( "python" "gitea" "dozzle" - "HDMI-CEC-MQTT-bridge" + "cec-mqtt-bridge" # add yours here ) sys_arch=$(uname -m) From 18df2fc2f1a27a401f9a5ddea87cc64e4df5177e Mon Sep 17 00:00:00 2001 From: DIY techie Date: Sat, 30 May 2020 23:06:07 +0200 Subject: [PATCH 4/5] Update service.yml --- .templates/cec-mqtt-bridge/service.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.templates/cec-mqtt-bridge/service.yml b/.templates/cec-mqtt-bridge/service.yml index 8f938a12..dc2642c6 100644 --- a/.templates/cec-mqtt-bridge/service.yml +++ b/.templates/cec-mqtt-bridge/service.yml @@ -1,6 +1,7 @@ cec-mqtt-bridge: image: jonaseck/rpi-cec-mqtt-bridge container_name: cec-mqtt-bridge + restart: unless-stopped devices: - '/dev/mem:/dev/mem' - /dev/vcsm @@ -9,7 +10,7 @@ - MQTT_BROKER=localhost - MQTT_PORT=1883 - MQTT_PREFIX=media - - MQTT_USER=homeassistant + - MQTT_USER=username - MQTT_PASSWORD=password - CEC_ENABLED=1 - CEC_ID=1 From 1a0724e1b282af7a3eef0b02026e428b989ee55d Mon Sep 17 00:00:00 2001 From: DIY techie Date: Sun, 31 May 2020 00:00:55 +0200 Subject: [PATCH 5/5] Create cec-mqtt-bridge.md --- docs/cec-mqtt-bridge.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/cec-mqtt-bridge.md diff --git a/docs/cec-mqtt-bridge.md b/docs/cec-mqtt-bridge.md new file mode 100644 index 00000000..694910a7 --- /dev/null +++ b/docs/cec-mqtt-bridge.md @@ -0,0 +1,12 @@ +# HDMI-CEC-MQTT-bridge +## References +- [Docker](https://hub.docker.com/r/jonaseck/rpi-cec-mqtt-bridge) +- [Upstream documentation](https://github.com/michaelarnauts/cec-mqtt-bridge/blob/master/README.md) +- [cec-o-matic](http://www.cec-o-matic.com/) + +## Configuration +Amend the MQTT settings in the docker-compose.yml file after building the stack, but before running `docker-compose up -d`. + +(You don't need to change or delete the MQTT_USER and MQTT_PASSWORD if you are not using a username and password with your mqtt broker. Please note that the MQTT_BROKER cannot be "localhost"). + +If you have already run `docker-compose up -d`, simply run `sudo nano ~/IOTstack/docker-compose.yml`, change the mqtt settings and run `docker-compose up -d` again to recreate the cec-mqtt-bridge.