#change state X -> X. Will it send spamming request?

1 messages · Page 1 of 1 (latest)

violet condor
#

If automation change stat from X to X, will it send request to device or ignore?

context: I want to avoid spamming requests which do nothing. For example change light from off to off. Do I have to add extra condition to check if light is not off to not send off?

shut stag
#

that's not a state change, so it won't trigger anything

#

if you're talking about what happens if you tell a device that's off to turn off, it will send the command again

violet condor
#

to be clear: Do you mean if result of automation change state to the same value nothing will happen.

shut stag
#

it's up to the integration to decide whether not to, but I suspect that most will just send the command anyway

#

if you don't want that, you can add a condition

violet condor
#

I see: if I choose "device" as a result of automation the "off" will be send, but if I will select "entitity" as a result of automation and the state will be not modified nothing will happen.

shut stag
#

no, there's no difference between those

violet condor
#

hmm so I didn't get it

shut stag
#

ok

#

actions don't care what state the device is already in

violet condor
#

Will it send request to device controling light if state is already "off" ?

shut stag
#

they just do what you asked

#

you're turning it on

violet condor
#

What did you mean by

that's not a state change, so it won't trigger anything

?

shut stag
#

I misunderstood your initial question

violet condor
violet condor
shut stag
#

actions always run

violet condor
#

thanks

#

any way to configure HA to not send request if state didn't change?

#

for all automations?

shut stag
#

no

violet condor
#

🍻

shut stag
#

Add conditions where you want to avoid it. I do that in my "turn off all the lights" automation to avoid wasting time turning off lights that area already off, because it can slow down the response

violet condor
#

This is what I am doing, but I don't like it because I repeat myself a lot

shut stag
#
script:
  fr_off:
    mode: queued
    sequence:
      - condition: state
        entity_id: switch.fr_lamp_group
        state: 'on'
      - entity_id: switch.fr_lamp_group
        action: homeassistant.turn_off
violet condor
#

sorry, this is better example of repeating

#

I have trigger and condition: motion off / person off. plus I check if light is on (not off).

#

A lot of repeating

#

I was looking a way to simplify it, but if not possible, then I have my answer 🙂

shut stag
#

you can always combine things

violet condor
#

?

#

Do you mean create scripts?

#

or blueprint?

shut stag
#

blueprints are one option, scripts are another, templates another

violet condor
#

side question: any way to develop blueprint live in UI to test it, make changes , test... ?

#

some kind of extension for developers with extra funcionality?

shut stag
#

not that I'm aware of

#

but I don't use them