What a diffrence manual yaml and made by automatio editor in Hassio

I have a question in topic regards.

I created manually automation:

- id: '1527669929227'
  alias: Hallway off
  trigger:
  - at: '23:00'
    platform: time
  action:
    service: homeassistant.turn_off
    data:
      entity_id: light.hallway

And this is generated by automation editor in Hassio

id: '1527669929227'
  alias: Hallway off
  trigger:
  - at: '23:00'
    platform: time
  condition: []
  action:
  - data:
      entity_id: light.hallway
    service: homeassistant.turn_off

Not a big difference by why after action is data and service on the end?
And useless (empty) condition is it necessary ?

Both seems to work but I reckon that file from automation editor is a bit less clear?

And what the point of “-” dash, some people use it some not only proper indentation.

I am lost to be honest a bit, could anyone clear it for my please?

there really isn’t any reason for the way it’s ordered. It seems confusing to me (as well as many others). That’s the reason I don’t use it.

and as for the ‘-’, you have to use the dash if you have more than one item in a list.

for example if you have multiple automations you have to start each one with a dash:

- alias: 'Water Sensor Main Basement Low Battery Notification'
  initial_state: 'off'
  trigger:
    platform: template
    value_template: '{{ states.sensor.batt_water_main_basement.state | int < 10 }}'
  action:
    service: notify.pushbullet_notify
    data:
      message: 'Warning - Water Sensor for Main Basement battery level is below 10%'
      
- alias: 'Indoor Temperature Too Low Notification'
  trigger:
    platform: numeric_state
    entity_id: sensor.computer_room_motion_temperature
    below: 50
  action:
    service: notify.pushbullet_notify
    data:
      message: 'Warning - Computer Room Temperature Sensor is Reading Too Low'

or if you have more than one trigger, condition or action in an automation:

- alias: Tresspass Warning
  trigger:
    - platform: state
      entity_id: input_boolean.bool_7
      to: 'on'
    - platform: state
      entity_id: group.motion_house
      to: 'on'
    - platform: state
      entity_id: sensor.motion_indoor_camera_living_room
      to: 'on'
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.bool_6
        state: 'on'
      - condition: state
        entity_id: group.all_devices
        state: 'not_home'
  action:
    - service: script.turn_on
      entity_id: script.burglar_alarm
    - service: notify.pushbullet_notify
      data:
        message: 'Warning - Tresspass alarm has been triggered!'

Thx mate, that’s explaining a lot t me.

One more question what is difference between:

service: homeassistant.turn_on
and
service: light.turn_on

Is the the light.turn_on is only about light?

yes.

you can use homeassistant.turn_on/_off to control anything (I think… or at least most things) while light.turn_on/_off, switch.turn_on/_off only works for those domains.

I’ve run into situations where trying to turn on a light with light.turn_on wouldn’t work but homeassistant.turn_on did so now I use homeassistant.turn_on/_off for everything.

Oh well seems to always is going of the road sometimes. Thanks for you help.

No I can not upgrade to 0.70.0 as I got error:

 hassio homeassistant update
ERROR
panic: interface conversion: interface is nil, not string

goroutine 1 [running]:
panic(0x2c7050, 0x107e21c0)
        /home/travis/.gimme/versions/go1.7.6.linux.amd64/src/runtime/panic.go:500 +0x33c
github.com/home-assistant/hassio-cli/command/helpers.DisplayOutput(0x107f6000, 0x24, 0x200, 0x0)
        /home/travis/gopath/src/github.com/home-assistant/hassio-cli/command/helpers/common.go:118 +0x3c8
github.com/home-assistant/hassio-cli/command/helpers.ExecCommand(0x2f6f83, 0xd, 0x7efcce5c, 0x6, 0x0, 0x0, 0x76500, 0x0, 0x0, 0x0, ...)
        /home/travis/gopath/src/github.com/home-assistant/hassio-cli/command/helpers/common.go:155 +0x308
github.com/home-assistant/hassio-cli/command.CmdHomeassistant(0x10778420)
        /home/travis/gopath/src/github.com/home-assistant/hassio-cli/command/homeassistant.go:48 +0x540
github.com/urfave/cli.HandleAction(0x2af768, 0x324b14, 0x10778420, 0x0, 0x0)
        /home/travis/gopath/src/github.com/urfave/cli/app.go:503 +0xf0
github.com/urfave/cli.Command.Run(0x2f6f83, 0xd, 0x0, 0x0, 0x40bd10, 0x1, 0x1, 0x301e4d, 0x2f, 0x0, ...)
        /home/travis/gopath/src/github.com/urfave/cli/command.go:165 +0x6b8
github.com/urfave/cli.(*App).Run(0x107648c0, 0x1070a140, 0x3, 0x4, 0x0, 0x0)
        /home/travis/gopath/src/github.com/urfave/cli/app.go:259 +0x8b0
main.main()
        /home/travis/gopath/src/github.com/home-assistant/hassio-cli/main.go:22 +0x108

Weird never happened, but always is first time, Hassio tab not working as well.

Rebooted, still the same.

Any ideas please

I don’t use hass.io. It would be better to start a new thread for that or add an entry to the existing 0.70.0 blog post thread.

Yeah, some people got the same issue, but my is not working, I did update and went well, but hassio tab not working, but at least some progress, anyway. Thanks mate for your help.

One more thing, could you have a look at this code:

alias: TV light on
  trigger:
    event: sunset
    offset: -00:30:00
    platform: sun
  condition: []
  action:
    service: light.turn_on
    data:
      brightness: 90
      entity_id: light.tv_light

It is working by turning on but not setting up brightness to 90, only kind of rundom number around 30s.

Is it something wrong with this code?

it looks ok to me but i don’t use any automations that vary brightness so i have no real experience with that part.

Nobody is perfect ;-).

No worries thx,