(time) conditional creation of Plex sensor/mediaplayer?

HI,

Plex runs on my NAS, which switches Off during night time.
Consequently, Plex sensor in my HA setup causes endless errors while trying to connect.
I have both plex sensor

- platform: plex
  icon: mdi:plex
  host: !secret plex_ip
  port: 32400
  username: !secret plex_username
  password: !secret plex_password

and plex mediaplayer

- platform: plex
  entity_namespace: 'plex'
  include_non_clients: false
  scan_interval: 30
  show_all_controls: true
  use_custom_entity_ids: true
  use_episode_art: true

setup in my configuration.

Is it somehow possible to have these sensors not connect during NAS-off time, or maybe, only have these sensors created during ON time? Possibly with templates for the time and creation entities? Maybe sensing mqtt events?
simplest of course would be a plain condition: between 0630 am and 2330 pm statement…

i have several dynamically created sensors python scripts, but these Plex-sensors go beyond something like:

has.states.set(‘sensor.plex’, ‘’, {
‘entity_picture’: ‘/local/modes/plex.png’,
‘friendly_name’: ‘’
‘unit_of_measurement’: ‘Plex’,
‘hidden’: hidden,
‘order’: order
})
(crude copy, paste)

If this would somehow be possible, it would be even greater to let the sensor read the time settings on the NAS, but that would definitely be phase 2 :wink:

Hope someone can help,
Thanks,
Marius

You would be better off leaving the NAS on. Your not doing your hard drives much good by keep spinning them up and down every day. What benefit do you feel you are gaining by switching it off over night?

Hi
Saving power…

You feel the hard drives are suffering even while they already are a sleep after non-use in power saving mode?

Did you ever find a solution to this? :slight_smile:

If in search only for PMS sensors, have you tried Tautulli?