grzegorz914 / homebridge-lgwebos-tv

Homebridge plugin for LG WebOS TV, publish as independent external platform accessory.
MIT License
135 stars 15 forks source link

Automation based on selected input #156

Closed DataFran closed 1 year ago

DataFran commented 1 year ago

Hello! I'm trying to create an automation to trigger when I select a specific input (in this case HDMI1). I can't figure out how to do that with the plugin as it exists today. Is this possible, and am I missing something, or could options to allow this be added in the future? Thanks!

grzegorz914 commented 1 year ago

Right now the motion sensor trigger every channels change, not if switch to specific input as you want. It can be added this possibility in future.

grzegorz914 commented 1 year ago

added in 2.5.0

DataFran commented 1 year ago

I upgraded to this version, but I can't figure out how to implement this. What am I missing?

grzegorz914 commented 1 year ago

Sensor—-Inputs section in plugin settings

DataFran commented 1 year ago

Hmm, I've tried adding everything I can think of to get this working, this is my config. What am I doing wrong?

       "devices": [
            {
                "name": "LG TV Main",
                "host": removed for pasting,
                "mac": removed for pasting,
                "getInputsFromDevice": true,
                "filterSystemApps": true,
                "sensorPower": false,
                "sensorVolume": false,
                "sensorMute": false,
                "sensorInput": true,
                "sensorChannel": false,
                "sensorScreenOnOff": false,
                "sensorScreenSaver": false,
                "sensorInputs": [
                    {
                        "name": "HDMI 1",
                        "reference": "com.webos.app.hdmi1",
                        "displayType": 0
                    }
                ],
                "brightnessControl": false,
                "backlightControl": false,
                "contrastControl": false,
                "colorControl": false,
                "pictureModeControl": false,
                "enableDebugMode": false,
                "disableLogInfo": false,
                "disableLogDeviceInfo": false,
                "turnScreenOnOff": false,
                "sslWebSocket": false,
                "enableMqtt": false,
                "mqttAuth": false,
                "mqttDebug": false
            }
        ],
        "platform": "LgWebOsTv"
grzegorz914 commented 1 year ago

All is Ok here, what is your problem?

DataFran commented 1 year ago

When I add the accessory to Homekit, there is no sensor associated with the TV for the specific input change. I can automate using any input change, but not specifically when selecting HDMI 1.

grzegorz914 commented 1 year ago

The sensors are here: 688A3EA9-427F-4B2D-B07D-63531CBE7E80 B5B8B726-03D0-4EAB-8178-0E2E73DE8B2C B574069E-AB41-4646-8363-9463890040EB

DataFran commented 1 year ago

Huh, when I enable the SensorInput:true, I get the general motion sensor (detects motion at any input change), but when I create a SensorInput it doesn't appear in HomeKit. Very strange. Only the general motion detector appears.

], "sensorPower": false, "sensorVolume": false, "sensorMute": false, "sensorInput": true, "sensorChannel": false, "sensorScreenOnOff": false, "sensorScreenSaver": false, "sensorInputs": [ { "name": "XBox", "reference": "com.webos.app.hdmi1", "displayType": 0 }, { "name": "HDMI 4", "reference": "com.webos.app.hdmi4", "displayType": 0 } ],

grzegorz914 commented 1 year ago

sensrInput report on every channel change, sensorInputs report on change to created sensor, this are 2 different sensors. As you see on my screenshots it’s appear in Home app correct. If you load inputs from device always enable filter system app because HomeKit have limitation of created services to 100 and over this sensors can be omitted.

grzegorz914 commented 1 year ago

try 2.5.10, in this version reduced max inputs to 80, this leave some services for sensors, etc..