hoobs-org / HOOBS

Build your Smart Home with HOOBS. Connect over 2,000 Accessories to your favorite Ecosystem.
https://hoobs.org
GNU General Public License v3.0
553 stars 51 forks source link

homebridge-tv-cec - Crashing and restarting HOOBS repeatedly. #537

Closed Fookes74 closed 4 years ago

Fookes74 commented 4 years ago

Description Added this plugin. Didn't even get time to configure. It immediately crashed and restarted back to login screen. Enter info and it immediately crashes again. Unable to uninstall.

Expected behavoir Add ability to control TV via CEC

Plugin name homebridge-tv-cec

Please report the issue to the plugin developer https://github.com/dominick-han/homebridge-tv-cec/issues/14

Version Latest

Did you upgrade Yes

Pervious version 2.1.1.

Did you orginally upgrade to HOOBS 3 from HOOBS 2.1.1? Yes

What device are you using? Custom Install

If this is a custom install, what's your operating system? RPi 3

Post your config { "server": { "port": 8080, "autostart": 0, "home_setup_id": "xxxxxxxxxxxx", "polling_seconds": 5, "origin": "*" }, "client": { "default_route": "status", "inactive_logoff": 60, "theme": "hoobs-dark", "locale": "en", "temp_units": "celsius", "country_code": "GB", "postal_code": "xxxxxxxx", "latitude": "xxxxxxxx", "longitude": "xxxxxxxx" }, "bridge": { "name": "xxxxx Cottage", "username": "xxxxxxxxxxxxx", "port": 51826, "pin": "xxxxxxxxx" }, "description": "HOOBS.", "ports": {}, "plugins": [ "homebridge-raspberrypi-temperature", "homebridge-sonoff-tasmota-http", "homebridge-people-guest-mode", "homebridge-dummy", "homebridge-mqtt-switch-tasmota", "homebridge-mi-aqara", "homebridge-alexa", "homebridge-weather-plus", "homebridge-mqtt-power-consumption-log-tasmota", "homebridge-yeelight-platform", "homebridge-cmdswitch2", "homebridge-camera-ffmpeg", "homebridge-occupancy-delay", "homebridge-delay-switch", "homebridge-tv-cec" ], "accessories": [ { "accessory": "mqtt-switch-tasmota", "switchType": "lightbulb", "name": "Kitchen Table", "url": "mqtt://192.168.1.xx", "topics": { "statusGet": "stat/kitchen_lights/RESULT1", "statusSet": "cmnd/kitchen_lights/POWER1", "stateGet": "tele/kitchen_lights/STATE1" }, "onValue": "ON", "offValue": "OFF", "activityTopic": "tele/kitchen_lights/LWT", "activityParameter": "Online", "startCmd": "cmnd/kitchen_lights/TelePeriod", "startParameter": "60", "manufacturer": "ITEAD", "model": "Sonoff", "serialNumberMAC": "Relay1", "plugin_map": { "plugin_name": "homebridge-mqtt-switch-tasmota", "index": 0 } }, { "accessory": "mqtt-switch-tasmota", "switchType": "lightbulb", "name": "Kitchen Oven", "url": "mqtt://192.168.1.xx", "topics": { "statusGet": "stat/kitchen_lights/RESULT2", "statusSet": "cmnd/kitchen_lights/POWER2", "stateGet": "tele/kitchen_lights/STATE2" }, "onValue": "ON", "offValue": "OFF", "activityTopic": "tele/kitchen_lights/LWT", "activityParameter": "Online", "startCmd": "cmnd/kitchen_lights/TelePeriod", "startParameter": "60", "manufacturer": "ITEAD", "model": "Sonoff", "serialNumberMAC": "Relay2", "plugin_map": { "plugin_name": "homebridge-mqtt-switch-tasmota", "index": 0 } }, { "accessory": "mqtt-switch-tasmota", "switchType": "lightbulb", "name": "Kitchen Cupboards", "url": "mqtt://192.168.1.xx", "topics": { "statusGet": "stat/kitchen_lights/RESULT3", "statusSet": "cmnd/kitchen_lights/POWER3", "stateGet": "tele/kitchen_lights/STATE3" }, "onValue": "ON", "offValue": "OFF", "activityTopic": "tele/kitchen_lights/LWT", "activityParameter": "Online", "startCmd": "cmnd/kitchen_lights/TelePeriod", "startParameter": "60", "manufacturer": "ITEAD", "model": "Sonoff", "serialNumberMAC": "Relay3", "plugin_map": { "plugin_name": "homebridge-mqtt-switch-tasmota", "index": 0 } }, { "name": "TV Lamp", "hostname": "192.168.1.xx", "accessory": "SonoffTasmotaHTTP", "plugin_map": { "plugin_name": "homebridge-sonoff-tasmota-http", "index": 0 } }, { "name": "Table Lamp", "hostname": "192.168.1.xx", "accessory": "SonoffTasmotaHTTP", "plugin_map": { "plugin_name": "homebridge-sonoff-tasmota-http", "index": 0 } }, { "name": "French Doors", "hostname": "192.168.1.xx", "accessory": "SonoffTasmotaHTTP", "plugin_map": { "plugin_name": "homebridge-sonoff-tasmota-http", "index": 0 } }, { "name": "Hall Lamp", "hostname": "192.168.1.xx", "accessory": "SonoffTasmotaHTTP", "plugin_map": { "plugin_name": "homebridge-sonoff-tasmota-http", "index": 0 } }, { "name": "Coffee", "hostname": "192.168.1.xx", "accessory": "SonoffTasmotaHTTP", "plugin_map": { "plugin_name": "homebridge-sonoff-tasmota-http", "index": 0 } }, { "name": "Bedroom Bulbs", "hostname": "192.168.1.xx", "accessory": "SonoffTasmotaHTTP", "plugin_map": { "plugin_name": "homebridge-sonoff-tasmota-http", "index": 0 } }, { "name": "Star Lamp", "hostname": "192.168.1.xx", "accessory": "SonoffTasmotaHTTP", "plugin_map": { "plugin_name": "homebridge-sonoff-tasmota-http", "index": 0 } }, { "name": "Flower Lamp", "hostname": "192.168.1.xx", "accessory": "SonoffTasmotaHTTP", "plugin_map": { "plugin_name": "homebridge-sonoff-tasmota-http", "index": 0 } }, { "name": "Fairy Lights", "hostname": "192.168.1.xx", "accessory": "SonoffTasmotaHTTP", "plugin_map": { "plugin_name": "homebridge-sonoff-tasmota-http", "index": 0 } }, { "accessory": "RaspberryPiTemperature", "name": "RaspberryPi CPU Temperature", "plugin_map": { "plugin_name": "homebridge-raspberrypi-temperature", "index": 0 } }, { "accessory": "DummySwitch", "name": "Home Security", "stateful": true, "reverse": false, "plugin_map": { "plugin_name": "homebridge-dummy", "index": 0 }, "time": 1000 }, { "name": "Mood Lights", "hostname": "192.168.1.xx", "accessory": "SonoffTasmotaHTTP", "plugin_map": { "plugin_name": "homebridge-sonoff-tasmota-http", "index": 0 } }, { "accessory": "mqtt-power-consumption-log-tasmota", "name": "Kettle Power Consumption", "url": "mqtt://192.168.1.xx", "topics": { "statusGet": "stat/moreteavicar/POWER", "statusSet": "cmnd/moreteavicar/power", "energyGet": "tele/moreteavicar/ENERGY", "stateGet": "tele/moreteavicar/STATE" }, "onValue": "ON", "offValue": "OFF", "outletInUseBy": "current", "outletInUseCurrent": "0.01", "totalPowerResetBy": "month", "activityTopic": "tele/moreteavicar/LWT", "activityParameter": "Online", "startCmd": "cmnd/moreteavicar/TelePeriod", "startParameter": "15", "patchToSave": "/root/.homebridge/", "savePeriod": "15", "timeOffset": "-60", "manufacturer": "ITEAD", "model": "Sonoff R2 POW", "plugin_map": { "plugin_name": "homebridge-mqtt-power-consumption-log-tasmota", "index": 0 } }, { "accessory": "DummySwitch", "plugin_map": { "plugin_name": "homebridge-dummy", "index": 0 }, "stateful": true, "reverse": false, "time": 1000, "name": "Occupancy" }, { "accessory": "DummySwitch", "plugin_map": { "plugin_name": "homebridge-dummy", "index": 0 }, "stateful": true, "reverse": false, "time": 1000, "name": " Occupancy" }, { "accessory": "DummySwitch", "plugin_map": { "plugin_name": "homebridge-dummy", "index": 0 }, "stateful": true, "reverse": false, "time": 1000, "name": " Occupancy" }, { "accessory": "mqtt-switch-tasmota", "switchType": "outlet", "name": "Kettle", "url": "mqtt://192.168.1.xx", "topics": { "statusGet": "stat/moreteavicar/RESULT", "statusSet": "cmnd/moreteavicar/POWER", "stateGet": "tele/moreteavicar/STATE" }, "onValue": "ON", "offValue": "OFF", "activityTopic": "tele/moreteavicar/LWT", "activityParameter": "Online", "startCmd": "cmnd/moreteavicar/TelePeriod", "startParameter": "60", "manufacturer": "ITEAD", "model": "Sonoff", "plugin_map": { "plugin_name": "homebridge-mqtt-switch-tasmota", "index": 0 } }, { "accessory": "OccupancyDelay", "name": "OccupancyDelay", "delay": 120, "slaveCount": 1, "plugin_map": { "plugin_name": "homebridge-occupancy-delay", "index": 0 } }, { "accessory": "DelaySwitch", "name": "Kettle Auto Off", "disableSensor": true, "delay": 230000, "plugin_map": { "plugin_name": "homebridge-delay-switch", "index": 0 } } ], "platforms": [ { "platform": "People", "anyoneSensor": true, "nooneSensor": true, "webhookPort": 51828, "people": [ { "name": "", "target": "192.168.1.xx" }, { "name": "", "target": "192.168.1.xx" }, { "name": "", "target": "192.168.1.xx" } ], "plugin_map": { "plugin_name": "homebridge-people-guest-mode" } }, { "platform": "Alexa", "plugin_map": { "plugin_name": "homebridge-alexa" }, "name": "Alexa", "username": "XXXX", "password": "XXXXXXX", "pin": "XXXXXXXXX", "routines": "true", "debug": "true" }, { "platform": "WeatherPlus", "service": "darksky", "compatibility": "both", "hidden": [ "AirPressure", "CloudCover", "ConditionCategory", "DewPoint", "ForecastDay", "Humidity", "ObservationStation", "ObservationTime", "Ozone", "Rain1h", "RainBool", "RainChance", "RainDay", "SnowBool", "SolarRadiation", "TemperatureMin", "UVIndex", "Visibility", "WindDirection", "WindSpeed", "WindSpeedMax" ], "forecast": [ 0, 1, 2 ], "units": "uk", "nameForecast": "Middleton Forecast", "key": "XXXXXXXXXXXX", "locationGeo": [

        ],
        "plugin_map": {
            "plugin_name": "homebridge-weather-plus"
        }
    },
    {
        "platform": "Yeelight-Platform",
        "addResetSwitch": true,
        "shouldTurnOff": false,
        "scenes": [
            {
                "name": "Night Mode",
                "scene": "night_mode"
            },
            {
                "name": "Candle Flicker",
                "scene": "candle_flicker"
            },
            {
                "name": "Notify",
                "scene": "flash_notify"
            },
            {
                "name": "Alarm",
                "scene": "alarm"
            },
            {
                "name": "Gaming",
                "scene": "gaming"
            }
        ],
        "plugin_map": {
            "plugin_name": "homebridge-yeelight-platform"
        }
    },
    {
        "platform": "cmdSwitch2",
        "name": "CMD Switch",
        "switches": [
            {
                "name": "PS4 Pro",
                "on_cmd": "ps4-waker",
                "off_cmd": "ps4-waker standby",
                "state_cmd": "ps4-waker search | grep -i '200 Ok'",
                "polling": true,
                "interval": 5,
                "timeout": 2000,
                "manufacturer": "Sony Corporation",
                "model": "PS4 Pro",
                "serial": "PS4 Pro"
            },
            {
                "name": "FIFA 20",
                "on_cmd": "ps4-waker start XXXXXXXXXX",
                "off_cmd": "ps4-waker remote ps",
                "state_cmd": "ps4-waker search | grep -I 'XXXXXXXXXX'",
                "polling": true,
                "interval": 5,
                "timeout": 2000,
                "manufacturer": "Sony Corporation",
                "model": "PS4 Pro",
                "serial": "PS4 Pro"
            },
            {
                "name": "Knowledge Is Power",
                "on_cmd": "ps4-waker start XXXXXXXXXX",
                "off_cmd": "ps4-waker remote ps",
                "state_cmd": "ps4-waker search | grep -I 'XXXXXXXXXXX'",
                "polling": true,
                "interval": 5,
                "timeout": 2000,
                "manufacturer": "Sony Corporation",
                "model": "PS4 Pro",
                "serial": "PS4 Pro"
            }
        ],
        "plugin_map": {
            "plugin_name": "homebridge-cmdswitch2"
        }
    },
    {
        "platform": "Camera-ffmpeg",
        "plugin_map": {
            "plugin_name": "homebridge-camera-ffmpeg"
        },
        "name": "Camera ffmpeg",
        "cameras": [
            {
                "name": "Utility Room Cam",
                "manufacturer": "Yi Camera Home",
                "videoConfig": {
                    "source": "-rtsp_transport tcp -re -i rtsp://192.168.1.XX/ch0_1.h264",
                    "maxStreams": 2,
                    "maxWidth": 640,
                    "maxHeight": 360,
                    "maxFPS": 30,
                    "maxBitrate": 200,
                    "packetSize": 1128,
                    "vcodec": "copy",
                    "audio": false,
                    "additionalCommandline": "-x264-params intra-refresh=1:bframes=0",
                    "debug": true
                }
            },
            {
                "name": "Garage Cam",
                "manufacturer": "Yi Camera Dome",
                "videoConfig": {
                    "source": "-rtsp_transport tcp -re -i rtsp://192.168.1.XX/ch0_1.h264",
                    "maxStreams": 2,
                    "maxWidth": 640,
                    "maxHeight": 360,
                    "maxFPS": 30,
                    "maxBitrate": 200,
                    "packetSize": 1128,
                    "vcodec": "copy",
                    "audio": false,
                    "additionalCommandline": "-x264-params intra-refresh=1:bframes=0",
                    "debug": true
                }
            }
        ]
    }
],
"package_manager": "npm",
"system": "hoobs"
POST CONFIG HERE

Post your log You can get the log from the intercafe. This is in the Log section.

[Homebridge] [4/3/2020, 17:29:11] Error: spawn cec-client ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19) at onErrorNT (internal/child_process.js:456:16) at processTicksAndRejections (internal/process/task_queues.js:80:21) [Homebridge] [4/3/2020, 17:29:11] Service is running on port 51826.

