Actions templates - Help request - can't get it running anymore

Hi there,

I’m struggling with getting my automations work as I would like to.
1st of all I can’t make it working anymore to increase/decrease color temp of my lights and I can’t recall what have I done to make it stop…

This is how I was trying to make it working:

service: light.turn_on
  target:
    entity_id: light.duze
  data:
    entity_id: light.duze
    color_temp: "{{states.light.duze.attributes.color_temp | int - 30}}"

While trying to make it running it gives back this error:

UndefinedError: 'mappingproxy object' has no attribute 'color_temp'

2nd part is with my Aqara Cube controlling my sun screen.
Aqara Cube’s values are degrees which goes beyond 100 and sun screen position is limited to 100.
How to limit my cover position to max 100% even when Aqara Cube’s degress are going above100?

My code right now:

service: cover.set_cover_position
data_template:
  entity_id: cover.ekran_sloneczny
  position: >-
    {% if trigger.payload_json.action_angle | int > 0 %} {{ 
    states.cover.ekran_sloneczny.attributes.position | int +
    (trigger.payload_json.action_angle | int) /2 }} {% else %} {{ 
    states.cover.ekran_sloneczny.attributes.position | int +
    (trigger.payload_json.action_angle | int) /2 }} {% endif %}  

Really appreciate any help!