I have created a virtual binary sensor
binary_sensor:
- platform: virtual
name: ‘testexternal’
initial_value: ‘off’
class: None
which I can set to ‘on’ from an own external device
curl -X POST -H “Authorization: Bearer xxxxx” -H “Content-Type: application/json” -d “{"state":"on"}” http://192.168.191.222:8123/api/states/binary_sensor.virtual_testexternal
In dashboard it is shown first as
‘testexternal off’
after I set it to on with the curl above is shown as
‘virtual testexternal on’
(why is now the ‘virtual’ shown) and after 20s it is shown automatically as
‘testexternal off’
why does it reset automatically to off (and without the ‘virtual’) ?
What is going on here, what am I doing wrong ?