|
|
|
|
@ -256,13 +256,13 @@ def config_home_assistant(device):
|
|
|
|
|
"availability_topic": device["topics"]["status"],
|
|
|
|
|
"qos": config['mqtt']['qos'],
|
|
|
|
|
"device": {
|
|
|
|
|
"name": f"{vendor} {device_type}",
|
|
|
|
|
"name": f"{vendor} {device_type} - {device_name}",
|
|
|
|
|
"manufacturer": vendor,
|
|
|
|
|
"model": device_type,
|
|
|
|
|
"identifiers": serial_number,
|
|
|
|
|
"sw_version": amcrest_version,
|
|
|
|
|
"hw_version": hw_version,
|
|
|
|
|
"via_device": "amcrest2mqtt",
|
|
|
|
|
"via_device": f"amcrest2mqtt v{version}",
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -294,7 +294,7 @@ def config_home_assistant(device):
|
|
|
|
|
"payload_on": "on",
|
|
|
|
|
"payload_off": "off",
|
|
|
|
|
"device_class": "motion",
|
|
|
|
|
"name": f"{device_name} Human",
|
|
|
|
|
"name": "Human",
|
|
|
|
|
"unique_id": f"{serial_number}.human",
|
|
|
|
|
},
|
|
|
|
|
json=True,
|
|
|
|
|
@ -309,7 +309,7 @@ def config_home_assistant(device):
|
|
|
|
|
"payload_on": "on",
|
|
|
|
|
"payload_off": "off",
|
|
|
|
|
"device_class": "motion",
|
|
|
|
|
"name": f"{device_name} Motion",
|
|
|
|
|
"name": "Motion",
|
|
|
|
|
"unique_id": f"{serial_number}.motion",
|
|
|
|
|
},
|
|
|
|
|
json=True,
|
|
|
|
|
@ -323,7 +323,7 @@ def config_home_assistant(device):
|
|
|
|
|
"state_topic": device["topics"]["config"],
|
|
|
|
|
"value_template": "{{ value_json.sw_version }}",
|
|
|
|
|
"icon": "mdi:package-up",
|
|
|
|
|
"name": f"{device_name} Version",
|
|
|
|
|
"name": "Version",
|
|
|
|
|
"unique_id": f"{serial_number}.version",
|
|
|
|
|
"entity_category": "diagnostic",
|
|
|
|
|
"enabled_by_default": False
|
|
|
|
|
@ -339,7 +339,7 @@ def config_home_assistant(device):
|
|
|
|
|
"state_topic": device["topics"]["config"],
|
|
|
|
|
"value_template": "{{ value_json.serial_number }}",
|
|
|
|
|
"icon": "mdi:alphabetical-variant",
|
|
|
|
|
"name": f"{device_name} Serial Number",
|
|
|
|
|
"name": "Serial Number",
|
|
|
|
|
"unique_id": f"{serial_number}.serial_number",
|
|
|
|
|
"entity_category": "diagnostic",
|
|
|
|
|
"enabled_by_default": False
|
|
|
|
|
@ -355,7 +355,7 @@ def config_home_assistant(device):
|
|
|
|
|
"state_topic": device["topics"]["config"],
|
|
|
|
|
"value_template": "{{ value_json.host }}",
|
|
|
|
|
"icon": "mdi:ip-network",
|
|
|
|
|
"name": f"{device_name} Host",
|
|
|
|
|
"name": "Host",
|
|
|
|
|
"unique_id": f"{serial_number}.host",
|
|
|
|
|
"entity_category": "diagnostic",
|
|
|
|
|
"enabled_by_default": False
|
|
|
|
|
@ -372,7 +372,7 @@ def config_home_assistant(device):
|
|
|
|
|
"state_topic": device["topics"]["storage_used_percent"],
|
|
|
|
|
"unit_of_measurement": "%",
|
|
|
|
|
"icon": "mdi:micro-sd",
|
|
|
|
|
"name": f"{device_name} Storage Used %",
|
|
|
|
|
"name": f"Storage Used %",
|
|
|
|
|
"object_id": f"{device_slug}_storage_used_percent",
|
|
|
|
|
"unique_id": f"{serial_number}.storage_used_percent",
|
|
|
|
|
"entity_category": "diagnostic",
|
|
|
|
|
@ -388,7 +388,7 @@ def config_home_assistant(device):
|
|
|
|
|
"state_topic": device["topics"]["storage_used"],
|
|
|
|
|
"unit_of_measurement": "GB",
|
|
|
|
|
"icon": "mdi:micro-sd",
|
|
|
|
|
"name": f"{device_name} Storage Used",
|
|
|
|
|
"name": "Storage Used",
|
|
|
|
|
"unique_id": f"{serial_number}.storage_used",
|
|
|
|
|
"entity_category": "diagnostic",
|
|
|
|
|
},
|
|
|
|
|
@ -403,7 +403,7 @@ def config_home_assistant(device):
|
|
|
|
|
"state_topic": device["topics"]["storage_total"],
|
|
|
|
|
"unit_of_measurement": "GB",
|
|
|
|
|
"icon": "mdi:micro-sd",
|
|
|
|
|
"name": f"{device_name} Storage Total",
|
|
|
|
|
"name": "Storage Total",
|
|
|
|
|
"unique_id": f"{serial_number}.storage_total",
|
|
|
|
|
"entity_category": "diagnostic",
|
|
|
|
|
},
|
|
|
|
|
|