grocy: Chore sensor does not contain user assignments

Describe the bug The Grocy API supplies next_execution_assigned_to_user_id, but this is not reported by the sensor. Therefore it cannot be used as an info source for Lovelace Cards etc. (Grocy Custom Component v. 0.4.0)

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘HomeAssistant > Development tools > States’
  2. Select sensor.grocy_chores entity
  3. Inspect values for chores, see:
  - _chore_id: 1
    _last_tracked_time: '2020-04-07T00:00:00+00:00'
    _next_estimated_execution_time: '2020-04-12T00:00:00+00:00'
    _name: Planten watergeven
    _last_done_by:
      _id: 3
      _username: Jannica
      _first_name: Janneke
      _last_name: ''
      _display_name: Janneke
  - _chore_id: 2
    _last_tracked_time: '2020-04-08T00:00:00+00:00'
    _next_estimated_execution_time: '2020-04-09T00:00:00+00:00'
    _name: Afwassen
    _last_done_by:
      _id: 1
      _username: admin
      _first_name: null
      _last_name: null
      _display_name: admin
  1. No entry for _next_execution_assigned_to_user_id is found.

Expected behavior next_execution_assigned_to_user_id should also be part of the sensor data.

Are you using HASSIO to run grocy? Yes

configuration.yaml entry

default

Grocy config = default

JSON service data (if related to using a service)

{

}

Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (1 by maintainers)

Most upvoted comments

@isabellaalstrom I try to atleast maintain the repo in the sense of reviewing and merging PRs and stuff. Not sure what amount of development will be done by me.

I’m basing my assumption on the API spec of the grocy demo instance (https://en.demo.grocy.info/api#/Chores/get_chores__choreId_) which doesn’t include next_execution_assigned_to_user_id. It shouldn’t be hard to implement either way, I just have to find some time to do it.

You shouldn’t have to look up the user ID for this as the response includes that information.

The full output of my api call to /api/chores/1 for instance is as below, so you could just reference the “next_execution_assigned_user” right?

    "chore": {
        "id": "1",
        "name": "Wash dishes",
        "description": "",
        "period_type": "daily",
        "period_days": "0",
        "row_created_timestamp": "2020-05-30 07:32:32",
        "period_config": "",
        "track_date_only": "1",
        "rollover": "1",
        "assignment_type": "random",
        "assignment_config": "1",
        "next_execution_assigned_to_user_id": "1",
        "consume_product_on_execution": "0",
        "product_id": "",
        "product_amount": null,
        "period_interval": "1"
    },
    "last_tracked": "2020-05-29 00:00:00",
    "tracked_count": 1,
    "last_done_by": {
        "id": "1",
        "username": "James",
        "first_name": "James",
        "last_name": "",
        "row_created_timestamp": "2020-04-17 13:19:17",
        "display_name": "James"
    },
    "next_estimated_execution_time": "2020-05-30 00:00:00",
    "next_execution_assigned_user": {
        "id": "1",
        "username": "James",
        "first_name": "James",
        "last_name": "",
        "row_created_timestamp": "2020-04-17 13:19:17",
        "display_name": "James"
    }
}

I’m basing my assumption on the API spec of the grocy demo instance (https://en.demo.grocy.info/api#/Chores/get_chores__choreId_) which doesn’t include next_execution_assigned_to_user_id. It shouldn’t be hard to implement either way, I just have to find some time to do it.