Google Home device is offline for an API-controlled entity

I have a window opener that is controlled by a local API call to make it open and close.

I added this device as a package in HA which allows it to show up as an entity.

  - platform: command_line
          command_open: curl
          command_close: curl
          command_state: curl
          value_template: '{{value_json.position}}'
          friendly_name: Kitchen Window
          unique_id: 06eae6d7-3202-4c54-8a3a-b3f0c5a5be1b

It works perfectly fine as an entity now. However, when using the Nabu Casa integration for Google Home, the device shows up as Offline.

I think it might have something to do with the way the state is set? The window opener reports a position from 0-100 percent using the command_state URL. it returns the following JSON:


This is why I tried to use the value_template parameter but could be using it wrong.

Any idea what I can do to get it to show online?

Did you ever find a solution to this? I have noticed the same behaviour…