Behavior of virtual binary sensor

I have created a virtual 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"}”

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 ?

Where did you find


Sorry for the late answer, this is from HACS: Virtual Components