- binary_sensor:
    name: MQTT Broker TCP
    unique_id: mqtt_broker_tcp
    device_class: connectivity
    # Opdater host hvis MQTT-brokeren flyttes til en anden maskine.
    command: >-
      python3 -c "import socket; s=socket.socket(); s.settimeout(2);
      print('ON' if s.connect_ex(('10.0.0.142', 1883)) == 0 else 'OFF')"
    payload_on: "ON"
    payload_off: "OFF"
    scan_interval: 60