If I turn on discovery both on HA and zigbee2mqtt, do devices automatically appear as a sensor on HA?
Within HA configuration.yaml, I have:
mqtt:
discovery: true
zigbee2mqtt configuration.yaml:
homeassistant: true
I restart Z2M first and then HA. Z2M shows the following in the logs:
Jun 07 20:58:33 zigbeepi npm[934]: 2018-6-7 20:58:33 INFO MQTT publish, topic: 'homeassistant/binary_sensor/0x00158d0001b149eb/contact/config', payload: '{"payload_on":false,"payload_off":true,"value_template":"{{ value_json.contact }}","device_class":"door","json_attributes":["battery","voltage"],"state_topic":"zigbee2mqtt/window_ensuite_velux","availability_topic":"zigbee2mqtt/bridge/state","name":"window_ensuite_velux","unique_id":"0x00158d0001b149eb_contact_zigbee2mqtt"}'
Looking within States on HA, thereās no sensor that looks like this.
Am I misunderstanding how this works? Iām hoping for a sensor entry similar to how Xiaomi works within HA.
I tried the manual method by turning off discover on HA and Z2M, and using the following sensor:
binary_sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/window_ensuite_velux"
availability_topic: "zigbee2mqtt/bridge/state"
payload_on: false
payload_off: true
value_template: "{{ value_json.contact }}"
device_class: "door"
json_attributes:
- "battery"
- "voltage"
This just results in the following entry in States:
binary_sensor.mqtt_binary_sensor off friendly_name: MQTT Binary sensor device_class: door
I think Iām misunderstanding something here?