-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(hass): use binary sensors when notifications has only two states #396
Conversation
Pull Request Test Coverage Report for Build 527949988
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @billiaz ! :)
Ok, I've tested this. I see the new binary sensors under the zwavejs2mqtt front-end for the node (130 in this case, an Aeotec Water Sensor 6), but they never appears in HA. I even tried rediscovering the node and multiple restarts of HA. You'll see more than one startup in the js log because I realized I had mqtt logging turned off. You'll also see that I had to wake the water sensor a few times but ultimately it went to interview complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've tested this. I see the new binary sensors under the zwavejs2mqtt front-end for the node (130 in this case, an Aeotec Water Sensor 6), but they never appears in HA. I even tried rediscovering the node and multiple restarts of HA. You'll see more than one startup in the js log because I realized I had mqtt logging turned off. You'll also see that I had to wake the water sensor a few times but ultimately it went to interview complete.
I do see the binary sensors are generated for HASS.
I suspect something breaks in hass. to get an entity error frm HASS is good to have DEBUG on (been there!)
"binary_sensor_cover_status": {
"type": "binary_sensor",
"object_id": "cover_status",
"discovery_payload": {
"payload_on": 3,
"payload_off": 0,
"value_template": "{{ value_json.value }}",
"device_class": "opening",
"state_topic": "homeassistant/130/113/0/Home_Security/Cover_status",
"json_attributes_topic": "homeassistant/130/113/0/Home_Security/Cover_status",
"device": {
"identifiers": [
"zwavejs2mqtt_0xeb87ad4a_node130"
],
"manufacturer": "AEON Labs",
"model": "Water Sensor 6 (ZW122)",
"name": "nodeID_130",
"sw_version": "1.6"
},
"name": "nodeID_130_cover_status",
"unique_id": "zwavejs2mqtt_0xeb87ad4a_130-113-0-Home_Security-Cover_status"
},
"discoveryTopic": "binary_sensor/nodeID_130/cover_status/config",
"values": [
"113-0-Home Security-Cover status"
],
"persistent": false,
"ignoreDiscovery": false
},
another:
"binary_sensor_water_alarm_1": {
"type": "binary_sensor",
"object_id": "water_alarm_1",
"discovery_payload": {
"payload_on": 2,
"payload_off": 0,
"value_template": "{{ value_json.value }}",
"device_class": "None",
"state_topic": "homeassistant/130/113/1/Water_Alarm/Sensor_status",
"json_attributes_topic": "homeassistant/130/113/1/Water_Alarm/Sensor_status",
"device": {
"identifiers": [
"zwavejs2mqtt_0xeb87ad4a_node130"
],
"manufacturer": "AEON Labs",
"model": "Water Sensor 6 (ZW122)",
"name": "nodeID_130",
"sw_version": "1.6"
},
"name": "nodeID_130_water_alarm_1",
"unique_id": "zwavejs2mqtt_0xeb87ad4a_130-113-1-Water_Alarm-Sensor_status"
},
"discoveryTopic": "binary_sensor/nodeID_130/water_alarm_1/config",
"values": [
"113-1-Water Alarm-Sensor status"
],
"persistent": false,
"ignoreDiscovery": false
},
"binary_sensor_water_alarm_2": {
"type": "binary_sensor",
"object_id": "water_alarm_2",
"discovery_payload": {
"payload_on": 2,
"payload_off": 0,
"value_template": "{{ value_json.value }}",
"device_class": "None",
"state_topic": "homeassistant/130/113/2/Water_Alarm/Sensor_status",
"json_attributes_topic": "homeassistant/130/113/2/Water_Alarm/Sensor_status",
"device": {
"identifiers": [
"zwavejs2mqtt_0xeb87ad4a_node130"
],
"manufacturer": "AEON Labs",
"model": "Water Sensor 6 (ZW122)",
"name": "nodeID_130",
"sw_version": "1.6"
},
"name": "nodeID_130_water_alarm_2",
"unique_id": "zwavejs2mqtt_0xeb87ad4a_130-113-2-Water_Alarm-Sensor_status"
},
"discoveryTopic": "binary_sensor/nodeID_130/water_alarm_2/config",
"values": [
"113-2-Water Alarm-Sensor status"
],
"persistent": false,
"ignoreDiscovery": false
}
},
i notice they have class as None! I will tryt o fit a class to make them look nicer.
from this link https://www.home-assistant.io/integrations/binary_sensor/#device-class
I suggest to use "moisture" or "problem" class.
I tend to believe moisture might fit better.
Co-authored-by: Daniel Lando <[email protected]>
…js2mqtt into feat-NotificationSensors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @billiaz Feedback? Is this working?
I got some nice additions from @blhoward2 as two sensors are discovered but as Generic! and might worth include them! @blhoward2 has a separate issue, which is causing his HASS not to discover |
I'll try again tonight, my time. MQTT discovery has been working fine in other contexts so I'm not sure what the issue would be. |
@billiaz This looks good to me, so if @blhoward2 feedback is ok I will merge this or let you do that :) |
I am adding a definition for notification device_classes to cover waterleak |
…js2mqtt into feat-NotificationSensors
@robertsLando it is ready! |
Try to make Notifications better, byt creating HASS binary sensors.
Fixes #374
Fixes #345
Fixes #118
Fixes #107
@blhoward2 Please review this change and Feedback is appreciated
If a device is not properly discovered please paste a Json payload on mqtt