Skip to content

Commit

Permalink
[BM2] Fix discovery relying on MODEL_ID (#1560)
Browse files Browse the repository at this point in the history
To don't take into account the iBeacons messages change the condition to is not defined
  • Loading branch information
1technophile authored Mar 21, 2023
1 parent 80e0088 commit e1fef64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main/config_mqttDiscovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void announceDeviceTrigger(bool use_gateway_info,
# define jsonAlarm "{{ value_json.alarm }}"
# define jsonInuse "{{ value_json.power | float > 0 }}"
# define jsonInuseRN8209 "{{ value_json.power | float > 0.02 }}"
# define jsonVoltBM2 "{{% if value_json.model_id == \"BM2\" -%} {{value_json.volt}} {%- endif %}}"
# define jsonVoltBM2 "{% if value_json.uuid is not defined -%} {{value_json.volt}} {%- endif %}"
#else // Home assistant autodiscovery value key definition
# define jsonBatt "{{ value_json.batt | is_defined }}"
# define jsonLux "{{ value_json.lux | is_defined }}"
Expand Down Expand Up @@ -210,7 +210,7 @@ void announceDeviceTrigger(bool use_gateway_info,
# define jsonAlarm "{{ value_json.alarm | is_defined }}"
# define jsonInuse "{{ value_json.power | is_defined | float > 0 }}"
# define jsonInuseRN8209 "{{ value_json.power | is_defined | float > 0.02 }}"
# define jsonVoltBM2 "{{% if value_json.model_id == \"BM2\" and value_json.volt is defined -%} {{value_json.volt}} {%- endif %}}"
# define jsonVoltBM2 "{% if value_json.uuid is not defined and value_json.volt is defined -%} {{value_json.volt}} {%- endif %}"
#endif

#define stateClassNone ""
Expand Down

0 comments on commit e1fef64

Please sign in to comment.