Remove °F from sensor data

I am attempting to adjust my thermostat based on outdoor temperature, but i cannot get the forecasted data to read because it is a string with °F added instead of just the number and i get this error

Executed: May 7, 2022, 6:00:00 AM
Error: In 'numeric_state': In 'numeric_state' condition: entity sensor.openweathermap_forecast_temperature state '°F' cannot be processed as a number

here is my automation. I wont know if there are any other errors because I cant get past step one

- id: '1651810037388'
  alias: thermostat
  description: ''
  trigger:
  - platform: time
    at: 06:00:00
  condition: []
  action:
  - choose:
    - conditions:
      - condition: numeric_state
        entity_id: sensor.openweathermap_forecast_temperature
        attribute: unit_of_measurement
        below: '65.0'
      sequence:
      - service: climate.set_temperature
        data:
          target_temp_high: 77
          target_temp_low: 73
        target:
          device_id: 8bcdcdf698609a3be9895bf989b4dc8b
      - service: climate.set_hvac_mode
        data:
          hvac_mode: heat_cool
    - conditions:
      - condition: numeric_state
        entity_id: sensor.openweathermap_forecast_temperature
        above: '65.0'
        below: '80.0'
        attribute: unit_of_measurement
      sequence:
      - service: climate.set_temperature
        data:
          target_temp_high: 76
          target_temp_low: 72
        target:
          entity_id: climate.upstairs_thermostat
      - service: climate.set_hvac_mode
        data:
          hvac_mode: heat_cool
        target:
          entity_id: climate.upstairs_thermostat
    - conditions:
      - condition: numeric_state
        entity_id: sensor.openweathermap_forecast_temperature
        attribute: unit_of_measurement
        above: '80.0'
        below: '95.0'
      sequence:
      - service: climate.set_hvac_mode
        data:
          hvac_mode: heat_cool
        target:
          entity_id: climate.upstairs_thermostat
      - service: climate.set_temperature
        data:
          target_temp_high: 77
          target_temp_low: 72
    - conditions:
      - condition: numeric_state
        entity_id: sensor.openweathermap_forecast_temperature
        attribute: unit_of_measurement
        above: '95.0'
      sequence:
      - service: climate.set_hvac_mode
        data:
          hvac_mode: heat_cool
        target:
          entity_id: climate.upstairs_thermostat
      - service: climate.set_temperature
        data:
          target_temp_high: 78
          target_temp_low: 74
    default: []
  mode: single

You are testing the attribute containing the unit_of_measurement, which is the postfix string describing the unit. You should remove the attribute from the conditions to test the value itself (which holds the actual state).

Thanks for your help, now to learn how to blueprint this with inputs so I can adjust the temperatures easily for both my units.

If you only have two things that will use the same automation structure then I doubt it will be worth the time investment to figure out how blueprints work.

just copy the existing automation and modify the details for your second unit.

Creating a blueprint isn’t very straightforward and in the end you will still need to modify the same details in the blueprint as you would for a new/copied automation.

Actually the blueprint will be for different times of the day as well, so probably 8 automations all the same with different times and temperature setpoints