Cannot get Z wave automation to work with GE Switch

I have the GE switch set up and integrated. I can toggle the switch on and off manually but I cannot toggle the switch when testing the automation. I used the hassio to build the automation and here is the config that it built:
`- id: ‘1549382205542’
alias: GE Outdoor switch
trigger:

  • event: sunset
    platform: sun
  • event: sunrise
    platform: sun
    condition: []
    action:
  • alias: ‘’
    data:
    entity_id: switch.ge_12720_outdoor_smart_switch_switch
    service: switch.turn_on
  • data:
    entity_id: switch.ge_12720_outdoor_smart_switch_switch
    service: switch.turn_off
    `
    Not sure why the automation cannot turn the switch on/off.

Not sure what’s going on. If I change the service to switch.toggle the switch will change state. Am I missing a piece of the data for the switch.turn_on/off?

Please use code blocks so your configuration has proper spacing.

It looks like your actions are telling it to turn the switch on and then immediately off.

How do I use code blocks? I used the </> symbol and pasted my code between the tick marks. That didn’t seem to work.
Should the actions not be stacked in the order of the events?

  alias: Test Automation
  trigger:
  - at: '19:30:00'
    platform: time
  - at: '21:00:00'
    platform: time
  condition: []
  action:
  - data:
      entity_id: switch.ge_12720_outdoor_smart_switch_switch
    service: switch.toggle
  - data:
      entity_id: switch.ge_12720_outdoor_smart_switch_switch
    service: switch.toggle

This one works with the switch.toggle service.

What are you trying to accomplish? Do you just want to toggle the switch at the given times?

You only need the action once no matter how many triggers you have. Your triggers are treated like an OR so if the time is 19:30 or if the time is 21:00, the listed actions will occur.

If you want the switch to turn on at a specific time and then off at a different time, I would use 2 separate automations, one with switch.turn_on and one with switch.turn_off. That way if someone manually changes the state, it won’t toggle incorrectly when the time occurs.

That all makes sense. I wanted to turn the switch on at 19:30 but the switch.turn_on does not turn on the switch. Switch.toggle does work. I have no clue what is missing.

You can try homeassistant.turn_on instead.

I figured it out. Needed to have 2 different automations like it was suggested.