Grocy automation is not decreasing the amount of the product

Hi

I’m trying to create an automation to automatically decrease an amount of my dishwasher tablets in grocy when my dishwasher is run. I am following an article for that located at https://philhawthorne.com/automating-your-shopping-list-with-home-assistant-and-grocy/

When trying to execute it, it gives me an error.

The automation is:

- id: '1607866212863'
  alias: Dishwasher consume tablet running
  description: ''
  trigger:
  - platform: state
    entity_id: input_select.dishwasher_status
    to: Running
  condition: []
  action:
  - service: shell_command.grocy_consume_item
    data:
      server_ip: tried 3, see below
      grocy_key: my key
      product_id: my product id
      amount: 1
  - service: homeassistant.turn_off
    data: {}
    entity_id: automation.dishwasher_consume_tablet_running
  mode: single

For the server ip, I tried localhost (127.0.0.1), my local ip (192.168.1.227) and my nabu casa url. None of them worked

The error I get is:

Error running command: `curl -X POST http://{{server_ip}}:9283/api/stock/products/{{product_id}}/consume -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'GROCY-API-KEY: {{grocy_key}}' -H 'cache-control: no-cache' -d '{ "amount": {{amount}}, "transaction_type": "consume", "spoiled": false }'`, return code: 6

Most of the times it’s error code 6, but I had 7 too. I searched online and in the forum, but there is not mutch to find about it.

My HA is a supervised, running on a laptop in proxmox.

@christophe.vandingel Hi There, did you ever get this automation working? I’m also struggling with a similar automation

Hi, no, I gave up on it. If you get it right, maybe you could help me out instead. Hope you can find it.