Giter Club home page Giter Club logo

Comments (16)

rcdailey avatar rcdailey commented on June 28, 2024 1

I'm just cycling left/right through Content Type in the JVC on-screen menu as I test my automation. Next time this happens I'll screenshot the attributes. As of right now it seems to be working fine. Sorry for the false alarm!

from jvc_homeassistant.

iloveicedgreentea avatar iloveicedgreentea commented on June 28, 2024

self.jvc_client.get_theater_optimizer_state()

Have you ever configured theater optimizer? Is it set to off? Problem with JVC commands is when they fail, they just timeout because there is no error returned. I suspect its something due to that. Also a lot of the functionality is undocumented i.e in this case if you never configured it, maybe it will just fail instead of sending a null value or something. I will add some sanity checking for that command. In the meantime can you try to configure theater optimizer and see if that fixes the issue?

from jvc_homeassistant.

iloveicedgreentea avatar iloveicedgreentea commented on June 28, 2024

Actually before you do that in HACS can you go to redownload and pull from master? I put a catch for the timeout exception which should catch this in the future. And once you see TO set to 'not set', you can try to configure TO and check again.

from jvc_homeassistant.

rcdailey avatar rcdailey commented on June 28, 2024

Yes I've used the theater optimizer in the past. I was testing in SDR which has it disabled / inaccessible. According to the user manual, it's only available in HDR content modes, specifically with Frame Adapt HDR enabled.

I'm working on an automation to automatically change picture modes based on roku activity + content type, and there will be situations where Theater Optimizer likely isn't available and I'll need to test it.

Yes I will redownload and try again and report back. Thanks for the quick reply.

from jvc_homeassistant.

rcdailey avatar rcdailey commented on June 28, 2024

Strange, it's working fine now and I'm not able to reproduce. I'm also seeing entity events and events for my automation in logbook now whereas it wasn't before. Maybe I had something weird going on. Should I stick to master or hop back to the latest tag?

from jvc_homeassistant.

iloveicedgreentea avatar iloveicedgreentea commented on June 28, 2024

That TO check should only trigger if the content type contains HDR or HLG. Did you manually change the content type attribute or something? What do your attributes say? If it happens again, take a screenshot of all the attributes.

Also for your automation, I have something similar based on my madvr envy, might save you some time

alias: JVC - Envy picture mode HDR
description: ""
trigger:
  - platform: state
    entity_id:
      - remote.envy
    attribute: hdr_flag
  - platform: time_pattern
    seconds: "20"
    enabled: true
condition: []
action:
  - if:
      - condition: and
        conditions:
          - condition: state
            entity_id: remote.nz7
            attribute: picture_mode
            state: user1
          - condition: state
            entity_id: remote.envy
            attribute: hdr_flag
            state: true
    then:
      - service: remote.send_command
        data:
          command: picture_mode,user2
          num_repeats: 1
          delay_secs: 0.4
          hold_secs: 0
        target:
          entity_id: remote.nz7
  - if:
      - condition: and
        conditions:
          - condition: state
            entity_id: remote.nz7
            attribute: picture_mode
            state: user2
          - condition: state
            entity_id: remote.envy
            attribute: hdr_flag
            state: false
    then:
      - service: remote.send_command
        data:
          command: picture_mode,user1
          num_repeats: 1
          delay_secs: 0.4
          hold_secs: 0
        target:
          entity_id: remote.nz7
mode: single

from jvc_homeassistant.

rcdailey avatar rcdailey commented on June 28, 2024

What is hold_secs and delay_secs? I wasn't able to find documentation on these properties.

from jvc_homeassistant.

rcdailey avatar rcdailey commented on June 28, 2024

@iloveicedgreentea I've got an automation that works, but I'm having timing issues when I switch between activities and content types. I test these scenarios in different ways:

  • Go from Gaming activity -> non gaming activity (and vice versa)
  • From a gaming activity, turn my playstation on/off (this triggers going between SDR and HDR10 content types)

Some transitions are quick. Others take a long time, mostly due to a combination of the Harmony Hub taking a while and the JVC projector going "blank" for about 2-4 seconds between content type and picture mode changes.

I'll provide my automation & script below. There's several places I can put delays. I'm not sure the best place to do that. I think if I had a better understanding of what hold_secs and delay_secs do, that might help.

The Automation:

- alias: "JVC: Set Picture Mode"
  id: 85a1b949-f61b-425e-95e3-60bdfc9d1c1d
  trigger:
  - platform: state
    entity_id: remote.nz7
    attribute: content_type
  - platform: template
    # Watch for `starting_activity` to be set to `null`. Based on my observations, this only happens
    # when an activity is *done starting*, which is what we want (we do not want to do anything to
    # the projector until the activity has finished starting)
    value_template: "{{ state_attr('remote.harmony_media_room', 'activity_starting') == none }}"
    # for: "00:00:08"
  condition:
  action:
  - choose:

    # GAMING ACTIVITIES
    - conditions: >
        {{ state_attr('remote.harmony_media_room', 'current_activity') in
           ['Play PS4', 'Nintendo Switch'] }}
      sequence:
      - service: script.set_expected_picture_modes
        data:
          hdr_mode: user4 # "Games" picture mode
          sdr_mode: user1 # "Gaming" picture mode

    # SHIELD ACTIVITY
    - conditions: >
        {{ state_attr('remote.harmony_media_room', 'current_activity') == 'Shield' }}
      sequence:
      - service: script.set_expected_picture_modes
        data:
          hdr_mode: frame_adapt_hdr
          sdr_mode: natural

The Script:

set_expected_picture_modes:
  variables:
    hdr_mode:
    sdr_mode:
  sequence:
  - choose:
    - conditions: >
        {{ state_attr('remote.nz7', 'content_type') == 'hdr10' and
           state_attr('remote.nz7', 'picture_mode') != hdr_mode }}
      sequence:
      - service: remote.send_command
        data:
          command: "picture_mode,{{ hdr_mode }}"
          num_repeats: 1
          delay_secs: 1
          hold_secs: 0
        target:
          entity_id: remote.nz7
    - conditions: >
        {{ state_attr('remote.nz7', 'content_type') == 'sdr' and
           state_attr('remote.nz7', 'picture_mode') != sdr_mode }}
      sequence:
      - service: remote.send_command
        data:
          command: "picture_mode,{{ sdr_mode }}"
          num_repeats: 1
          delay_secs: 1
          hold_secs: 0
        target:
          entity_id: remote.nz7

from jvc_homeassistant.

rcdailey avatar rcdailey commented on June 28, 2024

Ok I'm going to give up for the night. I'm noticing a lot more errors during transitions. I think those are due to some timing issues. The real issue is that because of these errors (I think), the jvc_projectors integration stops updating the entity state/attributes (Observed in the developer tools state tab). Attached logs. Also will show you a screenshot too.

image

Logs:
home-assistant_2023-02-05T02-56-39.323Z.log

Sorry to throw so much at you. Thanks for your support.

from jvc_homeassistant.

iloveicedgreentea avatar iloveicedgreentea commented on June 28, 2024

Can you turn on debug logs, restart, and then reproduce? First need to find whats causing the failure. Most likely commands running too quickly or at once but I want the integration to be able to handle it

Ill digest the other stuff tomorrow

Add this to your configuration.yaml

logger:
  default: critical
  logs:
    custom_components.jvc_projectors: debug

from jvc_homeassistant.

rcdailey avatar rcdailey commented on June 28, 2024

I was able to reproduce it getting stuck on sdr when I was in HDR10 mode after starting a film in Plex. My automation didn't kick off because the JVC integration is stuck. Hopefully this helps. Debug logs were enabled using your YAML above.

home-assistant_2023-02-05T03-46-13.474Z.log

from jvc_homeassistant.

iloveicedgreentea avatar iloveicedgreentea commented on June 28, 2024

Okay thanks I am going to investigate this

from jvc_homeassistant.

iloveicedgreentea avatar iloveicedgreentea commented on June 28, 2024

Im still looking into this. Working on some library updates that might fix this incidentally

from jvc_homeassistant.

rcdailey avatar rcdailey commented on June 28, 2024

Thanks for the update! I really appreciate everything you're doing. I'm happy to give this another hammering when you make a new release. Just let me know!

from jvc_homeassistant.

iloveicedgreentea avatar iloveicedgreentea commented on June 28, 2024

can you check if 3.5.7 solves this issue

from jvc_homeassistant.

rcdailey avatar rcdailey commented on June 28, 2024

I'm sorry that I forgot to report back! I have been running the latest version for all this time and it's very solid. I haven't seen any errors in the logs. Thank you for the fix!

from jvc_homeassistant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.