Triggered automation - testing conditions manually; different actions for different numeric values of same entity

hi
I’m writing my first automation. I have two problems:

first problem

trigger:
  - platform: time
    at: 00:30
  condition:
  - condition: numeric_state
    entity_id: sensor.solar_forecast_today
    below: '5'
  action:
<not had any issues here>
    

I want to test that the condition logic does the right thing. I beat my head against this one for two days because the action would always fire no matter what the condition, then I found deep in this forum in a couple of postings, that a manually triggered automation ignores all conditions :frowning: I did rtfm in depth but did not find it.
so how do you workaround this - how do you test that a condition evaluates the way that you want it to, without waiting for the trigger event?

second problem:
can you build in one automation a more sophisticated logic that takes same action with different value based on different conditions? it would seem ugly to have to write this as 3 separate automations triggering a few mins apart?

i.e.

numericstate_of_entity above A below B do action1 with value X
numericstate_of_entity above B below C do action1 with value Y
numericstate_of_entity above C below D do action1 with value Z
etc

X, Y, Z will be hardcoded values
thanks
Ian

Service automation.trigger

This service will trigger the action of an automation. By default it bypasses any conditions, though that can be changed via the skip_condition attribute.

Use the automation trigger service in Developer Tools Services Open your Home Assistant instance and show your service developer tools. and make sure you set the skip_conditions option to false.

Yes you can. Use the choose: action. Script Syntax - Home Assistant

1 Like

I think this has been nicely clarified in the latest versions, rather than “trigger” it now says “run actions”
It would be nice to have a button that says “test conditions” and a tick appears next to each condition that is true

2 Likes

For the second problem you can use choose action type where actions can be done according to different condition.

action:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.temperature_sensor_1
            above: '20'
            below: '25'
        sequence:
          - service: 'switch.turn_on'
            data: {}
      - conditions:
          - condition: numeric_state
            entity_id: sensor.temperature_sensor_1
            above: '25'
            below: '30'
        sequence:
          - service: 'switch.turn_on'
            data: {}
    default: []

This is the simplest way, an advanced way would be to use templates inside service data like this.

thanks all for the help, I have this working now