Pulling my hair for Time condition

Hi Team

I am trying to have motion-activated light, only to trigger between 11 pm to 5 am, and below is the code, however, this doesn’t work, and when I check the debug log, when the automation fired, now_time () was in iso-format and showed as 4 pm (while my local time was 12 am), hence light didn’t turn on. I have checked my time zone and it’s correct.

  • condition: time
    after: ‘23:00:00’
    before: ‘05:00:00’
    action:
  • type: turn_on
    device_id: XXXXX
    entity_id: switch.power_outlet
    domain: switch

Any support is appreciated.

Where is the rest of your automation? What you have posted is just a condition and an action, devoid of necessary configuration data.

trigger:
  - type: motion
    platform: device
    device_id: XXXX
    entity_id: binary_sensor.motion_sensor
    domain: binary_sensor
  - type: motion
    platform: device
    device_id: XXXX
    entity_id: binary_sensor.motion_sensor_XX
    domain: binary_sensor
 condition:
  - type: is_illuminance
    condition: device
    device_id: XXXXX
    entity_id: sensor.illumination_XX
    domain: sensor
    below: 100
  - condition: time
    after: '23:00:00'
    before: '05:00:00'
 action:
  - type: turn_on
    device_id: XXXX
    entity_id: switch.power_outlet
    domain: switch
  - delay:
      hours: 0
      minutes: 3
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: XXXX
    entity_id: switch.power_outlet
    domain: switch
 mode: single

Please read point 11 here then edit your posts and format them correctly.

Thanks, edited it.

How did you install Home Assistant?

Your host OS timezone may not be set correctly.

Hi
I am using HASS portable version,

'https://github.com/AlexxIT/HassWP

Sorry, can you please guide me on how to change the time zone? Although I can see the correct time zone in Configuration–> General → Time Zone

Yeah that thing is an abomination. I hope you are just testing to see if home assistant is for you and have plans to install it via one of the official methods later if you like it.

Seems there are already issues open:

Thanks Sir. I am a noob to IT stuff, however really liked home assistant and its power. Is there any easy way to install a home assistant on a windows machine?

Don’t use Windows as a base OS.

It will restart without warning to install updates.

Have a look at the official install methods here: