jbree / homebridge-cec-accessory

Homebridge support for CEC devices over HDMI
MIT License
19 stars 6 forks source link

CEC Destination for Recording 1 not working? #12

Closed seydx closed 3 years ago

seydx commented 6 years ago

Hello,

first, thanks for the great plugin. I'm controlling my apple TV with it and other sources that are connected to the TV.

But i have a Problem with the "Recorder 1" . The Recorder 1 is the Raspberry Pi that is connected to the TV.

here the log of scan:

`pi@raspberrypi:~ $ echo scan | cec-client -s -d 1 opening a connection to the CEC adapter... requesting CEC bus information ... CEC bus information

device #0: TV address: 0.0.0.0 active source: no vendor: Sony osd string: TV CEC version: 1.4 power status: on language: deu

device #1: Recorder 1 address: 4.0.0.0 active source: yes vendor: Pulse Eight osd string: CECTester CEC version: 1.4 power status: on language: eng

device #4: Playback 1 address: 3.0.0.0 active source: no vendor: Sony osd string: PlayStation 4 CEC version: 1.3a power status: standby language: ???

device #8: Playback 2 address: 2.0.0.0 active source: no vendor: Unknown osd string: Apple TV CEC version: unknown power status: on language: ???

currently active source: Recorder 1 (1)

as you can see, the Raspberry is currently the connected source and it has the adress "1" and it is active..

so far so good... but if i creat a accessory for the Raspberry/Recorder 1 (Adress 1) i got a issue in HomeKit and "No Response"

Below the log from Raspberry/Recorder 1:

`[2017-12-24 23:22:40] [RaspBerry] getOn: 226 [2017-12-24 23:22:43] [RaspBerry] Error: No REPORT_POWER_STATUS received after 3000ms Dez 24 23:22:43 raspberrypi homebridge[25833]: at Timeout._onTimeout (/usr/local/lib/node_modules/homebridge-cec-accessory/node_modules/cec-promise/index.js:67:23) Dez 24 23:22:43 raspberrypi homebridge[25833]: at ontimeout (timers.js:475:11) Dez 24 23:22:43 raspberrypi homebridge[25833]: at tryOnTimeout (timers.js:310:5) Dez 24 23:22:43 raspberrypi homebridge[25833]: at Timer.listOnTimeout (timers.js:270:5)

hope you can help me. Thx.

SeydX

jbree commented 6 years ago

Hey! thanks for the kind words. would you mind sharing your json accessory configuration? It sounds like you are trying to use CEC to control the raspberry pi, and i don’t think that is going to work.the raspberry pi is the device that should be controlling other devices. i’m not positive, but i don’t think cec supports devices sending messages to themselves.

seydx commented 6 years ago

Hello,

What about only to change the „active source“?

I have installed omxplayer, created a switch to start a video in Apple Home

What i need is only to change the „active source“ to Raspberry. Is this possible?

jbree commented 6 years ago

I could be mistaken, but I believe it would be the receiver or the TV device that would select its active source. This functionality is not supported in homebridge-cec-accessory at this time. In theory it's possible to do something like this. It's hard for me to imagine how this sort of behavior would map onto the on/off switch interface we have with HomeKit, though. How do you imagine it working?

seydx commented 6 years ago

I can switch to Raspberry via this command on terminal:

„echo ‚as‘ | cec-client -d“

This makes the Raspberry the ‚active source‘

And with this command:

„echo ‚is‘ | cec-client -d“

i disable the Raspberry as ‚active‘ source (but it remains on Raspberry if no other active source is on, if other one is active, so it switches)

My problem now is, if i put this command in a cmdswitch (homebridge-cmdswitch2 plugin) with an ‚on‘ button and ‚off‘ button with the above commands, it destroys your plugin, that means, i can not switch to i.e. apple tv with your plugin

seydx commented 6 years ago

So i wanted to ask you maybe to implement this function („as“ and „is“) without crashing the plugin? It doesnt need to support ‚state‘ cause the raspberry is always ‚on‘

jbree commented 6 years ago

Unfortunately I won't be able to look at this for a bit. My TV and RPi setup will be out of commission for a while. I'm not confident that this can work the way you'd like it to, considering that it would require two instances of cec-client running simultaneously (at least for an instant). My hypothesis is that this is what is causing the problem. If it's possible to invoke the as and is commands from an already-running instance of cec-client, a module could be built for homebridge-cec-accessory that sets a device active or inactive.