SVENS0N
(Sven Beck)
November 21, 2022, 7:59pm
1
Hello,
i try to get the status of our projector via TCP IP.
In the picture you can see what I send and the awnser from my device for “The projector ist ON”
I tryed different things now in my config, but it leads to nothing so far (i’m pritty new in HA)
One of my first trys so far:
binary_sensor:
- platform: tcp
host: 192.169.4.4
port: 1024
payload: "00QPW\r"
name: Projector Status
value_on: 00001
I appreciate every hint!
WallyR
(Wally)
November 21, 2022, 9:28pm
2
This look like something that a Restful interface could be used for.
SVENS0N
(Sven Beck)
November 22, 2022, 9:12am
3
Thank you! But now i have the same problem, how to filter the incoming data for the right value?
I’m only interested in the „0“ or „1“ in the end.
SVENS0N
(Sven Beck)
November 22, 2022, 4:48pm
5
My incoming data is “NTCONTROL 0\r00001\r” for ON
and “NTCONTROL 0\r00000\r” for OFF
WallyR
(Wally)
November 23, 2022, 3:33am
6
You might have to make an binary sensor based on that restful sensor then.
template:
- binary_sensor:
- name: "Projector state"
state: >
{% if is_state('sensor.restful', 'NTCONTROL 0\r00001\r') %}
on
{% elif is_state('sensor.restful', 'NTCONTROL 0\r00000\r') %}
off
{% else %}
unknown
{% endif %}