custom-components / grocy

Custom Grocy integration for Home Assistant
Apache License 2.0
162 stars 50 forks source link

For chores it's adding ' marks to the ints for chorid and userid in automations. #167

Closed ThellraAK closed 2 years ago

ThellraAK commented 2 years ago

Unless all relevant information is provided, I can't help you

Describe the bug When adding an action with a NFC Tag, it doesn't work.

2022-01-22 03:59:22 ERROR (MainThread) [homeassistant.components.automation.tag_ryc_es_tag_is_scanned] Error while executing automation automation.tag_TAGNAME_scanned: expected int for dictionary value @ data['done_by']

image

Is what it shows up as in the UI,

image

Is the edit in yaml, removing the quotation marks, and hitting save, and going back to the GUI automation does nothing, it reverts back.

Leaving the edit window open, hitting save, and then scanning the tag, works.

Editing it in the mobile app, you can remove the ' marks, save and go back, and it works, but if it's opened again, it seems to revert.

Editing it in the file editor, and then reloading the configuration, (and then not opening it to edit anywhere else) seems to let it work fine.

Expected behavior

For the editor not to put ' marks around the ints it wants.

To Reproduce Steps to reproduce the behavior:

  1. Go to Automations
  2. Click on Create new
  3. Add a chore automation, with a choreid and userid
  4. Hit save, run it, go to error log, and see it wants an int, but got a string, check grocy chore journal to see it didn't make it over there.

General information to help debugging:

Not really sure, I think I covered all of my bases above.

What is your installed versions of Home Assistant, Grocy and this integration?

core-2021.12.10 Community store: Installed Version | 1.19.3 Supervisor Version | supervisor-2021.12.2 Grocy 3.13 (Docker for linuxserver.io

Grocy Integration v4.0.1

How do you have Grocy installed? Add-on or external? External

Debug logs

2022-01-22 04:28:35 INFO (MainThread) [homeassistant.components.automation.tag_TestTag_is_scanned] TestTag is Scanned: Running automation actions 2022-01-22 04:28:35 INFO (MainThread) [homeassistant.components.automation.tag_TestTag_is_scanned] TestTag is Scanned: Executing step call service 2022-01-22 04:28:35 ERROR (MainThread) [homeassistant.components.automation.tag_TestTag_is_scanned] TestTag is Scanned: Error executing script. Invalid data for call_service at pos 1: expected int for dictionary value @ data['chore_id'] 2022-01-22 04:28:35 ERROR (MainThread) [homeassistant.components.automation.tag_TestTag_is_scanned] Error while executing automation automation.tag_TestTag_is_scanned: expected int for dictionary value @ data['chore_id']

JSON service data (if related to using a service)

{
I don't know how
}

Additional context Add any other context about the problem here. Tried with two different tags, tried deleting and rewriting them, issue persists.

isabellaalstrom commented 2 years ago

@ThellraAK Please download latest beta version to see if this is fixed.

ThellraAK commented 2 years ago

`Logger: homeassistant.components.automation.tag_testtag_scanned Source: helpers/script.py:1382 Integration: Automation (documentation, issues) First occurred: 10:51:30 PM (1 occurrences) Last logged: 10:51:30 PM

TestTag is Scanned: Error executing script. Invalid data for call_service at pos 1: expected int for dictionary value @ data['chore_id']`

I updated the addon to v4.1.0 and restarted home assistant.

ludeeus commented 2 years ago

You need v4.1.4b

ThellraAK commented 2 years ago

You need v4.1.4b

That did it, didn't see the box for beta versions, it works fine now, thank you.