schoey
November 25, 2021, 3:22pm
1
Hi all, i’m trying to add the code below to my configuration.yaml to be able to control 2 blinds, but i get all kinds of errors when i restart HA.
I get why (kinda), but i just don’t know how to seperate them correctly.
Any help would be massively appreciated.
input_number:
lounge_blinds:
name: Lounge Blinds
initial: 0
min: 0
max: 13
step: 1
automation old:
- alias: Send Lounge Blinds Value
trigger:
platform: state
entity_id: input_number.lounge_blinds
action:
- service: mqtt.publish
data_template:
topic: "shadePosition/loungeblinds"
payload_template: "{{ states('input_number.lounge_blinds') | int }}"
qos: 2
retain: true
input_number:
bedroom_blinds:
name: bedroom Blinds
initial: 0
min: 0
max: 13
step: 1
automation old:
- alias: Send Bedroom Blinds Value
trigger:
platform: state
entity_id: input_number.bedroom_blinds
action:
- service: mqtt.publish
data_template:
topic: "shadePosition/bedroomblinds"
payload_template: "{{ states('input_number.bedroom_blinds') | int }}"
qos: 2
retain: true
When i save and restart with just the one instance, everything is good and i can control the blind with no problems, but when i add the other other blind i end up in all kinds of trouble lol
Thanks for taking the time to read this
Tinkerer
(aka DubhAd on GitHub)
November 25, 2021, 3:40pm
2
What errors? Without them we’re just going to be guessing?
Did you run a command line (not UI) config check after making those changes?
schoey
November 25, 2021, 3:46pm
3
Yeah sorry, i’ll post up the errors later.
Thanks for your reply…this yaml stuff is a bit of a nightmare
schoey
November 25, 2021, 3:50pm
4
Here is the error…
duplicated mapping key at line 163, column -107:
input_number:
^
You have two time input_number in your config
schoey
November 25, 2021, 3:52pm
6
Yeah, but how can i integrate both sets of blinds without having duplicated keys ?
jazzyisj
(Jason)
November 25, 2021, 4:01pm
7
That error is telling you you have duplicate key - input_number.
Use one “key”, put all the elements under it.
input_number:
lounge_blinds:
name: Lounge Blinds
initial: 0
min: 0
max: 13
step: 1
bedroom_blinds:
name: bedroom Blinds
initial: 0
min: 0
max: 13
step: 1
automation old:
- alias: Send Lounge Blinds Value
trigger:
platform: state
entity_id: input_number.lounge_blinds
action:
- service: mqtt.publish
data_template:
topic: "shadePosition/loungeblinds"
payload_template: "{{ states('input_number.lounge_blinds') | int }}"
qos: 2
retain: true
- alias: Send Bedroom Blinds Value
trigger:
platform: state
entity_id: input_number.bedroom_blinds
action:
- service: mqtt.publish
data_template:
topic: "shadePosition/bedroomblinds"
payload_template: "{{ states('input_number.bedroom_blinds') | int }}"
qos: 2
retain: true
Tinkerer
(aka DubhAd on GitHub)
November 25, 2021, 4:26pm
8
schoey
November 26, 2021, 11:04am
9
Thank you so much, it’s now working, and i actually understand it all now too.
Really appreciate it
schoey
November 26, 2021, 11:05am
10
Thanks for that, i’ll make sure to read it.
I appreciate your help