Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turning TV off with source level #16

Open
rldn21 opened this issue Dec 27, 2018 · 4 comments
Open

Turning TV off with source level #16

rldn21 opened this issue Dec 27, 2018 · 4 comments

Comments

@rldn21
Copy link

rldn21 commented Dec 27, 2018

Hello, how can i get the tv turned off with the source selector input via Domoticz, all the other levels work fine but when i have the "0" level configured with the "self.run("off")" command it does nothing:

In the plugin.py

if Unit == 3: # TV source
if Command == 'Set Level':
if Level == 0:
self.run("off")

if Level == 10:
#_tv.send_req_ircc("AAAAAQAAAAEAAAAAAw==") #TV Num1
self.run("app", "com.webos.app.livetv")
self.GetTVInfo()
if Level == 20:
#_tv.send_req_ircc("AAAAAgAAABoAAABaAw==") #Denon
self.run("app", "com.webos.app.hdmi2")
self.tvPlaying = "HDMI 2"
if Level == 30:
#_tv.send_req_ircc("AAAAAgAAABoAAABbAw==") #Netflix
self.run("app", "netflix")
self.tvPlaying = "Netflix"
if Level == 40:
#_tv.send_req_ircc("AAAAAgAAABoAAABcAw==") #PleX
self.run("app", "cdp-30")
self.tvPlaying = "PleX"
if Level == 50:
#_tv.send_req_ircc("AAAAAgAAABoAAABdAw==") #YouTube
self.run("app", "youtube.leanback.v4")
self.tvPlaying = "YouTube"
if Level == 60:
#_tv.send_req_ircc("AAAAAgAAABoAAAB8Aw==") #Elden Home
self.run("app", "com.itkey.plexclient")
self.tvPlaying = "XPlay"

                self.tvSource = Level
                self.SyncDevices()

Anyone?

@GameDevHobby
Copy link
Owner

Does it work when you turn it off with the "Status" device?

@rldn21
Copy link
Author

rldn21 commented Dec 27, 2018

Does it work when you turn it off with the "Status" device?

Yes that works fine, but i want to turn the tv off with the selector level...

@GameDevHobby
Copy link
Owner

Have you tried adding "Off" as the last item in the list, as value 70? I'm not sure if 0 works as a value. "Off doesn't even show up in my selector, even though it's specified in the list.

@rldn21
Copy link
Author

rldn21 commented Dec 29, 2018

Have you tried adding "Off" as the last item in the list, as value 70? I'm not sure if 0 works as a value. "Off doesn't even show up in my selector, even though it's specified in the list.

When debugging via Domoticz log, the selector sends a parameter "Off" when selecting Level 0/Off.
So i added a level 70 to the selector within Domoticz and within plugin.py added to the level selectors:
if Level == 70: self.run("off")#_tv.turn_off() self.tvPlaying = "Turned off TV"
When selecting the new Level 70 ("Off"), it sends correctly a parameter "Select Level" - 70 instead of parameter "Off" and it works perfectly like this (see Domoticz Log).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants