Unsupported platform: sun

Hi,

I want to add some lights to a Sun based timer, such as to come on 30 minutes after the sun has set, and then turn off 3 hours after that.

I saw an example in the cookbook (https://home-assistant.io/cookbook/automation_sun/)

I am trying to use the GUI Automation Panel in HA but it keeps saying “Unsupported platform: sun” when selecting “sun” as the Trigger Type.

This sensor is in my config file

Track the sun

sun:

And is appearing and tracking the sun in HA so i’m not sure why this is saying I cannot use it, can someone advise why this is happening?
If I create the automation in my config file manually will it run even though the GUI is saying its unsupported?

Daniel

Is sun: explicitly loaded in your configuration.yaml? Many people forget that this is not part of the default config file and it needs to be added.

As mentioned, it is in my config file

This sensor is in my config file

#Track the sun
sun:

Sorry; next time don’t use quoting - select the code and press this button:

This way it is apparent that you are referring to code and not quoting a section of a doc or something.

Keep in mind that the Automations GUI is brand new and there are still a number of bugs. Have you tried creating the automation manually by editing the YAML directly and seeing if you get the same error?

Hi,

I put the following in my autoations.yaml file and it gives an error when I check the config and only loads partial automations.

- alias: 'Hallway lights sunset'
  trigger:
    platform: sun
    event: sunset
    offset: "00:30:00"
  action:
    - service: homeassistant.turn_on
      entity_id: switch.hall_light
    - delay:
        delay: 03:00 # 3 Hours
    - service: homeassistant.turn_off
      entity_id: switch.hall_light

So here I am trying to have the trigger happen 30 minutes after sunset, turn the light on, wait 3 hours and turn them off again

Failed config
automation:
- action: [source /home/homeassistant/.homeassistant/automations.yaml:6]
- entity_id: switch.hall_light
service: homeassistant.turn_on
- delay: [source /home/homeassistant/.homeassistant/automations.yaml:9]
delay: 03:00
- entity_id: switch.hall_light
service: homeassistant.turn_off
alias: Hallway lights sunset
trigger: [source /home/homeassistant/.homeassistant/automations.yaml:2]
platform: sun
event: sunset
offset: 00:30:00

Successful config (partial)
automation:

Assuming you are seeing sun.sun in your dev states panel - which would indicate the sun platform is loaded - I think you want to use switch.turn_on instead of homeassistant.turn_on like in this example I use to turn on a light for the cat:

- alias: 'Kitty Light On'
  trigger:
    platform: sun
    event: sunset
  action:
    service: light.turn_on
    data_template:
      entity_id: light.dining_room

Start with this, replacing my light with yours and see if it validates. Then add the offset and check again. At that point you should be able to add in the delay, and see if that works.

I have found the issue with my config here, I will test this over tonight and see if it works.

Would like to know in advance if it should and if there is a known bug in the GUI or if anyone else receives the same

Dan

Search the issues in Github and this forum for your exact error.

But be aware when I ran a search for your original error message “Unsupported platform: sun” I found nothing.

Just for anyone who ends up coming to this in the future, even though the GUI says its unsupported it still worked in automation.

I came here because of a similar problem with time:

    Unsupported platform: time
    {
      "platform": "time"
    }

Attempting to add via the Automations panel.

1 Like

Any updates on this? I’m getting the unsupported platform: time error and it won’t let me save.

I am getting the same - I believe that the ‘time’ component was changed in how it needs to be addressed in automations although I dont see that in the documentation.

I have the same issue, time is unsupported… can anyone help? the few platforms I tried were all listed as unsupported.

same issue here :confused: