Skip to content

Commit

Permalink
on_string_data example
Browse files Browse the repository at this point in the history
  • Loading branch information
idreamshen committed Nov 7, 2023
1 parent 8835da8 commit 0a6753f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,23 @@ loxone:
id: loxone1
loxone_ip: "192.168.50.124"
loxone_port: 9999
listen_port: 8888
on_string_data:
- logger.log:
format: "on_string_data, data=%s"
args: [ data.c_str() ]
- lambda: !lambda |-
if (data == "RELAY-SET-255,1,1") {
id(loxone_switch_1).turn_on();
} else if (data == "RELAY-SET-255,1,0") {
id(loxone_switch_1).turn_off();
}
switch:
- platform: gpio
pin: 22
name: "Loxone Switch 1"
id: loxone_switch_1
on_turn_on:
- lambda: !lambda |-
id(loxone1).send_string_data("RELAY-SET-255,1,1,OK");
Expand Down

0 comments on commit 0a6753f

Please sign in to comment.