Additional context An idea of how to remove the plugin via SSH would be appreciated.

mkellsy commented 4 years ago

I just released 3.1.27 This issue has been fixed. I recommend updating.

Fookes74 commented 4 years ago

Hi

Whilst it is no longer constantly crashing and restarting my Homebridge after updating, it is stopping HOOBS, with the following info detailed in logs:

[Homebridge] [4/19/2020, 17:33:33] [TV] Checking TV power status [Homebridge] [4/19/2020, 17:33:34] Error [ERR_STREAM_DESTROYED] [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed at doWrite (_stream_writable.js:427:19) at writeOrBuffer (_stream_writable.js:415:5) at Socket.Writable.write (_stream_writable.js:305:11) at TV.getPowerStatus (/home/hoobs/.hoobs/node_modules/homebridge-tv-cec/index.js:89:20) at Characteristic.Active.emit (events.js:210:5) at Characteristic.Active.Characteristic.getValue (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/lib/Characteristic.js:164:10) at Bridge. (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/lib/Accessory.js:771:20) at Array.forEach (:null:null) at Bridge.Accessory._handleGetCharacteristics (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/lib/Accessory.js:735:8) at HAPServer.emit (events.js:210:5) at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/lib/HAPServer.js:928:10) at HAPServer. (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/lib/HAPServer.js:209:39) at IncomingMessage.emit (events.js:210:5) at endReadableNT (_stream_readable.js:1184:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)

mkellsy commented 4 years ago

This is an issue with the plugin more specifically in the index.js line 89

I will look into the plug-in code and make notes for the developer.

Fookes74 commented 4 years ago

This is an issue with the plugin more specifically in the index.js line 89

I will look into the plug-in code and make notes for the developer.

Many thanks for your assistance. Is it likely the developer will update us on here if he amends the plugin?