Home-Assistant Custom Component

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

  1. Kcoenen

    Kcoenen New Member

    I am using a Z9X that is connected through Ethernet.
     
  2. wizmo

    wizmo Member

    I was seeing the same issue, with the play/pause.
    If I really hammer my z9X multiple times a second while playing a 4K movie, I can replicate the playing/idle/off issues with the latest code. With 1 second calls it does not seem to be an issue, although I am connected over WiFi and run HA on a RPi3.
    I do see where the potential problem is, but any resolution is a little more involved. I have opened an issue in Github and will investigate further.

    In the meantime, I would suggest you do a full reboot (power on/off) on the player and home-assistant. Make sure your automation is in "Single" mode. If you override the update at all times (without a condition), try disabling the automatic polling using the System Options in the Zidoo Integration settings card.
     
    Last edited: Aug 27, 2022
  3. Kcoenen

    Kcoenen New Member

    Thanks for all your effort :) I was not aware of the Automatic Polling option of the integration itself, so when I disabled this and only let the automation run every second it seems stable from my first testing and there is no jumping between states. I added a condition for the automation, so it's not constantly hammering the Zidoo.
     
  4. lawdawg

    lawdawg Active Member

    @Kcoenen I recently moved from an anamorphic lens to a zoom setup on my projector. With this I have to apply both a zoom and a mask via another HA integration, vs a simple command to switch anamorphic modes on the projector. That all works out very well, but I am running into the same issue you described in this thread - HA reports the Zidoo is flipping back and forth to play/idle state. When it was just the lights in the room coming on occasionally I could deal with that, but now the projector is zooming in and out, which is a WTF moment when watching a movie ;)

    I am trying to replicate what you have done with your automation, to avoid the state polling issue, but its not clicking for me. Any chance you could share your YAML, and/or a few screenshots from the GUI to help me get over the hump?
     
  5. lawdawg

    lawdawg Active Member

    @wizmo While I'm digging into the state concern, I am also thinking about a way to not rely on IR commands or bluetooth keyboard commands to control the Zidoo from a remote. Is there a way to execute the commands tied to the physical remote buttons, using your integration? Like say the red button, play button, fast forward, etc? And if so can you help me find a list of the "remote" commands?

    Thanks!
     
  6. Kcoenen

    Kcoenen New Member

    Under "Devices and Services", I opened the "System Options" of the Zidoo Integration (using the three dots) and then disabled the option "Enable polling for updates". I then created an automation that whenever my Harmony is turned on with the Zidoo, the status of the player needs to be updated every second. The status of the lights is controlled using an automation in NodeRed, but it's basically nothing more than if the Zidoo Status is playing turn off the lights, and when idle or paused turn the lights back on (with an extra check after 5 seconds). 9 out of 10 times this mechanism works perfect, and only a few times I get a "wrong" status when pressing the play button after resuming, but this could also be caused by the second check I do after 5 seconds.

    Zidoo NodeRed Automation.png

    Zidoo Automation.png

    Zidoo System Options.png
     
  7. wizmo

    wizmo Member

    Let me look back into this in the next day or so. I did reproduce the issue on my Z9X where the API reported the wrong state (I assume it's an overrun problem). I added a kludge at the time, but was not particularity happy with it.
     
  8. wizmo

    wizmo Member

    On the remote button calls, the api wrapper does support all the remote button calls listed here. I look at adding a service call to the integration on the next release. This would allow calls from automations.
     
    Sledgehamma and lawdawg like this.
  9. wizmo

    wizmo Member

    beta-110922 is available through HACS beta for testing.

    The api wrapper has been reworked to try and address the rapid update issues reported. It also has a new service to support raw button keys.

    Please give it a try and let me know if you see any issues.
     
  10. lawdawg

    lawdawg Active Member

    Thanks, installing now.

    first I’ll tenable my automations that were dependent on the zidoo state being idle (lights and projector or zoom/mask.)

    Is it okay to leave the “enable polling for updates” option on now?
     
  11. lawdawg

    lawdawg Active Member

    First tests are going well. I’ll keep an eye on it to see how consistent it is and if I see in issues with reporting the wrong state, or flipping back and forth.
     
    wizmo likes this.
  12. lawdawg

    lawdawg Active Member

    Last report before I head to bed. Keypresses seem to be working well. I am looking forward to using discrete Play and Pause commands.

    Thanks for your great work!
     
    wizmo likes this.
  13. wizmo

    wizmo Member

    Hopefully, it does not matter
     
  14. wizmo

    wizmo Member

    I released v1.3.1 (available on HACS) with the beta changes and an update for a depreciated call.
     
    Kcoenen and Sledgehamma like this.
  15. Sledgehamma

    Sledgehamma Well-Known Member

    Hoping to get a YIO remote soon and integrate it there :)
     
  16. carlos ventura

    carlos ventura New Member

    Hi Wizmo,
    Major upgrade has happened to my cinema room. I Bought a screen with motorized masks. It would be awesome if the 3000 could somehow make available the video output format (16:9, 2.35:1 or 1.90:1). Something like what Kaledascape players do through they're RS232 ports, so I can use HA to automatic adjust the screen's mask. Do you think its possible ? How ? :)
    Thankx
    Carlos
     
  17. wizmo

    wizmo Member

    The API provides
    - output resolution
    - raw video resolution
    - zoom mode
    Basically, whats is displayed when pressing the info button.
    I could add some or all of these to the media_player attributes, but I'm not sure if any of them will do what you want. My unit is set to upscale so the output resolution is always 4k 16:9, regardless of the video resolution or Zoom mode.

    There are api commands to change the zoom mode. I could look at adding this as a service if it would help.
     
  18. carlos ventura

    carlos ventura New Member

    Thankx Wizmo, mine is not upscaling I would only need the picture format 16:9, 2.35:1 or 1.90:1, 1080p or 4K is irrelevant for the mask position :). a bit off topic; have you tried a 1080p movie without upscaling ? I find the 1080p without upscaling so much better .. and less grainy overall.
     
  19. wizmo

    wizmo Member

    @carlos ventura try the 'main' branch (beta). I added a couple of extra attributes to the media_player, including the video resolution (media_width and media_height). On the assumption that you are using Zoom Fit or Original modes, you should be able to use these to create a script or automation to calculate which aspect ratio you want to use on your screen.

    For example,
    Code:
    template:
      - sensor:
          - unique_id: zidoo_aspect_ratio
            name: Zidoo Aspect Ratio
            state: >
              {% set width = state_attr('media_player.zidoo', 'media_width')|float(0) %}
              {% set height = state_attr('media_player.zidoo', 'media_height')|float(1) %}
              {% set ratio = (width / height)|round(2) %}
              {% if ratio >= 2.35 %}
                2.35:1
              {% elif ratio >= 1.9 %}
                1.90:1
              {% elif ratio >= 1.77 %}
                16:9
              {% else -%}
                4:3
              {% endif %}
    Update: I just added media_zoom so you can add a condition in your automation
     
    Last edited: Feb 8, 2023
  20. carlos ventura

    carlos ventura New Member

    Thankx Wizmo,
    Ill give it a try and get back to you .. :)
    Best
    Carlos
     

Share This Page