-
Notifications
You must be signed in to change notification settings - Fork 29
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
Some sources no longer work with Home Assistant #135
Comments
More info is posted here: home-assistant/core#83689 I would assume that pyvzio would have a similar issue if it is calling the REST interface. Specifically:
{"STATUS":{"RESULT":"SUCCESS","DETAIL":"Success"},"URI":"/menu_native/dynamic/tv_settings/devices/current_input","PARAMETERS":{"HASHONLY":"FALSE","FLAT":"TRUE","HELPTEXT":"FALSE"},"ITEMS":[{"CNAME":"current_input","TYPE":"T_STRING_V1","NAME":"Current Input","VALUE":"HDMI-1","ENABLED":"FALSE","HIDDEN":"TRUE","HASHVAL":2129379411}],"HASHLIST":[4012391352,3366813733]}
{"STATUS":{"RESULT":"FAILURE","DETAIL":"Failure"},"URI":"/menu_native/dynamic/tv_settings/devices/current_input","PARAMETERS":{"REQUEST":"MODIFY","VALUE":"CAST","HASHVAL":2129379411}} There are no other details, just that it fails. |
One additional note/workaround ... you can implement a button to call the key command:
This will pop open the list of inputs and calling again (and again ...) before it auto selects will cycle through the inputs. This is the old way I did this but that seems so kludgy. |
I have successfully found the issue, I will leave it to someone to fix. See exiva/Vizio_SmartCast_API#36 Inputs like HDMI-1, HDMI-2, ... CAST are now hdmi1, hdmi2, ... cast. |
For me, I have to get the hashval of the current input, and pass that to the command to change it, or else I get a hashval error. So I have to make two API calls like so, but at least I can switch inputs now.
|
As my example shows. You are using hdmi2 and not HDMI-2 and in newer TVs the second one no longer works |
@r14n ... are you using Home Assistant? If so, can you show me the YAML code you used for that singular command in something like a shell_command entity. I cannot get it to work exactly and only have been successful in running pieces (store the current HASHVAL as the state of an entity, then use it). I have been trying something like this:
|
Here's what I have in configuration.yaml:
|
All in the escaping ! i will try that one tomorrow. I add {{ip}}, {{port}}. {{auth}}, {{input}} to make it a little more generic so I can call the shell_command and pass in those values |
@r14n, that shell_command does not work for me. what are the ticks directions? All I get is an error that "hashval$(" file does not exist. I think there are some back ticks I am missing there |
No backticks in my command, can you paste what you are using and I'll check on it? |
|
I'm thinking it looks ok, where are you calling it from and how are the
variables {{auth}} {{ip}} etc being passed in?
…On Sun, Jan 1, 2023 at 6:05 PM kbrown01 ***@***.***> wrote:
vizio_source_select: 'hashval=$( curl -s -k -H "Content-Type:
application/json" -H "AUTH: {{auth}}" -X GET https://{{ip}}:{{port}}/menu_native/dynamic/tv_settings/devices/current_input
| jq --raw-output ".ITEMS[0].HASHVAL" ); curl -k -H "Content-Type:
application/json" -H "AUTH: {{auth}}" -X PUT -d "{\"REQUEST\":
\"MODIFY\",\"VALUE\": \"{{source}}\",\"HASHVAL\": $hashval}" https://
{{ip}}:{{port}}/menu_native/dynamic/tv_settings/devices/current_input'
—
Reply to this email directly, view it on GitHub
<#135 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABDZDFQHJF5MU466N6VVCBTWQIEVLANCNFSM6AAAAAASZXLEZQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
and ... `Logger: homeassistant.helpers.script.websocket_api_script websocket_api script: Error executing script. Unexpected error for call_service at pos 1: [Errno 2] No such file or directory: 'hashval=$(' |
` |
FYI, I tried it without the variables with fixed values and I get the same error |
What operating system are you using? Is the shell bash?
…On Sun, Jan 1, 2023 at 6:35 PM kbrown01 ***@***.***> wrote:
FYI, I tried it without the variables and I get the same error
—
Reply to this email directly, view it on GitHub
<#135 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABDZDFWUGZX3PVQL3MTMBSLWQIIFBANCNFSM6AAAAAASZXLEZQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Just to make sure, in your configuration.yaml, you have shell_command with the vizio_source_select nested below right? shell_command: |
I use an !include so in
And the
I was only trying to make things a little more generic. HASHVAL 2023834057 is "cast" which in 90% of the cases where I have a TV that I want to move to "hdmi1" BUT not always (like going from "hdmi2" to "hdmi1" on some rare occasions. I also need to have the ip, port, auth codes passed in because I have 6 total TVs (Deck, Patio, Master, Kitchen, Living, Guest) and it would be so dumb to create a sensor of current HASHVAL for each. Love your approach, just cannot seem to get it to work in my HA install. I use "jq" a lot for other things so I know that isn't the issue and in fact carving off just the "hashval" part and executing only the curl piped to "jq" also works to get the HASHVAL. One thing that strikes me as odd but maybe it is some simple hash is the hashcode seems to be always the same ... meaning no date or particular TV info or anything is in it ... simply the name of the current input. I get the same code like 2023834057 for current input as "cast" for every TV. Since I use a JSON file to manage all my TVs (inputs, DirecTV codes, favorites in DirecTV, etc. I could just add the HASHVAL to it and look it up in the JSON. I find your solution more elegant though. |
And OS is Linux with Home Assistant Core installed. Updated to the latest: Home Assistant 2022.12.8 |
Maybe this in the documentation is the issue? https://www.home-assistant.io/integrations/shell_command/ "The commands can be dynamic, using templates to insert values for arguments. When using templates, shell_command runs in a more secure environment which doesn’t allow any shell helpers like automatically expanding the home dir ~ or using pipe symbols to run multiple commands." My example is using templates. |
That does sound like it could be the issue, maybe try putting it directly in configuration.yaml? |
Note: I am not sure this is the right place, perhaps not. Not sure whether this is generic select source issue or an issue with pyvizio.
Some sources (specifically HDMI-1,2,3,4) as well as CAST no longer work with media_player.select_source
service: media_player.select_source
data:
source: HDMI-1
target:
entity_id: media_player.office_vizio
Worked up until the last Vizio update on newer TVs.
It is like select source works to select an app, but can't be used to change input.
Note that I have two V505-J09 which worked until Vizio update got installed. I have another Vizio (older) which had no update and it works perfectly. I can set source to HDMI-1, CAST, Netflix, etc and it will switch between those. After the update for the other TVs, yu can no longer use Home Assistant to switch between these sources.
In a quick test I can confirm that using select_source does not select any "inputs" now. From the HA state:
source_list:
HDMI-1
HDMI-2
HDMI-3
COMP
TV
All these no longer work, all other "apps" do. This also applies to CAST, you cannot get back to it after switching to something like Netflix. The code I use is all posted here which I cannot use anymore for these TVs:
https://github.com/kbrown01/Vizio_DirecTV
The text was updated successfully, but these errors were encountered: