I am struggling to turn on my LG TV with an external HTTP call. The LG TV turns on perfectly through the HA UI but I can not figure out what HTTP command is to send as I either get connection refused or method not allowed. I only have one device configured at this point and that is the LG TV as seen at the bottom of the configuration.yaml file. Any suggestions would be greatly appreciated. I’ve spent a lot of time in the forum and just can’t figure it out.
Some examples of the commands I’ve sent are as follows from my pc command line:
curl -k http://192.168.0.254:8123/api/services/media_player/turn_on?api_password=abcdef (response - Method not allowed)
curl -k http://192.168.0.254:8123/api/services/media_player/turn_on/?api_password=abcdef (response - Method not allowed)
Curl -k http://192.168.0.254:8123/api/?api_password=abcdef
this works and replies “API Running” so at least i’m connecting
curl -k http://192.168.0.254:8123/api/services/media_player/turn_on?api_password=abcdef{“entity_id”:“media_player.television”} (response - Method not allowed)
Partial configuration.yaml file
# Show links to resources in log and frontend
introduction:
# Enables the frontend
frontend:
# Enables configuration UI
config:
logger:
default: error
http:
api_password: abcdef
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# base_url: example.duckdns.org:8123
# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
# Optional, allows Home Assistant developers to focus on popular components.
# include_used_components: true
# Discover some devices automatically
# discovery:
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:
# Enables support for tracking state changes over time
history:
# View all events in a logbook
logbook:
# Track the sun
sun:
# Weather prediction
sensor:
- platform: yr
# Text to speech
tts:
- platform: google
group: !include groups.yaml
automation: !include automations.yaml
# LG TV Webos
media_player:
- platform: webostv
host: 192.168.0.216
mac: C8:08:E9:CC:ED:00
name: television
filename: webostv.conf