Skip to content

Commit

Permalink
Merge pull request #49 from ovettel/main
Browse files Browse the repository at this point in the history
Aligned sensostar mqtt discovery to updated underlying sensostar driver
  • Loading branch information
weetmuts authored Nov 27, 2024
2 parents fe381b6 + a53e06e commit f1cbf75
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 58 deletions.
38 changes: 9 additions & 29 deletions wmbusmeters-ha-addon-edge/mqtt_discovery/sensostar.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"name": "Status OK",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'OK' in value_json.current_status }}",
"value_template": "{{ 'OK' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -188,7 +188,7 @@
"name": "Status error (Temperature Sensor 1 Cable Break)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_1_CABLE_BREAK' in value_json.current_status }}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_1_CABLE_BREAK' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -209,7 +209,7 @@
"name": "Status error (Temperature Sensor 1 Short Circuit)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_1_SHORT_CIRCUIT' in value_json.current_status }}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_1_SHORT_CIRCUIT' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -230,7 +230,7 @@
"name": "Status error (Temperature Sensor 2 Cable Break)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_2_CABLE_BREAK' in value_json.current_status }}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_2_CABLE_BREAK' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -251,7 +251,7 @@
"name": "Status error (Temperature Sensor 2 Short Circuit)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_2_SHORT_CIRCUIT' in value_json.current_status }}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_2_SHORT_CIRCUIT' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -272,7 +272,7 @@
"name": "Status error (Flow Management System)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR' in value_json.current_status }}",
"value_template": "{{ 'ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -293,7 +293,7 @@
"name": "Status error (Electronics Defective)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_ELECTRONICS_DEFECT' in value_json.current_status }}",
"value_template": "{{ 'ERROR_ELECTRONICS_DEFECT' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -313,7 +313,7 @@
"name": "Status OK (instrument reset)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'OK_INSTRUMENT_RESET' in value_json.current_status }}",
"value_template": "{{ 'OK_INSTRUMENT_RESET' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -334,32 +334,12 @@
"name": "Status OK (battery low)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'OK_BATTERY_LOW' in value_json.current_status }}",
"value_template": "{{ 'OK_BATTERY_LOW' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},

"meter_timestamp": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"hw_version": "{id}"
},
"enabled_by_default": true,
"name": "Meter timestamp",
"entity_category": "diagnostic",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:clock"
}
},

"timestamp": {
"component": "sensor",
"discovery_payload": {
Expand Down
38 changes: 9 additions & 29 deletions wmbusmeters-ha-addon/mqtt_discovery/sensostar.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"name": "Status OK",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'OK' in value_json.current_status }}",
"value_template": "{{ 'OK' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -188,7 +188,7 @@
"name": "Status error (Temperature Sensor 1 Cable Break)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_1_CABLE_BREAK' in value_json.current_status }}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_1_CABLE_BREAK' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -209,7 +209,7 @@
"name": "Status error (Temperature Sensor 1 Short Circuit)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_1_SHORT_CIRCUIT' in value_json.current_status }}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_1_SHORT_CIRCUIT' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -230,7 +230,7 @@
"name": "Status error (Temperature Sensor 2 Cable Break)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_2_CABLE_BREAK' in value_json.current_status }}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_2_CABLE_BREAK' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -251,7 +251,7 @@
"name": "Status error (Temperature Sensor 2 Short Circuit)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_2_SHORT_CIRCUIT' in value_json.current_status }}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_2_SHORT_CIRCUIT' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -272,7 +272,7 @@
"name": "Status error (Flow Management System)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR' in value_json.current_status }}",
"value_template": "{{ 'ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -293,7 +293,7 @@
"name": "Status error (Electronics Defective)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_ELECTRONICS_DEFECT' in value_json.current_status }}",
"value_template": "{{ 'ERROR_ELECTRONICS_DEFECT' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -313,7 +313,7 @@
"name": "Status OK (instrument reset)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'OK_INSTRUMENT_RESET' in value_json.current_status }}",
"value_template": "{{ 'OK_INSTRUMENT_RESET' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
Expand All @@ -334,32 +334,12 @@
"name": "Status OK (battery low)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'OK_BATTERY_LOW' in value_json.current_status }}",
"value_template": "{{ 'OK_BATTERY_LOW' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},

"meter_timestamp": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"name": "Meter timestamp",
"entity_category": "diagnostic",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:clock"
}
},

"timestamp": {
"component": "sensor",
"discovery_payload": {
Expand Down

0 comments on commit f1cbf75

Please sign in to comment.