mitch7391 / cmd4-HisenseTV

Shell script to integrate Hisense TVs using the RemoteNOW app with Homebridge through the homebridge-cmd4 plug-in.
5 stars 1 forks source link

Logs always shows "Timed out" & no control via Apple remote control #4

Open SchNils1402 opened 2 years ago

SchNils1402 commented 2 years ago

Describe Your Problem:

Hey, my first problem is that I keep getting this error message in my logs, even though I can control everything normally via the Home app.

The second thing is that unfortunately I can't control the TV with the Apple remote control, it doesn't react there at all.

I hope someone can help me here :) [Link to Logs:]()

Paste of Logs:


[03/09/2022, 16:17:17] [Cmd4] Setting Hisense Active 0
[03/09/2022, 16:17:19] [Cmd4] getValue: ActiveIdentifier function for: Hisense returned an empty string "". Perhaps your device is busy?
[03/09/2022, 16:17:26] [Cmd4] Setting Hisense Active 1
[03/09/2022, 16:17:32] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:17:38] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:17:44] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:17:51] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:17:56] [Cmd4] getValue: VolumeSelector function for: My_TelevisionSpeaker returned an empty string "". Perhaps your device is busy?
[03/09/2022, 16:17:57] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:18:03] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:18:09] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:18:15] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:18:21] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:18:27] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:18:34] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:18:40] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:18:46] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:18:46] [Cmd4] getValue: VolumeSelector function for: My_TelevisionSpeaker returned an empty string "". Perhaps your device is busy?
[03/09/2022, 16:18:52] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:18:58] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:19:04] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:19:11] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:19:11] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

[03/09/2022, 16:19:14] [Cmd4] getValue: ActiveIdentifier function for Hisense streamed to stderr: Timed out

Cmd4 Config:

