FunkeyFlo / ps5-mqtt

Integrate your PlayStation 5 with Home Assistant
MIT License
365 stars 33 forks source link

[Feature request]: Show a proxy "is restmode" state #464

Open Shentoza opened 1 week ago

Shentoza commented 1 week ago

Is your feature request related to a problem? Please describe

When just using the device state, it's impossible to determine if the ps5 is turned off. As a workaround i did a little boolean input that states as a "Restmode" proxy, using the following behavior: 1) when you Turn off the ps5, it immediately goes from "on" into "Not available" state and I do nothing 2) when you put the PS5 into rest mode it goes from "On" into "Off" state, that means it's in restmode and I set the flag. After a while the ps5 also goes into "Not available" state.

I clear the flag, when the ps5 is turned on again.

Using this automation I can e.g. prevent my outlet from turning off while my PS is in restmode.

Describe the solution you'd like

Maybe this behavior could be put in a proxy state available natively by the mqtt integration

Describe alternatives you've considered

Hoenstly not so many.

Additional context

That's how my restmode proxy automation currently looks like.

description: ""
mode: single
triggers:
  - type: changed_states
    device_id: 11352e7b5b16a0603d1ec10a17dba138
    entity_id: 0243d40ffe89ae038471b24e078a735f
    domain: switch
    trigger: device
  - entity_id:
      - sensor.ps5_activity
    trigger: state
conditions: []
actions:
  - choose:
      - conditions:
          - condition: and
            conditions:
              - condition: state
                entity_id: sensor.ps5_activity
                state: none
              - condition: device
                type: is_off
                device_id: 11352e7b5b16a0603d1ec10a17dba138
                entity_id: 0243d40ffe89ae038471b24e078a735f
                domain: switch
        sequence:
          - action: input_boolean.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.ps5_restmode
      - conditions:
          - condition: device
            type: is_on
            device_id: 11352e7b5b16a0603d1ec10a17dba138
            entity_id: 0243d40ffe89ae038471b24e078a735f
            domain: switch
        sequence:
          - action: input_boolean.turn_off
            target:
              entity_id:
                - input_boolean.ps5_restmode
            data: {}