if you have a working physical remote, the best thing is to use the adb debug bridge. The learn command is super easy. In Dev tools services do androidtv.learn_sendevent with your entity. Then hit the remote button. And look in the notification. You will see the right sendevent command to use. super easy
ok… i’ll try… going from memory so i’ll do my best.
get the ip address of your tv. how to do this varies from tv to tv, but looks like you’ve connected it to another integration so hopefully you know how…
go to integrations-> add integration-> choose android debug bridge (it might be auto-detected already)
hit add device or configure (it might put you automatically in)
fill out the dialog. i think you only really need the host (ip address). can leave for auto detect on type if you don’t know. leave the rest as is.
follow the instructions on home assistant and on your tv.
that sets it up.
then to get the command, go to dev tools services. do this:
once the “call service button” turns green, you have 8 seconds to press a button on the remote control button you have for android. you will get a push notificatoin to home assistant (button left). open that up and you should see the command you need to send.
if you don’t know what to do with that, bring it back here and paste in the command you got.
that whole long blob is what you need to send. if you’re putting it in a lovelace card where you’re doing service_data, this is an example from my card (replace the send event data with your sendevent data:
notice that my 1 button is sending 4 sendevent commands. the first pair is the button press down. the second pair is the button press up. so a click requires all 4 for my android tv. yours has 6 sendevents. i don’t know why… but that’s what you got back… give it a try.
hmmm… ugh. I gotta admit I don’t see anything obviously wrong. what i’d if it were me is to try a couple other “simpler” commands to see if I can get any send event commands working. like try doing the exact thing for mute or volume (if your android TV does it’s own muting)
the other thing is maybe look at
Nerwyn knows this stuff super well. Maybe he knows your android box
not necessarily recommending you abandon what you’ve done. But maybe try that and see if that does channel up/down. If it does, he’s got it cracked. And either the code or his head has the answers
I can confirm that the remote.send_commandCHANNEL_UP/DOWN method works for me on Google TV channels. Possibly dumb question - are you trying to change channels within Android TV’s live streams or cable/satellite channels?
Just a question about sending the events via adb (as i tried it on my android tv), what does the adb_response in the developer tools say after sending?
Mine says:
A quick internet search reports that this may be a security feature of android 10 or higher and it is not possible to do the sendevent command, anyone can confirm?