michaelarnauts / cec-mqtt-bridge

A HDMI-CEC to MQTT bridge for connecting HDMI-CEC-devices to your Home Automation system.
145 stars 48 forks source link

Can't "Activate Source" via MQTT (Using directly via cec-client works) #25

Closed ned-kelly closed 4 years ago

ned-kelly commented 5 years ago

As the title suggests - I'm having issues activating the 'source' video using the cec-mqtt bridge...

To make matters more interesting, I can use the prefix/cec/cmd arguments (such as mute/unmute etc) -- So the issue appears only when running raw TX commands...

Anyone have any suggestions? I have a feeling this is a bug but I'm not sure what other information to provide...

Using latest build on github

austinlg96 commented 5 years ago

I'm experiencing the same issue. I've got it running in a docker container right now. Have you had any progress?

ned-kelly commented 5 years ago

@austinlg96 (and anyone else reading this in the future)... Finally figured it -- Basically, if the CEC adaptor is open whens starting by another device (say cec-client), or opened while cec-mqtt is running, then the service will fail (In my case, I had Home Assistant manually running cec-client also every 5 minutes which was breaking my cec-mqtt)...

Would be good to add some sort of error handling in here, and the ability to re-gain control of the CEC device if this happens...

michaelarnauts commented 4 years ago

@ned-kelly feel free to open a new issue for the auto reconnecting. I haven't looked at this code in a long time, so I'm not sure how it behaves on the initial connect, but I think I had something in there to reconnect when it got disconnected...