Skip to content

Unable to find value for JSON path #8

Description

@roberthawdon

Hi, I'm currently attempting to use this plugin to control my home automation system (Home Assistant)

When using the API to toggle an appliance, the following JSON response comes back from the API:

[
  {
    "entity_id": "switch.desk_lamp_outlet_1",
    "state": "on",
    "attributes": {
      "outlet_in_use": true,
      "icon": "mdi:desk-lamp",
      "friendly_name": "Desk Lamp"
    },
    "last_changed": "2022-12-10T20:15:07.713523+00:00",
    "last_updated": "2022-12-10T20:15:07.713523+00:00",
    "context": {
      "id": "REDACTED",
      "parent_id": null,
      "user_id": "REDACTED"
    }
  }
]

Logic would tell me that the JSON Path for the state value should be $.[0].state or $[0]['state']; however, neither of these are working, and neither is setting the path to state or leaving the path empty and making the plugin look for the expected value of on.

I'm sure there's something simple I'm missing here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions