OK, so I’m a noob hacking my way through this and maybe I’m going about this the wrong way, but here’s what I’m trying to do:
I have a Pro Control remote and processor (basically RTI) which I use to control my lounge TV. I have set that up to make an API call to HA to change the state of an input_select entity, which shows the current activity, either SkyQ, Amazon, Netflix, Plex, or Off.
That is all working OK.
What I want to do now is have the ability to send the command the other way on selecting an option in the input_select box in Lovelace. I have set up URLs that I can call on the RTI processor that trigger the correct macros - these work in a browser.
The issue I’m trying to overcome is not to trigger the input_select action when the state is changed by the remote sending the API call to update the current activity,
Reading through the reference materials I thought I could specify only to act on local events, but it doesn’t seem to work.
Here’s what’s in my configuration.yaml:
rest_command:
living_room_skyq:
url: http://192.168.10.182:8080/livingroomskyq
living_room_amazon:
url: http://192.168.10.182:8080/livingroomamazon
living_room_netflix:
url: http://192.168.10.182:8080/livingroomnetflix
living_room_plex:
url: http://192.168.10.182:8080/livingroomplex
living_room_off:
url: http://192.168.10.182:8080/livingroomoff
Here’s whats in my automations.yaml:
- id: '1618527999000'
alias: Local select living room TV activity
description: ''
trigger:
- platform: event
event_type: state_changed
origin: LOCAL
entity_id: input_select.living_room_tv_activity
condition: []
action:
service: >
{% if is_state('input_select.living_room_tv_activity', 'Sky Q') %} rest_command.living_room_skyq
{% elif is_state('input_select.living_room_tv_activity', 'Amazon') %} rest_command.living_room_amazon
{% elif is_state('input_select.living_room_tv_activity', 'Netflix') %} rest_command.living_room_netflix
{% elif is_state('input_select.living_room_tv_activity', 'Plex') %} rest_command.living_room_plex
{% elif is_state('input_select.living_room_tv_activity', 'Off') %} rest_command.living_room_off
{% else %}
{% endif %}
The config won’t load because it doesn’t like the origin: LOCAL statement. Error I get is:
Logger: homeassistant.config
Source: config.py:454
First occurred: 15:53:46 (1 occurrences)
Last logged: 15:53:46
Invalid config for [automation]: [origin] is an invalid option for [automation]. Check: automation->origin. (See /config/configuration.yaml, line 9).
Could anybody help me with this? I’m no programmer (but excellent at copy, paste and tweak) - I could be making a schoolboy error, or just barking up the wrong tree.
Thanks