travisghansen / hass-pfsense

pfSense integration with Home Assistant
193 stars 27 forks source link

What is this error? "Watchman_Missing_Entities" #112

Open bearhntr opened 2 years ago

bearhntr commented 2 years ago

I am fanatical about errors in HomeAssistant. I had installed the HACS pfSense integration, and was having no problems or errors. Last week I noticed that HACS (The Watcher report was showing this). I completely uninstalled pfSense and all related folders and entities. Waited 2 days for the DB Purge to occur and re-installed. I am seeing this error, and cannot figure out what is wrong.

image

HASS-OS on HP ThinClient T620 - pfSense is a Proxmox VM

image image image

bearhntr commented 1 year ago

I was just notified yesterday that there was an update to the HACS pfSense -- I installed it...and still getting these errors

image

travisghansen commented 1 year ago

Welcome! I have no idea what that is :( are there errors in the log or something otherwise in a bad state?

bearhntr commented 1 year ago

@travisghansen - I see that in the "WATCHER" app that tracks things like this. I installed it from HACS. It basically tells when something is broken or not functioning as it should.

I am happy to collect anything you need/want - just tell me what you need and how to get it.

travisghansen commented 1 year ago

Well I’m unclear what it’s saying is wrong. What does it consider to be broken currently?

bearhntr commented 1 year ago

@travisghansen --- so apparently it "WATCHER" did not like the way the lines were in the .YAML. I went through the entire SERVICES.YAML file and commented out (#) each of the lines listed, and restarted - and the error is gone.

Here is my version of the SERVICES.YAML file:

close_notice:
  # Service name as shown in UI
  name: Close notice
  # Description of the service
  description: Closes a notice(s).
  # If the service accepts entity IDs, target allows the user to specify entities by entity, device, or area. If `target` is specified, `entity_id` should not be defined in the `fields` map. By default it shows only targets matching entities from the same domain as the service, but if further customization is required, target supports the entity, device, and area selectors (https://www.home-assistant.io/docs/blueprint/selectors/). Entity selector parameters will automatically be applied to device and area, and device selector parameters will automatically be applied to area. 
  #target:
  # Different fields that your service accepts
  fields:
    entity_id:
      description: pfSense entity id
    #   example: "binary_sensor.pfsense_localdomain_pending_notices_present"

    # Key of the field
    id:
      # Field name as shown in UI
      name: Notice ID
      # Description of the field
      description: The notice ID
      # Whether or not field is required (default = false)
      required: false
      # Advanced fields are only shown when the advanced mode is enabled for the user (default = false)
      advanced: false
      # Example value that can be passed for this field
      example: "all"
      # The default field value
      default: "all"

file_notice:
  name: File notice
  description: Files a notice(s).
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"

    id:
      name: Notice ID
      description: The notice ID
      required: true
      advanced: false
      example: "all"
      default: "all"

    notice:
      name: Notice message
      description: The notice message
      required: true
      advanced: false
      example: "hello world from hass"
      default: ""

    category:
      name: Notice category
      description: The category of the notice
      required: false
      advanced: true
      example: "General"
      default: "HASS"

    url:
      name: Notice url
      description: The url of the notice
      required: false
      advanced: true
      example: "https://example.com"
      default: ""

    priority:
      name: Notice priority
      description: The priority of the notice
      required: false
      advanced: true
      example: 1
      default: 1

    local_only:
      name: Only show in the UI
      description: Do not send the notice via email, etc
      required: false
      advanced: true
      example: false
      default: false

start_service:
  name: Start service
  description: Starts a service.
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"
    service_name:
      name: Service Name
      description: The name of the service.
      required: true
      advanced: false
      example: "haproxy|dhcp|dpinger|.."
      default: ""

stop_service:
  name: Stop service
  description: Stops a service.
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"
    service_name:
      name: Service Name
      description: The name of the service.
      required: true
      advanced: false
      example: "haproxy|dhcp|dpinger|.."
      default: ""

restart_service:
  name: Restart service
  description: Restarts a service.
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"
    service_name:
      name: Service Name
      description: The name of the service.
      required: true
      advanced: false
      example: "haproxy|dhcp|dpinger|.."
      default: ""

reset_state_table:
  name: Reset state table
  description: Force all existing connections to close and reestablish 
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"

kill_states:
  name: Kill states
  description: Remove all state table entries for source, or from source to destination
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"

    source:
      name: Source
      description: Host or network
      required: true
      advanced: false
      example: "0.0.0.0/0"
      default: ""

    destination: 
      name: Destination
      description: Host or network (optional)
      required: false
      advanced: false
      example: "192.168.0.1/24"
      default: ""

system_halt:
  name: Halt system
  description: Halts the system.
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"

system_reboot:
  name: Reboot system
  description: Reboots the system.
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"

send_wol:
  name: Send WOL
  description: Sends wake-on-lan magic packet.
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"

    interface:
      name: Interface Name
      description: The name of the interface.
      required: true
      advanced: false
      example: "wan|lan|opt1|opt2|..."
      default: ""

    mac:
      name: MAC Address
      description: The target mac address.
      required: true
      advanced: false
      example: ""
      default: ""

set_default_gateway:
  name: Set Default Gateway
  description: Set the default gateway for ipv4 and ipv6.
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"

    gateway:
      name: Gateway Name
      description: The name of the gateway.
      required: true
      advanced: false
      example: "GW_WAN, '-' is None and '' is Automatice"
      default: ""

    ip_version:
      name: IP Version
      description: The IP version to update.
      required: true
      advanced: false
      example: "4|6"
      default: "4"

exec_php:
  name: Exec PHP Script
  description: Execute a fully php script.
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"

    script:
      name: Gateway Name
      description: The name of the gateway.
      required: true
      advanced: false
      example: "GW_WAN, '-' is None and '' is Automatice"
      default: ""

exec_command:
  name: Exec Command
  description: Execute a command.
  fields:
    entity_id:
      description: pfSense entity id
    #  example: "binary_sensor.pfsense_localdomain_pending_notices_present"

    command:
      name: Command
      description: The command to run.
      required: true
      advanced: false
      example: "ping -c 1 yahoo.com"
      default: ""
bearhntr commented 1 year ago

I commented these lines: 12, 35, 91, 106, 121, 136, 144, 168, 176, 184, 208, 232, 248

travisghansen commented 1 year ago

That seems like an overly aggressive tool treating an example as error. Maybe we should raise an issue with them?

bearhntr commented 1 year ago

I would not know how to do that - per se. Your code is the only place I have ever seen 'example' used like that - seen others, where it is a "comment". As there appear to a large number of lines where you have used 'example' - that did not tag as an error.

Not knowing .YAML myself, I cannot say. 😥

Here is the Integration that was doing it: https://github.com/dummylabs/thewatchman