Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 111029

How to force a template sensor to update even if the value hasn't changed?

$
0
0

I have a bunch of template sensors which listen for MQTT messages:

- platform: mqtt
  state_topic: "bs440/person1/"
  unique_id: bs440_person_1_weight
  name: "Stefan weight"
  unit_of_measurement: "kg"
  value_template: '{{ value_json.weight }}'
- platform: mqtt
  state_topic: "bs440/person1/"
  unique_id: bs440_person_1_body_water
  name: "Stefan body water"
  unit_of_measurement: "%"
  value_template: '{{ value_json.tbw }}'
- platform: mqtt
  state_topic: "bs440/person1/"
  unique_id: bs440_person_1_body_fat
  name: "Stefan body fat"
  unit_of_measurement: "%"
  value_template: '{{ value_json.fat }}'
- platform: mqtt
  state_topic: "bs440/person1/"
  unique_id: bs440_person_1_muscle_mass
  name: "Stefan muscle mass"
  unit_of_measurement: "%"
  value_template: '{{ value_json.muscle }}'
- platform: mqtt
  state_topic: "bs440/person1/"
  unique_id: bs440_person_1_kcal
  name: "Stefan BMR"
  unit_of_measurement: "kcal"
  value_template: '{{ value_json.kcal }}'
- platform: mqtt
  state_topic: "bs440/person1/"
  unique_id: bs440_person_1_bone_mass
  name: "Stefan bone mass"
  unit_of_measurement: "kg"
  value_template: '{{ value_json.bone }}'  

My problem is that the sensors only update if they receive a new value which screws my automation which switches the apartment into day mode as soon as my bathroom scale sends its results. Also, if the scale sends the same value, the value is not written to InfluxDB.

Is there a way inside of HA to force the sensor to update even if the received value is the same?

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 111029

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>