Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 108236

Make Plex API call on media change and parse XML/JSON

$
0
0

Hi! I’ve been working hard trying to figure out how to change a projector’s lens memory with Home Assistant.

I have multiple steps completed, but the last one is problematic.

Here are the steps I’m trying to achieve:

  1. :white_check_mark: Generate an aspectRatios.json file based on the crop data parsed from images in each media file.
  2. :white_check_mark: Write an automation triggered by Plex’s media state changing.
  3. :no_entry: Make an API call to Plex to get the file system location using the content ID in state attributes. :white_check_mark: I can make the call, but I don’t know how to do it in Home Assistant nor how to get the Plex token from the integration.
  4. :white_check_mark: Change projector lens memory setting with virtual remote based on the selected aspect ratio.

As you can see, the one thing I need help with is the hardest.

I need to:

  1. Figure out how to make an API call to my Plex server in an automation. This returns XML.
  2. Read a JSON file shared over the network or stored locally and pass the file location as the first object key, then get the aspect ratio property off it.

If I can do those two things, I’ll have this entire system finally figured out!

Could someone help me figure out how to handle XML, JSON, and API calls?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 108236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>