{
    "platform": "Cmd4",
    "name": "Cmd4",
    "outputConstants": false,
    "restartRecover": false,
    "Cmd4_Mode": "FullyPolled",
    "statusMsg": true,
    "accessories": [
        {
            "type": "Television",
            "category": "TELEVISION",
            "publishExternally": true,
            "name": "Hisense",
            "active": "INACTIVE",
            "activeIdentifier": 0,
            "configuredName": "Hisense",
            "sleepDiscoveryMode": "ALWAYS_DISCOVERABLE",
            "accessories": [
                {
                    "type": "televisionSpeaker",
                    "displayName": "My_TelevisionSpeaker",
                    "name": "My_TelevisionSpeaker",
                    "active": "INACTIVE",
                    "mute": "FALSE",
                    "volumeSelector": 1,
                    "volumeControlType": "ABSOLUTE",
                    "state_cmd": "bash /home/pi/HisenseTV.sh",
                    "polling": [
                        {
                            "characteristic": "active",
                            "interval": 50,
                            "timeout": 3000
                        },
                        {
                            "characteristic": "volumeSelector",
                            "interval": 50,
                            "timeout": 3000
                        }
                    ]
                }
            ],
            "linkedTypes": [
                {
                    "type": "InputSource",
                    "displayName": "TV",
                    "configuredName": "TV",
                    "currentVisibilityState": "SHOWN",
                    "inputSourceType": "TUNER",
                    "isConfigured": "CONFIGURED",
                    "identifier": 0,
                    "targetVisibilityState": "SHOWN",
                    "name": "TV"
                },
                {
                    "type": "InputSource",
                    "displayName": "HDMI1",
                    "configuredName": "HDMI1",
                    "currentVisibilityState": "SHOWN",
                    "inputSourceType": "HDMI",
                    "isConfigured": "CONFIGURED",
                    "identifier": 1,
                    "targetVisibilityState": "SHOWN",
                    "name": "HDMI1"
                },
                {
                    "type": "InputSource",
                    "displayName": "HDMI2",
                    "configuredName": "HDMI2",
                    "currentVisibilityState": "SHOWN",
                    "inputSourceType": "HDMI",
                    "isConfigured": "CONFIGURED",
                    "identifier": 2,
                    "targetVisibilityState": "SHOWN",
                    "name": "HDMI2"
                },
                {
                    "type": "InputSource",
                    "displayName": "HDMI3",
                    "configuredName": "HDMI3",
                    "currentVisibilityState": "SHOWN",
                    "inputSourceType": "HDMI",
                    "isConfigured": "CONFIGURED",
                    "identifier": 3,
                    "targetVisibilityState": "SHOWN",
                    "name": "HDMI3"
                },
                {
                    "type": "InputSource",
                    "displayName": "HDMI4",
                    "configuredName": "HDMI4",
                    "currentVisibilityState": "SHOWN",
                    "inputSourceType": "HDMI",
                    "isConfigured": "CONFIGURED",
                    "identifier": 4,
                    "targetVisibilityState": "SHOWN",
                    "name": "HDMI4"
                },
                {
                    "type": "InputSource",
                    "displayName": "AV",
                    "configuredName": "AV",
                    "currentVisibilityState": "SHOWN",
                    "inputSourceType": "COMPOSITE_VIDEO",
                    "isConfigured": "CONFIGURED",
                    "identifier": 5,
                    "targetVisibilityState": "SHOWN",
                    "name": "AV"
                },
                {
                    "type": "InputSource",
                    "displayName": "Netflix",
                    "configuredName": "Netflix",
                    "currentVisibilityState": "SHOWN",
                    "inputSourceType": "APPLICATION",
                    "isConfigured": "CONFIGURED",
                    "identifier": 6,
                    "targetVisibilityState": "SHOWN",
                    "name": "Netflix"
                },
                {
                    "type": "InputSource",
                    "displayName": "Prime",
                    "configuredName": "Prime",
                    "currentVisibilityState": "SHOWN",
                    "inputSourceType": "APPLICATION",
                    "isConfigured": "CONFIGURED",
                    "identifier": 7,
                    "targetVisibilityState": "SHOWN",
                    "name": "Prime"
                },
                {
                    "type": "InputSource",
                    "displayName": "YouTube",
                    "configuredName": "YouTube",
                    "currentVisibilityState": "SHOWN",
                    "inputSourceType": "APPLICATION",
                    "isConfigured": "CONFIGURED",
                    "identifier": 8,
                    "targetVisibilityState": "SHOWN",
                    "name": "Youtube"
                }
            ],
            "remoteKey": "SELECT",
            "polling": [
                {
                    "characteristic": "active",
                    "interval": 5,
                    "timeout": 3000
                },
                {
                    "characteristic": "activeIdentifier",
                    "interval": 5,
                    "timeout": 3000
                }
            ],
            "stateChangeResponseTime": 1,
            "state_cmd": "bash /home/pi/HisenseTV.sh"
        }
    ]
}

Screenshots:

Environment:

mitch7391 commented 2 years ago

Hey @SchNils1402 I was not aware anyone was using this code of mine haha

