RogerSelwyn / Home_Assistant_SkyQ_MediaPlayer

Home Assistant SkyQ Media player component
MIT License
105 stars 16 forks source link

[BUG] Turn Off Called randomly #132

Closed dieterbahr closed 1 year ago

dieterbahr commented 1 year ago

Describe the bug
the Sky receiver (Media-Player) sporadically sends an OFF. Four seconds later in ON.

To Reproduce
Steps to reproduce the behavior:

  1. watching TV over SkyQ
  2. It doesn't matter which channel
  3. it was already in another version and then gone after some update
  4. Germany

Component versions

  1. Hardware-Version: 6763A3 (ESd-160s)
  2. Software-Version: Q210.000.18.00L (5k41154)
  3. Network-Version: 2.00
  4. Sorry, I can not say on witch Version the Problem is not shown

Your configuration
by UI

Your configuration.yaml
media_player:

Output of HA logs
There ist nothing about the Problem in the logs

Additional context
I only noticed the error because an automation that turns on my TV depends on the state of the receiver. If the receiver sends an OFF, my TV switches off I first compensated for the error with a delay of 6 seconds, since there are about 4 seconds between the signal OFF and ON again

RogerSelwyn commented 1 year ago
  1. it was already in another version and then gone after some update

Not sure what you mean by this.

Component versions

I'm interested in what version of the SkyQ integration you are using.

Are you sure you have no automation triggering media_player.turn_off? The only way it can happen is by something calling that service since there is nothing internal to the integration that calls the turn-off function.

dieterbahr commented 1 year ago

I can’t say at which version the Problem ist shown first. In one older version it was, and I did every update and the problem was gone for a long time-

I can’t say if the problem starts again on. I’m sorry. I use your integration in version 2.10.5 at the moment.

Am 15.12.2022 um 16:41 schrieb RogerSelwyn @.***>:

it was already in another version and then gone after some update Not sure what you mean by this. Component versions I'm interested in what version of the SkyQ integration you are using.

Are you sure you have no automation triggering media_player.turn_off? The only way it can happen is by something calling that service since there is nothing internal to the integration that calls the turn-off function.

— Reply to this email directly, view it on GitHub https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/issues/132#issuecomment-1353289122, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGVZJYACUUX2Z3MECOCRH3WNM3ZJANCNFSM6AAAAAAS73GP2E. You are receiving this because you authored the thread.

RogerSelwyn commented 1 year ago

I can’t say if the problem starts again on. I’m sorry.

From this I understand that you don't know if the current version causes a problem.

If you still have the problem, you need to validate that you have no automation calling media_player.turn_off against the SkyQ entity, since I see no other way that a turn off could occur.

RogerSelwyn commented 1 year ago

Additionally I would check in Developer Tools that the entity state is changing to Off, or whether it is changing to Unavailable. If Unavailable, then you need to check your network connectivity.

RogerSelwyn commented 1 year ago

Your configuration by UI

Your configuration.yaml media_player:

  • platform: skyq name: SkyQ host: 192.168.178.53

Just noticed you have stated you have configured via UI (I.e. the Devices & Services dialogue), but then also provide some config from configuration.yaml. These are mutually exclusive, you should not use both for the same Sky box.

dieterbahr commented 1 year ago

I tested the manual configuration to see if both variants had the same problem. now I'm trying version 2.9.11. I downloaded it as a zip and copied it to the appropriate folder and restarted. It still shows me version 2.10.5, but it sure is version 2.9.11 The SkyQ receiver has now been running for about 2 hours WITHOUT an OFF or ON signal being sent.

RogerSelwyn commented 1 year ago

Did you check the points I suggested above?

If you still have the problem, you need to validate that you have no automation calling media_player.turn_off against the SkyQ entity, since I see no other way that a turn off could occur.

Additionally I would check in Developer Tools that the entity state is changing to Off, or whether it is changing to Unavailable. If Unavailable, then you need to check your network connectivity.

Finally, check to see if you are the switch generator, whether anything is toggling the switch. As I've said before, the only way a turn_off/on happens is if it is user initiated.

If needs be, I can guide you to adding a debug statement in the turn_off routine to validate it is getting called.

