unmesh59
(Unmesh Agarwala)
September 30, 2020, 11:35pm
1
HA has discovered a switch entity for a tasmotized device but I would like to invert it’s meaning in Lovelace. In other words, when the switch toggle displayed in Lovelace is on, I want the real one to be off and vice versa.
How do I make this happen?
Thanks
switch:
- platform: template
switches:
something:
value_template: "{{ is_state('switch.tasmota', 'off') }}"
turn_on:
service: switch.turn_off
entity_id: switch.tasmota
turn_off:
service: switch.turn_on
entity_id: switch.tasmota
And use switch.something on your lovelace interface.
unmesh59
(Unmesh Agarwala)
September 30, 2020, 11:53pm
3
The configuration checker does not like in configuration.yaml
Should I have put it somewhere else?
Thanks
1 Like
What does the config checker say?
unmesh59
(Unmesh Agarwala)
October 1, 2020, 12:03am
5
It’s looking mangled because I did it through the GUI rather than through a SSH shell
Invalid config for [switch.template]: invalid slug switch.study_overheads_inverted (try switch_study_overheads_inverted) for dictionary value @ data['switches']. Got OrderedDict([('switch.study_overheads_inverted', OrderedDict([('value_template', "{{ is_state('switch.study_overheads', 'off') }}"), ('turn_on', OrderedDict([('service', 'switch.turn_off'), ('entity_id', 'switch.study_overheads')])), ('turn_off', OrderedDict([('service', 'switch.turn_on'), ('entity_id', 'switch.study_overheads')]))]))]). (See ?, line ?).
study_overheads_inverted is the newly created version of the existing study_overheads switch entity
You’ve put a dot in the name of the switch (where you replaced the word ‘something’), remove the dot.
1 Like
unmesh59
(Unmesh Agarwala)
October 1, 2020, 12:13am
8
It is working after restarting the HA server. Was there a less disruptive way of having it pick up the new config?
Thanks
KTibow
(Kendell R)
October 1, 2020, 1:08am
9
Go to the server control tab in GUI, and reload template switches.
unmesh59
(Unmesh Agarwala)
October 1, 2020, 1:54am
10
Thanks, @KTibow
I’m coming up the learning curve slowly but surely thanks to people here!
1 Like
Tricky
(Tricky)
October 1, 2020, 10:34pm
11
or… navigate to the URL of your tasmota device on your LAN (eg: 10.0.0.nn), and re-configure the device in the tasmota menu, Menu / Confiure Module… Tasmota has “i” inverse modes for switches/relays etc. No mod to HA required.
unmesh59
(Unmesh Agarwala)
October 2, 2020, 1:06am
12
I used a Gosund SW6 in a 3-way circuit by following this Tasmota template and it worked.
Some day, I will have the courage to play with inverse modes!