Automation/script from motion sensor

Hi,

With a motion sensor, if the status changes from “off” to “on”, I’d like to create an Automation/script to :

  • change a card value (ex : motion = ON). The “ON” value must remain until I click on a button on the card to reset it to “OFF”.
  • Show a picture card (previously hidden). The picture card must remain on the dashboard, until I click on it to hide it again.

I’m a beginner with HA configuration, any help or information on how to start would be appreciated !

Thanks in advance

This can be done via the frontend gui or in the yaml files - I’ll give you pointers to doing it in the gui .

  • Create an input_boolean (configuration -> helpers)
  • Setup your automation (configuration -> automations) to turn the input_boolean on when there is motion detected.

In the GUI editor -

  • Add a card to display the input_boolean (entities, entity, glance, button are probably reasonable)
  • Depending on the card you use, you may get a toggle switch or a default tap_action to turn off the input_boolean when you want to. Otherwise, you might have to configure a toggle tap_action.
  • Create a conditional card based on the status of your input_boolean, put a picture card inside it.
  • When you turn off your input_boolean the picture will disappear and appear again when the input_boolean is turned on by the automation
  • You could also / instead set up a tap_action on the picture card, so that when you tap it the input_boolean is switched off and the picture disappears.

There’s many more ways to skin this particular cat, but the above should work and each area I’ve mentioned has reasonable documentation.

Thank you eggman for your help and the redirection to the boolean input.
It works perfectly now with your recommendations !