Comments (29)
Hi again, it is malformed because it contains formatting that interferes with Github
I have added it to the file below
Code.txt
from ha-samsungtv-smart.
Hi again, with homekit installed as seen in the integrations below then you get the platform events "homekit_tv_remote_key_pressed" when using the iPhone Control Center Remote control for the TV.
Then all Samsung TVs respond to the same key clicks sent to it e.g. "KEY_UP" to click upwards on the tv or "KEY_HOME" to go to the Menu. So my suggestion was just to have the ability to pick up those types of events so everyone can enjoy using the iPhone Control Center Remote to control their Samsung TVs.
So to test this you just install the HomeKit Integration and listen to events "homekit_tv_remote_key_pressed" and then use the automation above to learn how to integrate it into your repo.
I hope it helps with this explanation.
from ha-samsungtv-smart.
ok, now I'm able to add it to HA: thanks @Teglgaard !
this is the code:
`alias: Call Samsung TV on HomeKit Remote key presses
description: ''
trigger:
- platform: event
event_type: homekit_tv_remote_key_pressed
event_data: {}
condition: []
action: - service: media_player.play_media
data_template:
entity_id: '{{ trigger.event.data[''entity_id''] }}'
media_content_type: send_key
media_content_id: >-
{% set key_map = {'arrow_right': 'KEY_RIGHT', 'arrow_down' : 'KEY_DOWN',
'arrow_left': 'KEY_LEFT', 'arrow_up': 'KEY_UP', 'select': 'KEY_ENTER',
'back': 'KEY_RETURN', 'information': 'KEY_HOME'} %} {{
key_map[trigger.event.data['key_name']] }}
mode: single
`
You already tried to add this automation in:
integration->samsungtv->sasmungtv->automation
?
from ha-samsungtv-smart.
thanks @Teglgaard all very usefull! all works fine!
from ha-samsungtv-smart.
No worries. The iPhone remote app is an app built in to iOS at least in iOS 14 that can be used to control an apple tv or compatible tv. I thought it would make sense to have ha-samsungtv-smart to pick up on the remote control which currently only can be controlled to my knowledge through the SmartThings integration in Home Assistant. Together with this and the HomeKit integration the tv can be controlled by using the automation posted below. I thought it could be smart just to natively pick up the event from homekit and pass it on to the Samsung TV since the keys are the same across the Samsung tv lineup.
You can see my automation setup here:
alias: Call Samsung TV on HomeKit Remote key presses
description: ''
trigger:
- platform: event
event_type: homekit_tv_remote_key_pressed
event_data: {}
condition: []
action: - service: media_player.play_media
data_template:
entity_id: '{{ trigger.event.data[''entity_id''] }}'
media_content_type: send_key
media_content_id: >-
{% set key_map = {'arrow_right': 'KEY_RIGHT', 'arrow_down' : 'KEY_DOWN',
'arrow_left': 'KEY_LEFT', 'arrow_up': 'KEY_UP', 'select': 'KEY_ENTER',
'back': 'KEY_RETURN', 'information': 'KEY_HOME'} %} {{
key_map[trigger.event.data['key_name']] }}
mode: single
from ha-samsungtv-smart.
@ollo69 this i Apple remote on iPhone:
from ha-samsungtv-smart.
from ha-samsungtv-smart.
No worries. The iPhone remote app is an app built in to iOS at least in iOS 14 that can be used to control an apple tv or compatible tv. I thought it would make sense to have ha-samsungtv-smart to pick up on the remote control which currently only can be controlled to my knowledge through the SmartThings integration in Home Assistant. Together with this and the HomeKit integration the tv can be controlled by using the automation posted below. I thought it could be smart just to natively pick up the event from homekit and pass it on to the Samsung TV since the keys are the same across the Samsung tv lineup.
You can see my automation setup here:
alias: Call Samsung TV on HomeKit Remote key presses
description: ''
trigger:
- platform: event
event_type: homekit_tv_remote_key_pressed
event_data: {}
condition: []
action:- service: media_player.play_media
data_template:
entity_id: '{{ trigger.event.data[''entity_id''] }}'
media_content_type: send_key
media_content_id: >-
{% set key_map = {'arrow_right': 'KEY_RIGHT', 'arrow_down' : 'KEY_DOWN',
'arrow_left': 'KEY_LEFT', 'arrow_up': 'KEY_UP', 'select': 'KEY_ENTER',
'back': 'KEY_RETURN', 'information': 'KEY_HOME'} %} {{
key_map[trigger.event.data['key_name']] }}
mode: single
I didn’t understand your automation: where I have to use it?
With it Apple remote works fine?
from ha-samsungtv-smart.
Your library does not pass on commands to my samsung tv from iOS Remote as you posted a picture off above. Maybe it has changed but I had to make my own automation together with homekit to make it work instead of your library just listening for the commands as shown in my automation.
from ha-samsungtv-smart.
So for me your library did not work with my samsung tv but maybe it is updated I have not tested without my own automation from iOS remote
from ha-samsungtv-smart.
I do not know how to built components so I do not know where it fits into your code. Running above code as an automation in home assistant solves the problem. My suggestion is just to have it natively in your library. For that I do not know how to code it.
from ha-samsungtv-smart.
what I don't understand is where you used this code in HA:
platform: event
event_type: homekit_tv_remote_key_pressed
event_data: {}
condition: []
action:
service: media_player.play_media
data_template:
entity_id: '{{ trigger.event.data[''entity_id''] }}'
media_content_type: send_key
media_content_id: >-
{% set key_map = {'arrow_right': 'KEY_RIGHT', 'arrow_down' : 'KEY_DOWN',
'arrow_left': 'KEY_LEFT', 'arrow_up': 'KEY_UP', 'select': 'KEY_ENTER',
'back': 'KEY_RETURN', 'information': 'KEY_HOME'} %} {{
key_map[trigger.event.data['key_name']] }}
mode: single
I do not know how to built components so I do not know where it fits into your code. Running above code as an automation in home assistant solves the problem. My suggestion is just to have it natively in your library. For that I do not know how to code it.
from ha-samsungtv-smart.
@Teglgaard how many item you have in homekit integration?
I have different item for HA bridge and Samsung TV...
from ha-samsungtv-smart.
Hi again,
@pilot1981 I only have one device as seen below
The code you see is inputted into "Configuration"->"Automation"->"Add Automation" button
Then edit the in yaml through the three dotted menu in top right corner and input:
`
alias: Call Samsung TV on HomeKit Remote key presses
description: ''
trigger:
- platform: event
event_type: homekit_tv_remote_key_pressed
event_data: {}
condition: []
action: - service: media_player.play_media
data_template:
entity_id: '{{ trigger.event.data[''entity_id''] }}'
media_content_type: send_key
media_content_id: >-
{% set key_map = {'arrow_right': 'KEY_RIGHT', 'arrow_down' : 'KEY_DOWN',
'arrow_left': 'KEY_LEFT', 'arrow_up': 'KEY_UP', 'select': 'KEY_ENTER',
'back': 'KEY_RETURN', 'information': 'KEY_HOME'} %} {{
key_map[trigger.event.data['key_name']] }}
mode: single
`
from ha-samsungtv-smart.
Hi @Teglgaard,
I tried to import this yaml code:
`
- platform: event
event_type: homekit_tv_remote_key_pressed
event_data: {}
condition: []
action: - service: media_player.play_media
data_template:
entity_id: '{{ trigger.event.data[''entity_id''] }}'
media_content_type: send_key
media_content_id: {% set key_map = {'arrow_right': 'KEY_RIGHT', 'arrow_down' : 'KEY_DOWN', 'arrow_left': 'KEY_LEFT', 'arrow_up': 'KEY_UP', 'select': 'KEY_ENTER', 'back': 'KEY_RETURN', 'information': 'KEY_HOME'} %} {{key_map[trigger.event.data['key_name']] }}
mode: single
`
but HA GUI answer: message malformed
what is wrong?
from ha-samsungtv-smart.
@Teglgaard your automation acceptd fine from HA, but I'm not able to change channel using arrow up/down right/left.
please can you share also configuration.yaml? I think it depend from source_list/channel_list...
from ha-samsungtv-smart.
Hi again, you can decide how it should work based on https://github.com/tavicu/homebridge-samsung-tizen/wiki/Commands
Then you just edit as you would like.
This is the entry in configuration.yaml for the tv
`samsungtv_smart:
- host: 192.168.0.xx
name: Samsung TV
api_key: xxxxxxxxxx`
from ha-samsungtv-smart.
Hi @Teglgaard, thanks for reply! so you don't add source list and channel list option in configuration.yaml?
from ha-samsungtv-smart.
@antonio1475 volume up Down and play pause can only be controlled when declared using a custom media player that you declare in config yaml. Everything is in that link what you need to do and just modify it to your use. Automation is for every other key tho besides these 4. As for issue when remote doesn’t work a simple reload of only tv bridge fixes it. Ever since I’ve declared and customized all the keys in automation and custom media player I’m not having those issues where remote keys stop responding
from ha-samsungtv-smart.
Sorry but I do not understand what is your request. What is the iPhone Remote App?
from ha-samsungtv-smart.
Sorry but I have no idea on how to test / fix this. Should this work using homekit? Do you have some specific error to check?
from ha-samsungtv-smart.
@Teglgaard this component don’t work in Apple remote control; where I can use your automation to fix it?
from ha-samsungtv-smart.
@Teglgaard THANK. YOU.
It works very nicely. Coming from an LG TV that works with homekit, this was missing in the Samsung TV.
It has some "dead time" between taps, so you have to wait half a second before tapping again, but it's so much better than nothing.
It was pretty hard finding this information (Samsung TV, iOS Remote, with or without HA). I hope one day this is native in the integration like the LG WebOS integration.
Plus, I learned that the iOS app sends events to HA, so it can be customized. Thanks again
from ha-samsungtv-smart.
@antonio1475
I’ve figured out a way on how to get rid of that delay, unfortunately it only works on android based tv or any other tv that has restApi that can send commands. Due to adb shell commands with android tv integration being slow to respond compared to native remote and my tv not having any restApi I’ve used an android keyboard with restApi that allows adb shell input key commands. Now the response speed of the control center remote is the same as native physical remote. Plus I’ve included a way to control play pause and volume up and down using the same principles. You can find it all here at Home assistant community link
from ha-samsungtv-smart.
@doudigit I don't remember what the delay felt like when I wrote that, but it works super fast now.
Do you guys get volume control working. Mine worked for a while but not anymore. All the rest works through the automation above.
from ha-samsungtv-smart.
@antonio1475 volume up and down, as well play/pause works and can be modified by using the custom media player integration in yaml in the link I’ve posted.
from ha-samsungtv-smart.
Just to clarify, I'm not using what you posted regarding restAPI (my QN93A isn't Android TV, and I don't know if it supports restAPI or not - doen't really matter for me), but I'm using the Automation by Teglgaard above:
alias: 'Tele comedor: HomeKit Remote'
description: ''
trigger:
- platform: event
event_type: homekit_tv_remote_key_pressed
event_data:
entity_id: media_player.samsungtv_smart
condition: []
action:
- service: media_player.play_media
data_template:
entity_id: '{{ trigger.event.data[''entity_id''] }}'
media_content_type: send_key
media_content_id: >-
{% set key_map = {'arrow_right': 'KEY_RIGHT', 'arrow_down' : 'KEY_DOWN',
'arrow_left': 'KEY_LEFT', 'arrow_up': 'KEY_UP', 'select': 'KEY_ENTER',
'back': 'KEY_RETURN', 'information': 'KEY_HOME', 'volume_up':
'KEY_VOLUP', 'volume_down': 'KEY_VOLUP'} %} {{
key_map[trigger.event.data['key_name']] }}
mode: single
Even though I have volume in there, the Volume keys from iOS Remote App aren't transmitted to Home Assistant (listening to events homekit_tv_remote_key_pressed shows that).
However, I found another issue in this repo mentioning this, that took me to this one. As per the last comment, removing the TV from Homekit app and re-adding it (Ha automatically generated a new code), it all now works (volume + automation keys). Let's hope it lasts.
Cheers 😄
from ha-samsungtv-smart.
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.
from ha-samsungtv-smart.
This issue was closed because it has been stalled for 7 days with no activity.
from ha-samsungtv-smart.
Related Issues (20)
- Smartthings.md Instructions point to dead link HOT 2
- Google Home CH Up/Down not working HOT 2
- Custom Turn on Action HOT 1
- Option to use just the binary sensor to detect power status
- HomeKit not working HOT 2
- Power button switch to art mode does not work HOT 6
- How to start TV applications
- Samsung UE49K"8000 (2017 Tizen TV) sources issue HOT 1
- Full screen mp4 file in the browser
- HDMI sources gone? HOT 19
- Error retrieving proxied image HOT 2
- Can´t find SamsungTV Smart Addon HOT 2
- SmartThingsTV pypi module HOT 3
- Source State - media_input_source
- Update to the Application ID list links
- When app is running, title shows HDMI1 name HOT 2
- OSErrors when using send media key HOT 6
- State does not update properly? HOT 27
- Unsupported media type: key_ambient HOT 2
- Problems with audio mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ha-samsungtv-smart.