Newbie struggling with a sensor and two lights

I’m a newbie.
I have a Hue outdoor motion sensor.
I have two Hue lights in a Hue group called “Front conservatory”.
If the sensor detects movement I want the two lights to come on.
I want the lights to turn off 10 minutes after the sensor last detects movement.
I only want these actions to happen between (i) 30 mins before sunset; and (ii) sunrise.

I have created two automations using the UI.

The automations work almost as expected.

The first problem is that, 30 seconds after I leave the range of the detector, the lights go from 100% brightness to about 50% brightness.

The second problem is that the lights turn off about 55 seconds after I leave the range of the detector.

I have spent several days trying to figure this out including looking through this forum, Reddit, the Documentation and the examples.

Many thanks

	- alias: 'Lights on'
	  trigger:
	    type: motion
	    platform: device
	    device_id: 8e880f8d154811ebb943a557ed2f25fd
	    entity_id: binary_sensor.hue_outdoor_motion_sensor_1_motion
	    domain: binary_sensor
	    for:
		  hours: 0
		  minutes: 0
		  seconds: 0 
	  condition:
	    condition: sun
	    after: sunset
	    after_offset: '-00:30:00'
	  action:
	    service: light.turn_on
	    entity_id: light.front_conservatory 
 
	- alias: 'Motion ended' 
		type: no_motion
		platform: device
		device_id: 8e880f8d154811ebb943a557ed2f25fd
		entity_id: binary_sensor.hue_outdoor_motion_sensor_1_motion
		domain: binary_sensor
		for:
		  hours: 0
		  minutes: 10
		  seconds: 0
      action:  
		service: light.turn_off
		data: {}
		entity_id: light.front_conservatory

If you can solve this, then how about my other problem here?
https://community.home-assistant.io/t/how-do-i-edit-configuration-yaml-when-i-cant-even-find-the-file-editor/239787/5

I’ve literally just solved an identical issue for someone else in this thread…

Read the thread to ensure that you understand how we got where we did, and then adjust the entity_ids to suit :+1:

Thank you for your prompt response.
I have read the thread carefully, in particular, your concluding post setting out the logic.
Despite that I still cannot see what is wrong with mine (apart from the lack of a sunrise condition).
Are you able to highlight the errors in my code?

Also, unfortunately, I am restricted to using the UI as I cannot access automation.yaml (or configuration.yaml - see the post linked above).

No idea why the one’s you have already don’t work, all I can really say is that those device triggers are only user friendly for the purpose of generating an automation in the ui, if it then doesn’t work there’s not a lot you can do with them.

As for your other problem I think you need to report that as a bug, the official addon store should be included as standard, so if it isn’t there then something has gone wrong.

Ok, thanks. The problem is that I am not experienced enough to understand your solution.
I followed the example/tutorial to create a first automation and it hasn’t worked.

Surely the yaml must indicate why it doesn’t work?

Can anyone else tell me why my yaml does not work?

Thank you