What is the best practice if you have apps that listen to and get states from zwave entities to have those apps wait until your zwave network is up?
I know there is a method to make [all the apps wait](https://appdaemon.readthedocs.io/en/latest/CONFIGURE.html?highlight=zwave#examples) ,but what if I just want certain apps or certain parts of the app to wait until the entity is available?
Maybe try: except: or including the default= option in the self.get_state() ?
I just feel like I must be missing something that works really well without stopping my whole plugin.
Well, not sure about appdaemon, do not use it. For native automations I use input_boolean flag in conditions, that is set to on when zwave network is ready to be used. Perhaps this concept can be reused:
input_boolean:
# Input boolean definition
zwave_active:
name: Z-Wave Network Active
initial: off # set to off when HA is restarted
icon: mdi:z-wave
automation:
# Set Z-Wave Network flag to active when network ready
- id: 'set_zwave_flag'
alias: Set ZWave Flag
initial_state: true
trigger:
platform: event
event_type: zwave.network_ready
action:
- service: input_boolean.turn_on
data_template:
entity_id: input_boolean.zwave_active
# sample automation that refreshes node value, only once network is ready
- id: 'refreshing_car_sensors'
alias: Refreshing Car Presence Sensor
initial_state: True
trigger:
- platform: time_pattern
seconds: '/10'
condition:
- condition: state
entity_id: input_boolean.zwave_active
state: 'on'
action:
- service: zwave.refresh_node_value
data_template:
node_id: 32
value_id: "72057594579796210"
- service: zwave.refresh_node_value
data_template:
node_id: 32
value_id: "144115188617724146"