tony-fav / tasmota-blerry

GNU General Public License v3.0
96 stars 29 forks source link

add force_update option for discovery #46

Closed IsaacBreuer closed 1 year ago

IsaacBreuer commented 2 years ago

if possible to add force_update as optional config to be added to the discovery topic.

tony-fav commented 2 years ago

This should already be possibly with discovery_override. Here's an example for state class, you could adapt for force updated. The YAML below needs to be converted to JSON for use in the config.

discovery packet overrides for some sensors of a single device

devices:
  D81E7A38ED1D/1:
    model: WoHand
    alias: dev_WoHand
  A4C138A8E41B:
    model: ATCpvvx
    alias: dev_ATCpvvx
    discovery_override:
      Temperature:
        stat_cla: measurement
      Humidity:
        stat_cla: measurement
      DewPoint:
        stat_cla: measurement

discovery packet overrides for some sensors of all devices

devices:
  D81E7A38ED1D/1:
    model: WoHand
    alias: dev_WoHand
  A4C138A8E41B:
    model: ATCpvvx
    alias: dev_ATCpvvx
override:
  discovery_override:
    Temperature:
      stat_cla: measurement
    Humidity:
      stat_cla: measurement
    DewPoint:
      stat_cla: measurement
IsaacBreuer commented 2 years ago

thanks, going to try that for now I just hard-coded msg['frc_upd'] = true so it just does it across the board for all sensor data.