- platform: mqtt
state_topic: 'tele/sonoff20/SENSOR'
name: 'TEST TEMPERATURE'
unit_of_measurement: '°C'
value_template: '{{ value_json["DS18B20"]["Temperature"] }}'
payload_available: "online"
payload_not_available: "offline"
scan_interval: 20
force_update: true
Sorry I am brand new to this HA, just about getting the hang of it so please be patient.
Welcome to the community! Would be a good idea to read what I linked in my post above. Also, you don’t need to put the entire post between backticks, just the code portion.
Anyway, it looks like you might want to add expire_after: to that sensor with whatever number of seconds you deem appropriate. See here for more info.
Hi,
Tried expire_after with limited success,
Set the modemcu as follows
ESP8266 DEV MODULE 1
Logging parameters
Telemetry period (300)
10
I also set expire_after: 10 in YAML config
This config works most of the time however occasionally it will lose the value and briefly report "blip"unknown, in addition if i disconnect the sensor it will report back eventually but it is not consistent, it can take anywhere between 20 and 70 seconds to change state?
If I decrease the expire_after to say 8 sec then it will report for the 8 sec then briefly. lets say 2 sec change state to unknown then back again.
If I increase it >10 I have yet to see any change state, maybe not waited long enough but not the likely scenario I would accept so gave up testing at that point.