{"action":"created","issue":{"url":"https://api.github.com/repos/Koenkk/zigbee2mqtt/issues/106","repository_url":"https://api.github.com/repos/Koenkk/zigbee2mqtt","labels_url":"https://api.github.com/repos/Koenkk/zigbee2mqtt/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/Koenkk/zigbee2mqtt/issues/106/comments","events_url":"https://api.github.com/repos/Koenkk/zigbee2mqtt/issues/106/events","html_url":"https://github.com/Koenkk/zigbee2mqtt/issues/106","id":330882842,"node_id":"MDU6SXNzdWUzMzA4ODI4NDI=","number":106,"title":"Battery Attribute not Visible within HA (MCCGQ11LM - Aqara Door/Window Sensor)","user":{"login":"jarrah31","id":3072303,"node_id":"MDQ6VXNlcjMwNzIzMDM=","avatar_url":"https://avatars3.githubusercontent.com/u/3072303?v=4","gravatar_id":"","url":"https://api.github.com/users/jarrah31","html_url":"https://github.com/jarrah31","followers_url":"https://api.github.com/users/jarrah31/followers","following_url":"https://api.github.com/users/jarrah31/following{/other_user}","gists_url":"https://api.github.com/users/jarrah31/gists{/gist_id}","starred_url":"https://api.github.com/users/jarrah31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarrah31/subscriptions","organizations_url":"https://api.github.com/users/jarrah31/orgs","repos_url":"https://api.github.com/users/jarrah31/repos","events_url":"https://api.github.com/users/jarrah31/events{/privacy}","received_events_url":"https://api.github.com/users/jarrah31/received_events","type":"User","site_admin":false},"labels":[{"id":894537367,"node_id":"MDU6TGFiZWw4OTQ1MzczNjc=","url":"https://api.github.com/repos/Koenkk/zigbee2mqtt/labels/help%20wanted","name":"help wanted","color":"008672","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2018-06-09T12:27:50Z","updated_at":"2018-06-22T05:57:15Z","closed_at":"2018-06-15T05:21:02Z","author_association":"NONE","body":"I can't see that this has been reported before, either in the forum on on here, so it's either an issue or my lack of understanding how this works.\r\n\r\nBasically, the battery attribute isn't appearing in HA as seen in this screenshot:\r\n<img width=\"427\" alt=\"screen shot 2018-06-09 at 13 19 48\" src=\"https://user-images.githubusercontent.com/3072303/41191469-e4c50d7e-6be7-11e8-98c3-3366899b4396.png\">\r\n\r\nI have auto discover turned on within HA and Z2M and I can see the battery messages are being sent to HA:\r\n```\r\nJun 09 12:37:26 zigbeepi npm[2855]: 2018-6-9 12:37:26 INFO MQTT publish, topic: 'zigbee2mqtt/window_ensuite_velux', payload: '{\"battery\":\"100.00\",\"voltage\":3065}'\r\nJun 09 13:08:37 zigbeepi npm[2855]: 2018-6-9 13:08:37 INFO MQTT publish, topic: 'zigbee2mqtt/window_ensuite_velux', payload: '{\"battery\":\"100.00\",\"voltage\":3065,\"contact\":false}'\r\nJun 09 13:08:38 zigbeepi npm[2855]: 2018-6-9 13:08:38 INFO MQTT publish, topic: 'zigbee2mqtt/window_ensuite_velux', payload: '{\"battery\":\"100.00\",\"voltage\":3065,\"contact\":true}'\r\n```\r\nThis is the message sent to set up the sensor:\r\n```\r\nJun 09 09:54:00 zigbeepi npm[2855]: 2018-6-9 09:54:00 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\"}'\r\n```\r\nShould battery information appear on HA within the States page? When the sensors are connect via Xiaomi gateway they appear like this:\r\n<img width=\"502\" alt=\"screen shot 2018-06-09 at 13 26 13\" src=\"https://user-images.githubusercontent.com/3072303/41191525-c6b00dba-6be8-11e8-94aa-d0525f182712.png\">\r\n\r\nOn a separate note, is there a way to implement the \"open since\" attribute?"},"comment":{"url":"https://api.github.com/repos/Koenkk/zigbee2mqtt/issues/comments/399328820","html_url":"https://github.com/Koenkk/zigbee2mqtt/issues/106#issuecomment-399328820","issue_url":"https://api.github.com/repos/Koenkk/zigbee2mqtt/issues/106","id":399328820,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTMyODgyMA==","user":{"login":"ciotlosm","id":7738048,"node_id":"MDQ6VXNlcjc3MzgwNDg=","avatar_url":"https://avatars2.githubusercontent.com/u/7738048?v=4","gravatar_id":"","url":"https://api.github.com/users/ciotlosm","html_url":"https://github.com/ciotlosm","followers_url":"https://api.github.com/users/ciotlosm/followers","following_url":"https://api.github.com/users/ciotlosm/following{/other_user}","gists_url":"https://api.github.com/users/ciotlosm/gists{/gist_id}","starred_url":"https://api.github.com/users/ciotlosm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciotlosm/subscriptions","organizations_url":"https://api.github.com/users/ciotlosm/orgs","repos_url":"https://api.github.com/users/ciotlosm/repos","events_url":"https://api.github.com/users/ciotlosm/events{/privacy}","received_events_url":"https://api.github.com/users/ciotlosm/received_events","type":"User","site_admin":false},"created_at":"2018-06-22T05:57:15Z","updated_at":"2018-06-22T05:57:15Z","author_association":"COLLABORATOR","body":"@jarrah31 there is a bit of controversy around how it should be implemented. However you can already get battery status, by creating a separate sensor based on the correct mqtt topic and use templates to get the battery key if you don't want to wait."}}
{"actor":{"display_login":"ciotlosm"}}