Platform command_line getting json into sensors

Hello,
I am trying to use an API to get exactly 4 bookings from today from our hotel software into different entities so I can put them on a dashboard.
I have the following in my sensors.yaml

  • platform: command_line
    command: “curl --location ‘https://app.mytourist.cloud/api/v1/bookings/current-bookings’ --header ‘Authorization: Bearer XXXXXXXXXXXXX’”
    name: TouristBeschikbaarheid
    json_attributes:
    • id
    • arrival
    • departure
    • expected_arrival_time
    • roomtype
    • debtor_id
    • number_of_guests
    • dietary_wishes
    • checkin_at
    • checkout_at
      value_template: “{{ value_json[0] }}”
      scan_interval: 300
      command_timeout: 10

I would need value_json[1] and 2 and 3 as well.

the command gives me a result in json:
{
“id”: 46010000164,
“state”: “confirmed”,
“arrival”: “2024-08-23”,
“departure”: “2024-08-24”,
“expected_arrival_time”: “21:00:00”,
“auto_send_email”: true,
“roomtype”: {
“id”: “4601000164”,
“name”: “Kamer 4”,
“placed_in_room”: “Kamer 4”
},
“debtor_id”: “4600000007134”,

but I can’t seem to find the newly made sensors in my panels nowhere…

That isn’t valid JSON. Are you sure that’s what it’s outputting? Try reformatting your post following the guidelines on how to post code and you might get a more helpful response.