Dejan
(Dejan)
September 13, 2018, 5:49pm
21
so, i have try a lot of solution but… not working…
i have sucessfully add just 1 activity but not all…
in my configuration.yaml :
remote:
platform: harmony
name: tvlg
host: 192.68.1.86
in my switches.yaml
Regarde la TV
Regarde la TV:
value_template: "{{ is_state_attr('remote.lgtv', 'current_activity', 'Regarde la TV') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'Regarde la TV'
turn_off:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'PowerOff'
# Android TV
Android TV:
value_template: "{{ is_state_attr('remote.lgtv', 'current_activity', 'Android TV') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'Android TV'
turn_off:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'PowerOff'
and in my harmony_harmony_hub.conf :
Activities
31547838 - Regarder la TV
32707809 - Android Tv
-1 - PowerOff
Device Commands
53413622 - Lecteur multimédia Tanix
PowerToggle
Mute
VolumeDown
VolumeUp
DirectionDown
DirectionLeft
DirectionRight
DirectionUp
OK
Return
Menu
Home
Mouse
51830162 - Logitech Z-5500
PowerToggle
Mute
VolumeDown
VolumeUp
VolumeCenterDown
VolumeCenterUp
Settings
Effect
InputCoax
InputDirect
InputOptical
InputStereo1
InputStereo2
InputStereo3
SubWooferDown
SubWooferUp
SurroundDown
SurroundUp
Test
51830149 - Enregistreur numérique SFR
PowerToggle
0
1
2
3
4
5
6
7
8
9
Mute
VolumeDown
VolumeUp
ChannelPrev
ChannelDown
ChannelUp
DirectionDown
DirectionLeft
DirectionRight
DirectionUp
OK
Stop
Play
Rewind
Pause
FastForward
Record
Menu
Guide
Info
Exit
VOD
51830092 - TV LG
PowerOff
PowerOn
PowerToggle
0
1
2
3
4
5
6
7
8
9
Mute
VolumeDown
VolumeUp
ChannelPrev
ChannelDown
ChannelUp
DirectionDown
DirectionLeft
DirectionRight
DirectionUp
OK
Stop
Play
Rewind
Pause
FastForward
Record
Subtitle
Back
Teletext
Favorite
List
LiveTv
Green
Red
Blue
Yellow
Guide
Info
PageDown
PageUp
Exit
Aspect
Settings
3D
App/*
Input
InputAv1
InputAv2
InputComponent1
InputHdmi1
InputHdmi2
InputHdmi3
InputHdmi4
InputTv
MyApps
Q.Menu
SimpLink
Smart
T.Opt
Tv/Radio
where is my error ???
when i add activity in configuration.yaml i have just possibility to turn on / off this activity
petro
(Petro)
September 13, 2018, 6:05pm
22
your switches are miss spelled and they need to be case sensative: In your first switch: Regarder la TV
is missing the r at the end. In your second switch: Android TV
the v in TV need to be lowercase.
Regarde la TV:
value_template: "{{ is_state_attr('remote.lgtv', 'current_activity', 'Regarder la TV') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'Regarder la TV'
turn_off:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'PowerOff'
# Android TV
Android TV:
value_template: "{{ is_state_attr('remote.lgtv', 'current_activity', 'Android Tv') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'Android Tv'
turn_off:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'PowerOff'
1 Like
Dejan
(Dejan)
September 13, 2018, 6:33pm
23
thank you i have corrected switches.yaml
but same result
i just view harmony hub but 0 activity
petro
(Petro)
September 13, 2018, 6:52pm
24
Are you placing them in the switch category inside your configuration.yaml? Are you looking in the switches group on the default view in the Home Assistant interface?
1 Like
Dejan
(Dejan)
September 13, 2018, 7:01pm
25
i have placed file switches.yaml in CONFIG_DIR folder
and in configuration.yaml when include ```
switch: !include switches.yaml
i have error in confirguration :
Invalid config for [switch]: required key not provided @ data['platform']. Got None. (See /share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/configuration.yaml, line 102). Please check the docs at https://home-assistant.io/components/switch/
and when i add platform - template i have this error :
Invalid config for [switch.template]: [Regarder la TV] is an invalid option for [switch.template]. Check: switch.template->switches->Regarder la TV. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.template/
petro
(Petro)
September 13, 2018, 7:05pm
26
You’re missing the -platform.
Your switches file contents should look like this:
- platform: template
switches:
Regarde la TV:
value_template: "{{ is_state_attr('remote.lgtv', 'current_activity', 'Regarder la TV') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'Regarder la TV'
turn_off:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'PowerOff'
# Android TV
Android TV:
value_template: "{{ is_state_attr('remote.lgtv', 'current_activity', 'Android Tv') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'Android Tv'
turn_off:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'PowerOff'
1 Like
Dejan
(Dejan)
September 13, 2018, 7:09pm
27
seconde error :
Invalid config for [switch.template]: [Regarder la TV] is an invalid option for [switch.template]. Check: switch.template->switches->Regarder la TV. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.template/
petro
(Petro)
September 13, 2018, 7:11pm
28
bah, you need to follow the yaml rules. No capitals, no spaces for section keys
petro:
Regarde la TV:
petro:
Android TV:
1 Like
Dejan
(Dejan)
September 13, 2018, 7:16pm
30
new error… i’m damn !!!
Error loading /share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/configuration.yaml: mapping values are not allowed here
in “/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/switches.yaml”, line 2, column 13
platform: template
switches:
tv:
value_template: “{{ is_state_attr(‘remote.lgtv’, ‘current_activity’, ‘tv’) }}”
turn_on:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: ‘tv’
turn_off:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: ‘PowerOff’
# Android TV
android:
value_template: "{{ is_state_attr('remote.lgtv', 'current_activity', 'android') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'android'
turn_off:
service: remote.turn_on
data:
entity_id: remote.lgtv
activity: 'PowerOff'
Dejan
(Dejan)
September 13, 2018, 7:36pm
31
YYYYYYYYYEEEEEEEEEEEESSSSSSSSSSSSS
is gooooddd it’s just a space before “switch”
work fine nowwwwwwwwwwwww
thank you very very very very much
1 Like
Dejan
(Dejan)
September 14, 2018, 1:28pm
32
new question, now it’s possible to add specifique commande to activity :
exemple : activity TV : Volume + / Volume - and any channel ?
second : in activity ANDROID (is for android tv box) is possibile to controle ? left, right, down , up , ok volume + / volume - ?
Thank you
david1
(David)
March 19, 2020, 1:57am
33
what are you using for lovelace?q
petro
(Petro)
March 19, 2020, 9:55am
34
Currently, I use something different. The images in this post are documented here .
Thanks for this advice! Works great!!