yes, when the TV is off, also no network activity, it takes some time… or indeed I need to press the power on button a couple of times.
About the automation:
I already tried to use the picto.
As pictograms are not allowed (something to do with special chars)in the configuration.yaml this isn’t working for me… Do you know any workarround for this ?
Well this makes perfect sense.
Also with the dimming, I think I saw an example with Kodi.
Most people want to dimm, only when they start playing something. Meaning if you are actually in the PLAY or PAUSE state, the lights will be dimmed. I find that a very neat and awesome automation.
Sadly with the Philips TV we have no way yet to check whether it is playing something.
And Universal Player defines ON as “something is being played on the media_player”
Edit: Or as STATE_ON, which is very weird. Probably because most players start with ON → Play → Idle, meaning you stopped watching your movie at Idle.
So we are kinda outta luck here.
Can you show me your basic universal player config? I will test that out and maybe also configure it for me. Maybe I’ll find a config solution or we then have the same problem.
something else noticed: when the TV is off… my log file is filled with:
File “/usr/src/app/homeassistant/helpers/entity.py”, line 221, in async_update_ha_state
await self.async_device_update()
File “/usr/src/app/homeassistant/helpers/entity.py”, line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/util/init.py”, line 324, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/media_player/philips_2016.py”, line 230, in update
self._source = self._tv.app_name + ’ ’ + self._tv.channel_name
TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘str’
Using it, I can actually check whether it is playing something on TV via Kodi (installed on the TV) or through cast and make my automation of lights. All these sources are shown in one player in frontend. Therefore, it is crucial to have a power state reported correctly. There is nothing odd how Universal player defines ON since Idle reserved only for those players which are always ON. This, however, cannot be the case for tv.
@nstrelow: I guess i have version 6.1 The paring user and password that was returned was just copied and pasted. I tried the pairing again today and the pairing shows error_is success: Pairing completed. with a user and a password. But still HA is unable to communicate wit the TV.
@nstrelow: Thanks for helping me out. I now am able to communicate with the tv. Previously the tv was autodiscovered and i think that was blocking my connection from the custom component. The discovery was turned off, but the discovered component was still in HA (but not visible due to my group and view settings). So now i removed the discovered device in the configuration page and after the reboot it is working.
again thanks for the help. now i will try to make automations that turn on receiver, tv, correct source etc.
Hmm, I do not think I can help you in any way. You can just try different curl commands and API path from the jointspace website. Maybe something else is working then. Or try resetting stuff?
You could also try the newest version, which is a more stable, but nothing related to your problem
I don’t like it, you even have the same API version as @mtol20.
I still think something has to be wrong with the pairing. Some wrong character or some pasting issue.
I could not reproduce it for myself, but I am trusting you and adding a special case.
Now when the the packageName is ‘NA’. it will try accessing channel information from /activities/tv and use that info.
If there is no info, then N/A - N/A is displayed, but it is still marked as channel.
I see, yeah you are right. The default of the universal player has Idle as off state.
Using a state_template you could try to make it work with philips_tv being idle
Here is the example: Universal media player - Home Assistant
Additionally I have added that the state is only idle, when an App is running. If you have Kodi running as app on the TV, this won’t help you. But it’s a start.
Feel free to change my code btw, you can just replace IDLE by ON
Now I have. You can use the built-in script editor. Just go to Configuration->Scripts and add everything there.
If you do not want to do that you can use the escaped character:
= \U0001F4F1
= \U0001F4FA
I tried the template before but it didn’t work, now I figured out the reason. As for Kodi as an app, I didn’t understand what you mean since I use Kodi media player as a separate component included as a child player in Universal Player. I also don’t have a “normal” tv channels, it goes via tv-box from my provider, so only apps run on my TV.
I, of course, can change your code. It seems to me that it’s better to do everything right from the beginning
I can’t reproduce the “NA” behaviour anymore. Now i get
{
“component”: {
“packageName”: “org.droidtv.playtv”,
“className”: “org.droidtv.playtv.PlayTvActivity”
}
}
Also i saw that you updated the code to force the state to off after turning off. I saw in other components that they are forcing an update instead of setting state to something that may be wrong. I think it’s a bit more safe like this.