Is there an easy way to send a command to a device only if it would result in a change? My specific use case is motorized blinds. I only want to send the command to change position if they aren’t already in the requested position.
The reason for that is the DC adapter it uses is whiny when the motor is processing and the automation runs while we’re watching tv (so the noise is irritating).
Current automation:
alias: Blinds - Greatroom West - Master Controller
description: ''
trigger:
- platform: sun
event: sunset
offset: '00:60:00'
- platform: state
entity_id: input_boolean.auto_blinds_greatroom_west
to: 'on'
- platform: state
entity_id: input_boolean.dark_outside
- platform: state
entity_id: sun.sun
attribute: elevation
- platform: device
device_id: 3b0f9db703b143d6951c21fbb8b63255
domain: media_player
entity_id: media_player.denon_avr_s720w
type: turned_off
for:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- platform: device
device_id: 3b0f9db703b143d6951c21fbb8b63255
domain: media_player
entity_id: media_player.denon_avr_s720w
type: turned_on
- platform: sun
event: sunrise
- platform: state
entity_id: media_player.shield_living_room
condition:
- condition: state
entity_id: input_boolean.auto_blinds_greatroom_west
state: 'on'
action:
- choose:
- conditions:
- condition: or
conditions:
- condition: sun
after: sunset
after_offset: '00:55:00'
- condition: sun
before: sunrise
sequence:
- device_id: 7808f9da3c1f435e838acf6b36f23352
domain: cover
entity_id: cover.blinds_greatroom_west
type: set_position
- conditions:
- condition: state
entity_id: input_boolean.dark_outside
state: 'on'
sequence:
- device_id: 7808f9da3c1f435e838acf6b36f23352
domain: cover
entity_id: cover.blinds_greatroom_west
type: set_position
position: 100
- conditions:
- condition: numeric_state
entity_id: sun.sun
attribute: elevation
above: '2.6'
below: '75'
- condition: numeric_state
entity_id: sun.sun
attribute: azimuth
above: '190'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.outside_hot
state: 'true'
- condition: device
device_id: 3b0f9db703b143d6951c21fbb8b63255
domain: media_player
entity_id: media_player.denon_avr_s720w
type: is_on
- condition: state
state: playing
entity_id: media_player.shield_living_room
sequence:
- device_id: 7808f9da3c1f435e838acf6b36f23352
domain: cover
entity_id: cover.blinds_greatroom_west
type: set_position
default:
- device_id: 7808f9da3c1f435e838acf6b36f23352
domain: cover
entity_id: cover.blinds_greatroom_west
type: set_position
position: 100
mode: single