Hi, I have several binary sensors setup to check port is open, this works when the port is accessible but when the port is closed I’m getting error in logs instead of the updating the binary sensor.
Where am i going wrong?
- binary_sensor:
name: NAS Port
device_class: connectivity
unique_id: NASPORT
command: 'nc -z 192.168.5.100 1919 > /dev/null 2>&1 && echo success || echo fail'
payload_on: "success"
payload_off: "fail"
icon: >
{% if value == "fail" %} mdi:lan-disconnect
{% else %} mdi:transit-connection-variant
{% endif %}
scan_interval: 120
Logger: homeassistant.components.command_line.utils
Source: components/command_line/utils.py:62
integration: Command Line ([documentation](https://www.home-assistant.io/integrations/command_line), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+command_line%22))
First occurred: October 3, 2024 at 5:22:48 PM (896 occurrences)
Last logged: 11:13:04 PM
Timeout for command: 'nc -z 192.168.5.100 1919 > /dev/null 2>&1 && echo success || echo fail'