Playstation 4/PS4 custom component

yes I have

Ah I forgot about a caveat, you’ll also need the preloader card because you have to use custom elements with it. You’ll need to preload picture-glance card.

type: custom:config-template-card
variables:
- states['media_player.playstation_4'].attributes.entity_picture
entities:
- media_player.playstation_4
- switch.ps4
card:
  aspect_ratio: 0%
  entities:
  - entity: switch.ps4
  - entity: switch.fire_tv
  - entity: switch.watch_tv
  - entity: switch.listen_to_music
  entity: sensor.harmony_activity
  hold_action:
    action: none
  state_image:
    Listen to Music: local/music.jpg
    Play PS4: "${ var[0] }"
    PowerOff: local/Poweroff.png
    Watch Fire TV: local/fire_tv.jpg
    Watch TV: local/tv.jpg
  tap_action:
    action: more-info
  theme: Google Dark Theme
  title: harmony
  type: custom:hui-picture-glance-card

Thank you very much for you help.
I have installed the preloader but I am no sure how to preload picture-glace card.

Hey everyone!

I have Router A connected to the internet, then I have Router B connected to Router A via ethernet.

My PlayStation4 is connected via ethernet to Router A, while my Raspi running HassOS is connected to Router B.

Internet --- Router A --- Router B --- Home Assistant
                |
               PS4

If I connect to Router B with my laptop, I can ping the PS4’s IP on Router A, I get a response so I’m able to reach it.
But when I try and pair the component, it won’t find my PS4 even if I type in the IP manually during the configuration.
Also the ps4 2nd screen app won’t find the PS4 if I connect my phone to Router B, but it finds it if I connect my phone to Router A.

Do you guys have any idea on how I could make it work please?

Thank you very much!

Still working on my auto button idea. But i have an issue with the entity pics. Any ideas how to import the links to the image files in json file that the ps4 integration is using to node red so i can use it to update the image on the sensor

Got it to work now i have 4 generic app sensors and 4 generic game sensors.that contains the 4last app/games i started on the ps4.

next step is to create template switches for them. but i think that will be the easy part

1 Like

Can you share how you achieved this? I’m interested to see how you did this, to use with PS4 and possibly other entities :slight_smile:

Sure . it may not be the prettiest or most effetive but i got it to work.

[{"id":"a99aca48.636358","type":"switch","z":"4d980637.848cf8","name":"","property":"ps4_media_image.media_content_type","propertyType":"msg","rules":[{"t":"eq","v":"game","vt":"str"},{"t":"eq","v":"app","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":690,"y":460,"wires":[["e01ccecc.cd89"],["1197faa3.befed5"]]},{"id":"882d08da.7cd658","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 game 1","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_app_game.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"ps4_media_image.media_image_url","valueType":"msg"},{"property":"media_content_id","value":"data_app_game.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"ps4_media_image.media_content_type","valueType":"msg"},{"property":"media_title","value":"data_app_game.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1530,"y":80,"wires":[[]]},{"id":"93809f99.8a0b2","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 game 2","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4game1.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4game1.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4game1.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"ps4_media_image.media_content_type","valueType":"str"},{"property":"media_title","value":"data_ps4game1.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"data","outputLocationType":"msg","inputOverride":"allow","x":1530,"y":160,"wires":[[]]},{"id":"70b397b9.67f2e8","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 game 3","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4game2.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4game2.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4game2.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"ps4_media_image.media_content_type","valueType":"str"},{"property":"media_title","value":"data_ps4game2.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1530,"y":220,"wires":[[]]},{"id":"939cb4e1.cbfdc8","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 game 4","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4game3.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4game3.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4game3.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"ps4_media_image.media_content_type","valueType":"str"},{"property":"media_title","value":"data_ps4game3.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1530,"y":280,"wires":[[]]},{"id":"b6c3d143.ca2b4","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 app 1","server":"9b88cb19.5c8db8","version":1,"debugenabled":true,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_app_game.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"ps4_media_image.media_image_url","valueType":"msg"},{"property":"media_content_id","value":"data_app_game.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"ps4_media_image.media_content_type","valueType":"msg"},{"property":"media_title","value":"data_app_game.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1540,"y":400,"wires":[[]]},{"id":"6317a610.3948d8","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 app 2","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4app1.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4app1.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4app1.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"data_ps4app1.attributes.media_content_type","valueType":"msg"},{"property":"media_title","value":"data_ps4app1.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1540,"y":480,"wires":[[]]},{"id":"5512c102.38a6b","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 app 3","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4app2.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4app2.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4app2.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"data_ps4app2.attributes.media_content_type","valueType":"msg"},{"property":"media_title","value":"data_ps4app2.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1540,"y":560,"wires":[[]]},{"id":"68848ebd.9b60b","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 app 4","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4app3.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4app3.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4app3.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"app","valueType":"str"},{"property":"media_title","value":"data_ps4app3.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1540,"y":660,"wires":[[]]},{"id":"189368be.a0bc5f","type":"inject","z":"4d980637.848cf8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":100,"wires":[["9b9d987.bbddb68"]]},{"id":"1197faa3.befed5","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_app_1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4app1","override_data":"msg","blockInputOverrides":false,"x":1040,"y":400,"wires":[["98105449.793058"]]},{"id":"98105449.793058","type":"switch","z":"4d980637.848cf8","name":"","property":"data_app_game.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_ps4app1.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4app1.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":2,"x":1370,"y":400,"wires":[["b6c3d143.ca2b4"],["b58d7d43.18dd6","b6c3d143.ca2b4"]]},{"id":"b58d7d43.18dd6","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_app_2","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4app2","override_data":"msg","blockInputOverrides":false,"x":1040,"y":480,"wires":[["435fce72.18fe4"]]},{"id":"435fce72.18fe4","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4app1.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_ps4app2.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4app2.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":2,"x":1370,"y":480,"wires":[[],["6317a610.3948d8","5b86750a.3c984c"]]},{"id":"5b86750a.3c984c","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_app_3","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4app3","override_data":"msg","blockInputOverrides":false,"x":1040,"y":560,"wires":[["4ceb1b16.ced0e4"]]},{"id":"4ceb1b16.ced0e4","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4app2.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_app_game.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4app3.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4app3.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":3,"x":1370,"y":560,"wires":[[],[],["5512c102.38a6b","5152fec1.05591"]]},{"id":"5152fec1.05591","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_app_4","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4app4","override_data":"msg","blockInputOverrides":false,"x":1040,"y":640,"wires":[["31a4caf1.459206"]]},{"id":"31a4caf1.459206","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4app3.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_app_game.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4app1.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4app4.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4app4.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":4,"x":1370,"y":640,"wires":[[],[],[],["68848ebd.9b60b"]]},{"id":"e01ccecc.cd89","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_game_1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4game1","override_data":"msg","blockInputOverrides":false,"x":1100,"y":80,"wires":[["9ea0be65.d70a3"]]},{"id":"9ea0be65.d70a3","type":"switch","z":"4d980637.848cf8","name":"","property":"data_app_game.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_ps4game1.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4game1.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":2,"x":1350,"y":80,"wires":[["882d08da.7cd658"],["500f5cfa.1f2f84","882d08da.7cd658"]]},{"id":"500f5cfa.1f2f84","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_game_2","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4game2","override_data":"msg","blockInputOverrides":false,"x":1100,"y":160,"wires":[["7ce4c93e.6a39b8"]]},{"id":"7ce4c93e.6a39b8","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4game1.attributes.media_content_id","propertyType":"msg","rules":[{"t":"neq","v":"data_ps4game2.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4game2.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":2,"x":1350,"y":160,"wires":[["93809f99.8a0b2","c8203612.aedd18"],[]]},{"id":"c8203612.aedd18","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_game_3","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4game3","override_data":"msg","blockInputOverrides":false,"x":1100,"y":220,"wires":[["47adcc65.9c9544"]]},{"id":"47adcc65.9c9544","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4game2.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_app_game.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4game3.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4game3.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":3,"x":1350,"y":220,"wires":[[],[],["70b397b9.67f2e8","dd191948.cb1ca8"]]},{"id":"dd191948.cb1ca8","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_game_4","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4game4","override_data":"msg","blockInputOverrides":false,"x":1100,"y":280,"wires":[["aac51492.ce59c8"]]},{"id":"aac51492.ce59c8","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4game3.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_app_game.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4game1.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4game4.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4game4.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":4,"x":1350,"y":300,"wires":[[],[],[],["939cb4e1.cbfdc8"]]},{"id":"24c561b1.25dc3e","type":"poll-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"media_player.pandoras_box","state_type":"str","halt_if":"playing","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":170,"y":40,"wires":[["9b9d987.bbddb68"],[]]},{"id":"9b9d987.bbddb68","type":"bigfile reader","z":"4d980637.848cf8","name":"","filename":"/config/.ps4-games.709E290032B2_9077.json","nopayload":true,"flow":"blocks","highWaterMark":16,"encoding":"utf8","format":"utf8","keepEmptyLines":false,"x":420,"y":120,"wires":[["e7f0d62d.9601b8"],[]]},{"id":"4f37366e.ff97f8","type":"split","z":"4d980637.848cf8","name":"","splt":",*","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":690,"y":200,"wires":[["8e6b764d.cb1928"]]},{"id":"e7f0d62d.9601b8","type":"change","z":"4d980637.848cf8","name":"file custom","rules":[{"t":"change","p":"payload","pt":"msg","from":"},","fromt":"str","to":"}},*{","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":200,"wires":[["4f37366e.ff97f8"]]},{"id":"8e6b764d.cb1928","type":"json","z":"4d980637.848cf8","name":"","property":"payload","action":"","pretty":false,"x":410,"y":280,"wires":[["a2522c8.73476d"]]},{"id":"a2522c8.73476d","type":"change","z":"4d980637.848cf8","name":"ps4_media_image","rules":[{"t":"move","p":"payload","pt":"msg","to":"ps4_media_image","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":280,"wires":[["7e4eeaba.ec9e84"]]},{"id":"7e4eeaba.ec9e84","type":"change","z":"4d980637.848cf8","name":"","rules":[{"t":"move","p":"ps4_media_image","pt":"msg","to":"ps4_media_image.orig","tot":"msg"},{"t":"set","p":"ps4_media_image.media_image_id","pt":"msg","to":"(ps4_media_image.orig.($keys()))","tot":"jsonata"},{"t":"set","p":"ps4_media_image.media_image_url","pt":"msg","to":"(ps4_media_image.orig.*.media_image_url)","tot":"jsonata"},{"t":"set","p":"ps4_media_image.media_content_type","pt":"msg","to":"(ps4_media_image.orig.*.media_content_type)","tot":"jsonata"},{"t":"delete","p":"ps4_media_image.orig","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":380,"wires":[["11d2c7bd.8c0b68"]]},{"id":"11d2c7bd.8c0b68","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.pandoras_box","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_app_game","override_data":"msg","blockInputOverrides":false,"x":270,"y":460,"wires":[["79c34b4c.954b34"]]},{"id":"79c34b4c.954b34","type":"switch","z":"4d980637.848cf8","name":"","property":"data_app_game.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"ps4_media_image.media_image_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":1,"x":550,"y":460,"wires":[["a99aca48.636358"]]},{"id":"9b88cb19.5c8db8","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

in short it checks the state of the ps4 (here named pandoras_box) every minute or so, then it picks up the info in the ps4 integration data file .ps4-games.json i dom some formatting and moving the payload around then i pick up the state again from the ps4 (you dont get all the info in the scheduled one as you get in the triggered one) then i clean it again, and then splt it based on app or game and start sending the data to populate the first sensor. in this I always update the firts sensor (ex. ps4_app_1), but if the payload and the ps4_app_1 does not match based on media content id it also sends it to the second sensor to trigger an update to copy the old ps4_app_1 data into ps4_app_2. and so on until it it comes to a ps4_app_x that have the same values as the one before (ps4_app_x-1) used to have.

so thats how it works in semi-short.

if you have any improvements let me know.

sincearly
Fredrik

1 Like

short note. this just creates the sensors and you have to rename the entities in HA.
i am working on the switch part to be able to start a recently used game or app. will post that code also when done

1 Like

Thanks a lot, I’ll experiment with your code :slight_smile: !

1 Like

here is the code for my related switch

      ps4_game_1:
        value_template: "{{ is_state_attr('remote.vardagsrum', 'current_activity', 'Ps4') and is_state('media_player.pandoras_box', 'playing') and ( state_attr('sensor.ps4_game_1', 'media_title') == state_attr('media_player.pandoras_box', 'source')) }}"
        entity_picture_template: "{{ state_attr('sensor.ps4_game_1', 'entity_picture') }}"
        turn_on:
          - service: media_player.select_source
            data:
              entity_id: media_player.pandoras_box
            data_template: {
              source: "{{ state_attr('sensor.ps4_game_1', 'media_title') }}"
            }
        turn_off:
          - service: media_player.media_stop
            entity_id: media_player.pandoras_box
2 Likes

Since 0.112 my PS4 is turning on randomly and mostly at night, did anyone else recognized that? Or maybe got some idea to prevent because all connected HDMI devices also turns on…

I don’t think this has to do with HA. Because I have experienced that without using HA as well on my PS4 (and PS4 Pro). So did my younger brother and lot of other people online. It can be a HDMI CEC issue (perhaps an other device turns on, which causes the PS4 to turn on). Also I know that the PS4 (not Pro) has a very sensitive eject button, which goes to the bottom of the PS4. Sometimes even vibration can activate it, which can turn on the PS4. Raising your PS4 slightly can solve that.

For instance: https://www.reddit.com/r/PS4/comments/7uv37p/ps4_randomly_turning_on_and_ejecting_discs/

That being said, check your automations. Maybe you have a mistake in your automations where you listed the PS4 instead of a different device.

I got this aswell. My tv was still on when I got down in the morning. I think it has something to do with the PlayStation looking for updates…
I turn on my tv and receiver on with an automation, unless it is between 4h at night and 6h in the morning.
I think my PlayStation is still turning on now, (I didn’t check the logs) but my tv doesn’t turn on anymore at night.

I am attempting to setup my PS4 to work with just my voice commands from Google Home. I have HA setup, Hacs setup, IFTTT with webhooks, and the PS4 integration as well. I think I am failing at the point of configuring the configuration.yaml or automation.yaml with the correct info to fire off to the PS4. I have a media player in my overview that can turn on the PS4 by the power button or selecting any of the games I have already loaded. I can even turn on/control the PS4 through the service option, but I just can’t seem to get my code together correctly to run from a webhook from IFTTT. (PS. I already have Plex Assistant working through Google Home using IFTTT Webhooks. So the setup should be good).

If my PS4 is in REST MODE, can I turn it ON with the send_command service (it doesn’t work for me so I want to know if it is possible at all).

Thx

Yes, send command ps, which will send a PS button command which will turn PS4 on out of restmode (I use it all the time).

Thx for the reply

For me it doesn’t work for some reason. Note that if I turn on the PS, i do see that the command works, as it emulates the ps button press, but from rest mode it doesn’t.

Any idea why (Note that I use WIFI connection to PS4)?

Make sure the PS4 is setup correctly (not HA side). You need to check the power settings and make sure the PS4 can connect to network while in restmode and be waken from network.

https://manuals.playstation.net/document/gb/ps4/settings/standbymode.html
image

Also, I always advise using lan and not wifi. With wifi there is a chance of packet loss or that the router behaves differently (like disconnecting an inactive client). You’ll just make it harder for yourself with wifi imho.

1 Like

Yes, that was th eissue, Thx :slight_smile:

1 Like