dieterbahr commented 1 year ago

So, i tried 2.9.11 since more than 4 ours and the receiver don`t send off. Maybe it is a problem with 2.10.x I testet 2.10.2 and its the same problem. I have automations with the state of the skyQ receiver. That is my Problem. When the receiver is going from playing to off for 10 sec. it switches off my TV

RogerSelwyn commented 1 year ago

Tomorrow I will give you an updated version with some extra debugging in it.

RogerSelwyn commented 1 year ago

Just checking. Is the sky box actually turning off, or is it just showing as turned off?

RogerSelwyn commented 1 year ago

Please try this release - https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/releases/tag/v2.10.6a1 - which you can install as a beta release via HACS.

Please make sure you have the following in your configuration.

logger:
  logs:
    custom_components.skyq: debug

Then let it run and report back what the logs show.

dieterbahr commented 1 year ago

Bildschirmfoto 2022-12-22 um 11 28 39 Good Morning, today i switched on the SkyQ 3 hours ago. Version 2.9.10 . Everything is fine. Now i put this logger to my configuration and will test you Beta.

i create an automation which tell me when the state of skyQ is changing 10 minutes after I use your beta, skyQ tells me OFF and 4 seconds later ON This message from my automation is comming nearly every 30 minutes

RogerSelwyn commented 1 year ago

Sorry, missed your comment. I'll review it after Christmas.

RogerSelwyn commented 1 year ago

Just a quick look, I see there is a potential bug, since it shouldn't go to off straight away after a connection failure, it should wait 10 seconds (I think), before reporting off.

RogerSelwyn commented 1 year ago

In essence you don't have a 100% reliable connection.

RogerSelwyn commented 1 year ago

Try this release - https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/releases/tag/v2.10.6a2

I'd also recommend looking at the network connectivity to your box. You will only get that happening when connectivity fails (temporarily), or the box is physically switched off.

dieterbahr commented 1 year ago

Hi, first merry christmas :-)

If the SkyQ sends OFF / ON, the BOX is not off and does not lose connectivity. With version 2.9.10 the problem is NOT. I will try your version tomorrow.

RogerSelwyn commented 1 year ago

Merry Christmas to you to.

Just to repeat again, the SkyQ integration is not sending a Turn Off/Turn On top the box (if it was it would show in your log). What your log shows is that the box is not available from home assistant server.

What I need to investigate is why it isn’t seeing in 2.9.10.

RogerSelwyn commented 1 year ago

Back again, Christmas Day, but the family is out and I'm doing the veggies.

What you've identified is a bug in 2.9.10 which isn't reporting when connectivity is lost properly. When it looses connectivity (and I simulate this by blocking its access via my firewall), you should get a couple of D0010 with increasing seconds, then a W0010. It looks like when it was losing connectivity it was immediately marking it as unavailable, when it should only do that after 10 seconds.

But then also a bug in 2.10.x where it was switching to unavailable straightaway rather than waiting 10 seconds.

dieterbahr commented 1 year ago

Here the Log from yesterday. Wenn i switch off the sky i use the eco-mode it seems like 2.10.6a2 works. my automations are working and my message - automations don`t send me off and on from the sky receiver. Only wenn i realy switch off or on

Bildschirmfoto 2022-12-26 um 09 02 56

RogerSelwyn commented 1 year ago

You've got a definite network problem, you can see in the log when it can't connect and when it reconnects. When it reconnects within 10 seconds it won't show as unavailable, when it doesn't reconnect in that time it will go unavailable.

RogerSelwyn commented 1 year ago

In any case, are you happy this bug is now fixed?

dieterbahr commented 1 year ago

You've got a definite network problem, you can see in the log when it can't connect and when it reconnects. When it reconnects within 10 seconds it won't show as unavailable, when it doesn't reconnect in that time it will go unavailable.

But my router and my repeater do not tell me a problem. How can i find out if there is a problem? Nothing in the logs of my router or repeater (AVM 7590 an FritzRepeater3000)

And, yes, i think its fine for me at the moment, becaus my automations are doing what they should do: Thanks a lot

RogerSelwyn commented 1 year ago

Fixed with - https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/releases/tag/v2.10.6