I think I used to randomly get the empty string error for this work and if everything is actually working; I am fairly certain it was an issue with homebridge-cmd4 handling the 'gets'. At some point I would have shifted the config over to match my other project and I have not seen these alarms since. I will provide you my config to show you what you try out and see if it removes the 'errors'.


        {
            "platform": "Cmd4",
            "name": "Cmd4",
            "outputConstants": false,
            "statusMsg": true,
            "timeout": 5000,
            "stateChangeResponseTime": 0,
            "queueTypes": [
                {
                    "queue": "A",
                    "queueType": "WoRm"
                }
            ],
            "accessories": [
                {
                    "type": "Television",
                    "category": "TELEVISION",
                    "publishExternally": true,
                    "name": "Hisense",
                    "active": "INACTIVE",
                    "activeIdentifier": 0,
                    "configuredName": "Hisense",
                    "sleepDiscoveryMode": "ALWAYS_DISCOVERABLE",
                    "accessories": [
                        {
                            "type": "TelevisionSpeaker",
                            "displayName": "My_TelevisionSpeaker",
                            "name": "My_TelevisionSpeaker",
                            "active": "INACTIVE",
                            "mute": "FALSE",
                            "volumeSelector": 1,
                            "volumeControlType": "ABSOLUTE",
                            "state_cmd": "bash /home/pi/HisenseTV.sh",
                            "queue": "A",
                            "polling": [
                                {
                                    "characteristic": "active"
                                },
                                {
                                    "characteristic": "volumeSelector"
                                }
                            ]
                        }
                    ],
                    "linkedTypes": [
                        {
                            "type": "InputSource",
                            "displayName": "TV",
                            "configuredName": "TV",
                            "currentVisibilityState": "SHOWN",
                            "inputSourceType": "TUNER",
                            "isConfigured": "CONFIGURED",
                            "identifier": 0,
                            "targetVisibilityState": "SHOWN",
                            "name": "TV"
                        },
                        {
                            "type": "InputSource",
                            "displayName": "HDMI1",
                            "configuredName": "HDMI1",
                            "currentVisibilityState": "SHOWN",
                            "inputSourceType": "HDMI",
                            "isConfigured": "CONFIGURED",
                            "identifier": 1,
                            "targetVisibilityState": "SHOWN",
                            "name": "HDMI1"
                        },
                        {
                            "type": "InputSource",
                            "displayName": "HDMI2",
                            "configuredName": "HDMI2",
                            "currentVisibilityState": "SHOWN",
                            "inputSourceType": "HDMI",
                            "isConfigured": "CONFIGURED",
                            "identifier": 2,
                            "targetVisibilityState": "SHOWN",
                            "name": "HDMI2"
                        },
                        {
                            "type": "InputSource",
                            "displayName": "HDMI3",
                            "configuredName": "HDMI3",
                            "currentVisibilityState": "SHOWN",
                            "inputSourceType": "HDMI",
                            "isConfigured": "CONFIGURED",
                            "identifier": 3,
                            "targetVisibilityState": "SHOWN",
                            "name": "HDMI3"
                        },
                        {
                            "type": "InputSource",
                            "displayName": "HDMI4",
                            "configuredName": "HDMI4",
                            "currentVisibilityState": "SHOWN",
                            "inputSourceType": "HDMI",
                            "isConfigured": "CONFIGURED",
                            "identifier": 4,
                            "targetVisibilityState": "SHOWN",
                            "name": "HDMI4"
                        },
                        {
                            "type": "InputSource",
                            "displayName": "AV",
                            "configuredName": "AV",
                            "currentVisibilityState": "SHOWN",
                            "inputSourceType": "COMPOSITE_VIDEO",
                            "isConfigured": "CONFIGURED",
                            "identifier": 5,
                            "targetVisibilityState": "SHOWN",
                            "name": "AV"
                        }
                    ],
                    "remoteKey": "SELECT",
                    "manufacturer": "Hisense",
                    "model": "65S8",
                    "serialNumber": "500415-264623-203N-AA1847R",
                    "queue": "A",
                    "polling": [
                        {
                            "characteristic": "active"
                        },
                        {
                            "characteristic": "activeIdentifier"
                        }
                    ],
                    "state_cmd": "bash /home/pi/HisenseTV.sh"
                }
            ]
        }

Please take note of some of the significant changes throughout the entire config above.

As for your second issue, I am not sure why the remote does not work any more. At the time of writing the code it worked perfectly and then it seems after some iOS major update, it never seemed to work any more. I was not bothered as I pretty much never use it myself and as far as I knew I did not have anyone using my code...

SchNils1402 commented 2 years ago

Thank you for your prompt reply. My first problem was solved by the other config.json, the error is no longer displayed to me.

I'm just wondering why the cmd4 plugin always shows it's running in demo mode for the inputs when it starts.

mitch7391 commented 2 years ago

No worries, I would have liked to be more prompt but I feel you may be in a different time zone haha…

I am very glad to hear that resolved your errors. I will try update the config found here no that I know I am not the only user :)

I will have to look into the remote at some point, it may even be an issue with cmd4.

I'm just wondering why the cmd4 plugin always shows it's running in demo mode for the inputs when it starts.

I believe this is described on cmd4’s GitHub page as if they not defined then they will appear in demo mode. Again, another one I knew about but has not been a priority due to not having any users haha I am wondering if it would require defining a state command and polling for the characteristics in each HDMI area..?