How to best open and close shutters based on temperature? (Shutters work on homebridge)

I have this automation in HA based on inside and outside temperature sensors. At the moment it just sends a notification, but I would like to trigger my electronic shutters.

#automation cool_outside:
  - alias: 'Hot ℃: Notify inside/outside flip'
    trigger:
    - platform: state
      entity_id: sensor.cooler
    condition:
    - condition: template
      value_template: "{{ trigger.to_state.state != trigger.from_state.state }}"
    action:
    - service: notify.notify
      data:
        title: Home Assistant
        message: "It's cooler {{ states('sensor.cooler') }}"
    mode: single

The shutters are Somfy brand and I trigger them in Homebridge using this plugin: @jdes/homebridge-tost-corp-somfy-rts-web - npm

They are exposed as individual shutters than can either open or close, but there is no way to know the state of the shutter if someone used the traditional remote.

I can for example tell Siri “close all the shutters” and it works. I would like to do this when it gets hotter outside than inside.

Can anyone offer advice on the best way to do this?

Umm… what?
This condition does nothing.
Every time the state changes then the from state and to state is naturally not equal.
Is it supposed to be >= or <= ?

And it would be nice to know what sensor.cooler is.

Thanks for your help, here is the value template I am using where sensor.cooler is determined. Definitely happy to take advice on how to improve.

template:
 - sensor:
    - name: "hottest temp"
      device_class: temperature
      unit_of_measurement: °C
      state: >
        {% set sensors = [
          states('sensor.bureau_temperature') |round(1),
          states('sensor.bedroom_temperature') |round(1),
          states('sensor.nursery_temperature') |round(1),
          states('sensor.salon_temperature') |round(1),]
          |reject('none')|list
          %}
        {{ sensors | max }}

    - name: "Coolest temp"
      device_class: temperature
      unit_of_measurement: °C
      state: >
        {% set sensors = [
          states('sensor.bureau_temperature') |round(1),
          states('sensor.bedroom_temperature') |round(1),
          states('sensor.nursery_temperature') |round(1),
          states('sensor.salon_temperature') |round(1),]
          |reject('none')|list
          %}
        {{ sensors | min }}

    - name: "Cooler"
      state: >
        {% if states('sensor.de_hors_temperature') < states('sensor.coolest_temp') %} outside (open windows)
          {% elif states('sensor.de_hors_temperature') > states('sensor.hottest_temp') %} inside (close windows)
          {% else %} neither in nor out
          {% endif %}

I would think that both of your if statements could be true at the same time.
If one room is south facing and one is north then you could be fooled to open all windows.

But that aside your automation should not trigger on any state since you have a else option also.

  - alias: 'Notify inside/outside flip'
    trigger:
    - platform: state
      entity_id: sensor.cooler
      to: "outside (open windows)"
      id: "outside"
    - platform: state
      entity_id: sensor.cooler
      to: "inside (close windows)"
      id: "inside"
    condition:
    action:
    - service: notify.notify
      data:
        title: Home Assistant
        message: "It's cooler {{ trigger.to_state }}"
    mode: single

But regarding how to operate the shutters, don’t know. I don’t have any shutters.
What is the service call to open/close them? That service call needs to be appended at the end with something to differentiate between open/close.
But that depends on what the service call looks like.

Thanks, I am not sure how to call the shutters from HA. It seems it is not possible to expose Homebridge devices to HA? Is that right?

I don’t have a Homebridge. I generally stay clear off Apple products.
But I wouldn’t be surprised if that is the case.
I can’t help you much in that area since I don’t have the shutters or anything related.