Need help testing sunrise and sunset

New to HA and super excited to see what I can do with this. This is what I have so far:

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: XXX
  longitude: XXX
  # Impacts weather/sunrise data
  elevation: 34
  # C for Celsius, F for Fahrenheit
  temperature_unit: F
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: America/Los_Angeles
  customize:
    switch.everspring_an157_plugin_appliance_module_switch_2:
      friendly_name: Living Room Light 1
    sensor.everspring_an157_plugin_appliance_module_alarm_level_2:
      hidden: true
    sensor.everspring_an157_plugin_appliance_module_alarm_type_2:
      hidden: true

device_tracker:
  platform: asuswrt
  host: 192.168.1.1
  username: XXX
  password: XXX

group:
  living_room:
    - switch.everspring_an157_plugin_appliance_module_switch_2

# Enables the frontend
frontend:

# Enables support for tracking state changes over time.
history:

# Discover some devices automatically
discovery:

# Weather Prediction
sensor:
   platform: yr

# View all events in a logbook
logbook:

# Track the sun
sun:

# Allows you to issue voice commands from the frontend
conversation:

# Checks for available updates
updater:

zwave:
  usb_path: /dev/ttyACM0
  config_path: /srv/hass/hass_venv/lib/python3.4/site-packages/libopenzwave-0.3.1-py3.4-linux-armv6l.egg/config
  polling_interval: 60000

automation:
  alias: Turn on light when sun sets
  trigger:
    platform: sun
    event: sunset
    offset: "-01:00:00"
  action:
    service: switch.turn_on
    entity_id: group.living_room

automation 2:
  alias: Turn off lights when sun rises
  trigger:
    platform: sun
    event: sunrise
  action:
    service: switch.turn_off
    entity_id: group.living_room

So my question is, how can I test sunrise and sunset besides waiting? Setting the state didn’t seem to work for me under developer options.

1 Like

yeah, that is another issue that i have had, trying to test some of the automations i have built.

tips would be great!

On the Developer Tools > States page (the <> icon), click sun.sun and change the state. This should trigger your automations. (The state will change back once re-measured)

automation:
  alias: Turn on light when sun sets
  trigger:
    platform: sun
    event: sunset
  action:
    service: switch.turn_on
    entity_id: group.living_room

Really? So I’m currently testing this automation here, but for some reason, it’s not being caught. I’m currently tailing the logs and can see the event being fired, but I’m not seeing my lights turning on. Any thoughts?

Do you get any errors in the log during start up?

The only one I get is this issue here: https://github.com/home-assistant/home-assistant/issues/2435

Ok, should not be relevant
Try
service: homeassistant.turn_on
instead of
service: switch.turn_on

I tried it using the service tab in the dev console, and it had no effect. Should I still try it as an automation?
switch.turn_on is what actually turns on the light for me in the dev console

EDIT: Scratch that first bit, I specified the entity_id and the devService worked. Automation, however, is still not working.