farmio
(Matthias Alphart)
May 19, 2022, 12:58pm
21
Never tabs, always indent with 2 spaces.
Your yaml isn’t readable here unless you wrap it in code tags (tripple backticks a Line before and after ```).
You can edit your post to add these.
There is a lot of documentation about yaml - just search the web for it or stick to the examples from the HA documentation.
nitinuae
(Nitinuae)
May 19, 2022, 1:10pm
22
Best advice ever.
Ignoring the non readable issue - Is my approach correct (ie, expose the GA 6/1/23)
I have tried using this -
#knx EVENTS
event:
- address:
- “6/1/23”
Assuming that everytime 6/1/23 changes, HA event is triggered (again how do i debug?- where do I see these events)
I am trying to read a lot of documentation but it just isnt getting into me.
farmio
(Matthias Alphart)
May 19, 2022, 2:30pm
23
it’s not only non readable - one can’t tell if it is correct or not since indentation is lost. Just insert the backticks
In developer tools → Events
See
And see here for correct Knx event config syntax
nitinuae
(Nitinuae)
May 19, 2022, 2:57pm
24
Hello
Was able to read the knx events (using knx_events as listener)
So - again- trying to do this -
’
~
`
¬
#FAN CONTROL
alias: “Switch Fan”
trigger:
platform: event
event_type: knx_event
event_data:
address: ‘6/1/23’
data: 1
action:
alias: “switch off”
trigger:
platform: event
event_type: knx_event
event_data:
address: ‘6/1/23’
data: 0
action:
~
¬
`
’
PS - backticks DONOT work. I have never faced this issue - Maybe because we dont use US kbd? I have tried all combinations. We use qwerty UK kbd. Its frustrating - Why use some obscure backtick which cannot be even used by not american keyboards
farmio
(Matthias Alphart)
May 19, 2022, 3:19pm
25
Lol I use german layout without any problem. You can even copy and paste them ```
This is how it goes
``` # start code block
# insert your yaml
knx:
events:
- name: "all readable"
number: 1
``` # end code block
Or just use the button here
nitinuae
(Nitinuae)
May 19, 2022, 5:05pm
26
And I lost my ability to see knx_events.
Here is my cut paste (removed fan example)
`
##KNX EVENTS
event:
#Automation #############################################################
automation:
#SPEAKER CONTROL
alias: speaker control 1
trigger:
platform: event
event_type: knx_event
event_data:
address: “7/6/1”
data: 1
action:
service: switch.turn_on
data: {}
target:
entity_id: switch.inside_speakers
alias: speaker control off
trigger:
platform: event
event_type: knx_event
event_data:
address: “7/6/1”
data: 0
action:
service: switch.turn_off
entity_id: switch.inside_speakers
`
nitinuae
(Nitinuae)
May 19, 2022, 5:06pm
27
BTW - I did use the </> button on top.
Still it doesnt work.(posting the preformatted text- it still doesnt work)
See my earlier post - I used all possible symbols. One of them IS cut and paste of the character from website. It still doesnt work for me.
Makes me think twice…
farmio
(Matthias Alphart)
May 19, 2022, 6:03pm
29
You seem to have used single backticks instead of tripple… single is for inline, tripple for multi line
Anyway, there is no address
key in knx_event
s event_data
and the data
key is a subkey of event_data
.
trigger:
- platform: event
event_type: knx_event
event_data:
destination: "1/2/3"
data: 0
nitinuae
(Nitinuae)
May 19, 2022, 6:21pm
30
Caught this - Got events firing again.
Can you please check why the action is not firing.
I tried this also ```
- alias: speaker control off
trigger:
- platform: event
event_type: knx_event
event_data:
address: "7/6/1"
data: 0
condition: []
action:
- service: switch.turn_off
target:
entity_id: switch.inside_speakers
nitinuae
(Nitinuae)
May 19, 2022, 6:25pm
32
Frankly - This yaml seems to be beyond me (and I can see why I was frustrated earlier with KNX - Its actually my lack of yaml)
Since I am able to post properly now (finally!!!), here is -
`##KNX EVENTS
event:
- address:
- "7/6/*"
- "6/1/*"
#Automation#############################################################
automation:
#SPEAKER CONTROL
- alias: speaker control 1
trigger:
- platform: event
event_type: knx_event
event_data:
address: "7/6/1"
data: 1
condition: []
action:
- service: switch.turn_on
target:
entity_id: switch.inside_speakers
- alias: speaker control off
trigger:
- platform: event
event_type: knx_event
event_data:
address: "7/6/1"
data: 0
condition: []
action:
- service: switch.turn_off
target:
entity_id: switch.inside_speakers
#FAN CONTROL
- alias: "Switch Fan"
trigger:
platform: event
event_type: knx_event
event_data:
address: '6/1/23'
data: 1
action:
- service: fan.turn_on
entity_id: fan.sahilfan
- alias: "switch off"
trigger:
platform: event
event_type: knx_event
event_data:
address: '6/1/23'
data: 0`
Dujith
(Charles Evers)
May 19, 2022, 7:06pm
33
farmio already pointed this out 2 times, but still its in your code
There is no address in knx_event, its destination
So there is no valid event and the trigger will never “trigger” thus no action.
adress: ‘6/1/23’ → destination: ‘6/1/23’
1 Like
nitinuae
(Nitinuae)
May 19, 2022, 7:24pm
34
I read that but I am confused by old threads saying “destination” is now replaced by “address”.
I have tried replacing address with destination - still doesnot work.
`##KNX EVENTS
event:
- address:
- "7/6/*"
- "6/1/*"
#Automation#############################################################
automation:
#SPEAKER CONTROL
- alias: speaker control 1
trigger:
- platform: event
event_type: knx_event
event_data:
destination: "7/6/1"
data: 1
condition: []
action:
- service: switch.turn_on
target:
entity_id: switch.inside_speakers
- alias: speaker control off
trigger:
- platform: event
event_type: knx_event
event_data:
destination: "7/6/1"
data: 0
condition: []
action:
- service: switch.turn_off
target:
entity_id: switch.inside_speakers
`
Dujith
(Charles Evers)
May 19, 2022, 7:34pm
35
nitinuae:
old threads
Thats what you should use. With version changes old threads will become invalid.
As for the trigger itself: in the automation you cann see if a trigger is being activated.
If you send an 1 to the knx group 7/6/1 does it show as triggered on the automation?
And in the developer tools, what was the exact trigger you saw?
Just noticed that your indentation is wrong:
- alias: speaker control 1
trigger:
- platform: event
event_type: knx_event
event_data:
destination: "7/6/1"
data: 1
Should be:
- alias: speaker control 1
trigger:
- platform: event
event_type: knx_event
event_data:
destination: "7/6/1"
data: 1
farmio
(Matthias Alphart)
May 19, 2022, 8:06pm
36
thats exactly right. If it helps you can think of yaml as cut-down json (in fact json is valid yaml).
So
- platform: event
event_type: knx_event
event_data:
destination: "7/6/1"
data: 1
would be equal to JSON
[
{
"platform": "event",
"event_type": "knx_event",
"event_data": {
"destination": "7/6/1",
"data": 1
}
}
]
so indendated sub-blocks are dicts (objects) and -
prefixed sub-blocks are lists (arrays).
nitinuae
(Nitinuae)
May 20, 2022, 5:42am
37
Got this.
Anyway - To remove my confusion - I have now started using this purely using automation(in settings).
Yaml isnt my cup of tea…