Hi,
I have a RESTful sensor to read data from luno.com to get the latest Bitcoin value. The problem is, every now and then there’s a glitch and it fails to read the value. The default behavior is that it falls to 0 whereas I’d like to keep the previous value.
This is my sensor code:
- platform: rest
name: Luno Bitcoin in Rand
resource: https://api.mybitx.com/api/1/ticker?pair=XBTZAR
json_attributes:
- last_trade
- timestamp
- bid
- ask
value_template: '{{ value_json.last_trade }}'
unit_of_measurement: "ZAR"
Is there any way I can keep the value at the previous rather than fall to zero if it fails?