Home-Assistant Custom Component

Discussion in 'General Development' started by wizmo, Oct 13, 2021.

  1. wizmo

    wizmo Member

    Wanted to share a HA custom component for Zidoo Players using the standard api.
    Still work in progress and only tested on my Z9S, but its at a position where it may be useful to others.

    CGI, pcristi, Rob W and 1 other person like this.
  2. Sledgehamma

    Sledgehamma Well-Known Member

    Awesome work!
  3. Sledgehamma

    Sledgehamma Well-Known Member

    I finally had some time to test:

    • WOL works on Z9X :)
    • I can browse my library (called movies) but TV shows and movies are mixed and I cant filter
    • [​IMG]
    • Sadly I dont see a picture of what I'm playing. Am I in the wrong section?
    • [​IMG]
    • Your app couldn't be found in the HACS store (or I couldn't find it) so I had to install it manually. Stupid me downloaded the zip from GitHub and put the whole "Zidoo-player" folder into the "custom_components folder" and not just the "Zidoo" folder like you wrote. I just thought you changed the folder name but not your instruction. Maybe you can make it clearer so that others dont do the same thing.
    • Is it possible to add playback times to the progress bar like this or is it a HA limitation?
    • Also I'd prefer something like: See S02E03 The Compass
    • [​IMG]

    Otherwise: Its a great start and I can imagine working amazingly with the YIO Remote once its released.
    Last edited: Oct 31, 2021
  4. wizmo

    wizmo Member

    Will look at an enhancement for the Movies and TV shows. Easiest would be to split the initial view.

    Image on the player is the "backdrop" image from the Poster db. Can you confirm you have one assigned. If you have already, I may need to add some debug as I dont have access to a Z9X

    The HA does have duration and progress attributes, but the standard player card only exposes the slider. There may be a custom card out there somewhere.

    HACS needs reviews in the HACS/default branch before it gets added. Not sure if anyone can review but may be work checking out if you have time. In the mean time, I have added a couple of extra notes.

    Thanks for the feedback. Nice to hear that it works on other players.
    Sledgehamma likes this.
  5. Sledgehamma

    Sledgehamma Well-Known Member

    Yes, the backdrops existed for the videos I played. Alright, didn't know that its the standard player card, would be awesome if they added it as I think its useful information.
    With review you mean your code?

    Thanks for adding the extra notes :)

    Been playing around with HA and it really is a powerful software!
  6. wizmo

    wizmo Member

    Try the latest release to see if it fixes the backdrop images.
    If not can you add this to your HA configuration.yaml file to enable additional logging

    default: info
    custom_components.zidoo: debug​

    I've separated Movies and TV Shows in the initial library.
    The text in the player with a video is from the poster db title entry.
    Last edited: Nov 4, 2021
    Sledgehamma likes this.
  7. Sledgehamma

    Sledgehamma Well-Known Member

    I tried the new version and the pictures didn't load. Then I enabled logging and they just worked :D

    Looks beautiful, great work!
    Text in the player seems to be the file name now.

    Thanks for separating movies and TV shows:

    I found a bug:
    When I have a collection of movies (American Pie in my case) it won't open the collection. Nothing happens when I click on the cover of that collection.
  8. wizmo

    wizmo Member

    I fixed the collection issue.

    You are right on the file name. I'm going to have a go at that, along with a solution to sort tv episodes (which the standard api calls sort alphabetically and not by episode number). It's a little more involved so bare with me!
    Sledgehamma likes this.
  9. Sledgehamma

    Sledgehamma Well-Known Member

    Damn you are fast :)
    wizmo likes this.
  10. Awesome! Thanks!
    wizmo likes this.
  11. Sledgehamma

    Sledgehamma Well-Known Member

  12. lawdawg

    lawdawg Active Member

    Wanted to give Wizmo some props. This integration is great, and he just updated it recently. I use it automate the lights, zooming, and screen blanking in my theater. Works great!
    wizmo likes this.
  13. ZidooNewbie22

    ZidooNewbie22 New Member

    Hi Wizmo,

    just wanna let you know, I installed your HA component because it sounds like an option for an issue I have. et voila. :) it did it.

    Umse Case:
    - My AVR is not 4K capable. --> My Zidoo is connected via HDMI directly to TV.
    - My TV does not allow passthrough of DTS from Zidoo via HDMI + TV to AVR --> My Zidoo is connected via OPTICAL directly to AVR.
    - Whenever I use apps in my TV (netflix, youtube,...) I need eARC and AVR is set to TV/SAT
    - When I switch TV to Zidoo, Zidoo ist started and I can browse a movie, and start it, but manually I have to switch the AVR to the other source using OPTICAL.

    Now this is automated :)
    On Zidoo shutdown the source is changed back to TV/SAT :) awesome, thanks.
    wizmo likes this.
  14. Rob W

    Rob W Active Member

    Hi Wizmo,

    It's really good thank you! I wasn't expecting it to be so usable and well featured. I did the manual installation for HA running in docker and it works nicely. Using Z9X WOL is working like reported earlier.
    Movies folder works and loads up the posters and backdrop images work also. All the controls seem to work fine except SMB (in Library) shows No items. I have SMB configured in poster wall and media center so not sure why but perhaps that's a known issue. Is there a possiblility to have any type of search function for quick finding a movie in the Library?
  15. wizmo

    wizmo Member

    @Rob W Thanks for the feedback

    The SMB works on my Z9S with the shares I have setup. They are listed as folders in the format <ip_address>#<share_name>. Could potentially be a formatting thing depending on how yours are named. Do you see any errors in the HA logs?
    If you can, try typing this in a browser '<ip_address>:9529/ZidooFileControl/getFileList?path=/tmp/ramfs/mnt/&type=0' (with your zidoo ip address) and pm me the results. If not, I can add some extra debug messages.

    Unfortunately, the HA browse-media interface is pretty limited. Haven't found a way to add a search filter, but still working on it
    Last edited: Jan 23, 2022
    Sledgehamma likes this.
  16. Rob W

    Rob W Active Member

    When my Server is off the SMB library entry is missing and when I turn it on the SMB folder appears so it looks like it is reading the change in state but no items are listed.
    It's a windows share with the format ip/name like shown in the image below from Zidoo Controller app. Nothing in logs releated to Zidoo other than the warning that it's a custom intergration.

    Edit- Perhaps it's sensitive to spaces and or capitals that i use in my folder names.
    Edit 2- No I just made a share called smb://192.xxx.x.xxx/test/ and it still doesn't show.

    Last edited: Jan 23, 2022
  17. wizmo

    wizmo Member

    @Rob W , I've made a change to the 'main' branch. It builds the SMB list using the documented calls in the v1 api. (The origional code may only work on older hardware - I noticed my smb lists shares that are not accessible via the latest firmware)
    I've included a log of the gethost request in the HA logs. If you still don't have access can you post the log entry.

    Interestingly, on the Z9s, the mobile 'file' web-access (<ip>:9528 ) shows different results to the android app. The web browser link uses the v1 api calls (per above) while the app uses a combination of undocumented v2 calls and app based smb searches. The web-access is a two-step process listing servers and then shares (only saved shares), while the app shows the saved smb shares in the main device list and you can browse all available shares in the SMB menu. I would be interested to know if the Z9X is the same.
    Rob W likes this.
  18. Rob W

    Rob W Active Member

    @wizmo You did it! Thanks.

    Edit - Is it possible to omit /data/system/smb?
  19. wizmo

    wizmo Member

    "Is it possible to omit /data/system/smb?"
    Can you send me the HA log entry so I can check the format - defo different from my system
  20. Rob W

    Rob W Active Member

    2022-01-29 19:18:30 INFO (SyncWorker_0) [custom_components.zidoo.zidoorc] zidoo host list: {'status': 200, 'hosts': [{'name': '/data/system/smb/', 'type': 1007, 'ip': '%2Fdata%2Fsystem%2Fsmb%2F192.168.1.244'}]}

Share This Page