Integer Errors with Integers Declared

I am getting these two errors looking for integers. I believe it is referring to these lines but I am not 100% sure. Ironically the code seems to work… Any help would be greatly appreciated. Thanks.

LINES

                  {% if states('counter.samuel_fan_light')|int == 1  %} on
                  {% else %} off
                  {% if states('binary_sensor.samuel_s_ceiling_fan_light_wattage') == 'off' and states('counter.samuel_fan_light')|int == 1  %} 0
                  {% elif states('binary_sensor.samuel_s_ceiling_fan_light_wattage') == 'on' and states('counter.samuel_fan_light')|int == 0 %} 1

ERRORS

Logger: homeassistant.components.automation.samuel_s_ceiling_fan_light
Source: components/automation/__init__.py:566
Integration: Automation (documentation, issues)
First occurred: 1:39:56 PM (15 occurrences)
Last logged: 1:43:16 PM

Error while executing automation automation.samuel_s_ceiling_fan_light: expected int for dictionary value @ data['value']
Logger: homeassistant.components.automation.samuel_s_ceiling_fan_light
Source: helpers/script.py:410
Integration: Automation (documentation, issues)
First occurred: 1:39:56 PM (30 occurrences)
Last logged: 1:43:16 PM

Samuel's Ceiling Fan Light: Choose at step 1: choice 5: Error executing script. Invalid data for call_service at pos 1: expected int for dictionary value @ data['value']
Samuel's Ceiling Fan Light: Error executing script. Invalid data for choose at pos 1: expected int for dictionary value @ data['value']

CODE

- alias: Samuel's Ceiling Fan Light
  trigger:
    - platform: state
      entity_id:
        - binary_sensor.samuel_ceiling_fan_light_input
      id: wall_switch
    - platform: mqtt
      topic: "home/OpenMQTTGateway/433toMQTT"
      value_template: '{{ value_json.value }}'
      payload: '16774171'
      id: remote
    - platform: mqtt
      topic: "home/OpenMQTTGateway/433toMQTT"
      value_template: '{{ value_json.value }}'
      payload: '16774172'
      id: app
    - platform: state
      entity_id:
        - counter.samuel_fan_light
      id: light_state_counter
    - platform: state
      entity_id:
        - binary_sensor.samuel_s_ceiling_fan_light_wattage
      id: light_state_watts
  action:

#Wall Switch Trigger
    - choose:
        - conditions:
            - condition: trigger
              id: wall_switch
          sequence:
            - service: script.turn_on
              data: {}
              target:
                entity_id: script.samuel_fan_wall_switch
                
#Counter State Based on RF Signal
        - conditions:
            - condition: trigger
              id: remote
          sequence:
            - service: >
                {% if states('counter.samuel_fan_light')|int > 0  %}
                  counter.reset
                {% else %}
                  counter.increment
                {% endif %}
              entity_id: counter.samuel_fan_light

#Dummy Off Payload
        - conditions:
            - condition: trigger
              id: app
          sequence:
            - delay:
                milliseconds: 250
            - service: mqtt.publish
              data:
                qos: 0
                retain: true
                topic: "home/OpenMQTTGateway/commands/MQTTto433"
                payload: '{"value":16774171,"protocol":11,"length":24,"delay":386, "repeat":5}'
            - delay: 00:00:01
            - service: counter.reset
              target:
                entity_id: 
                  - counter.samuel_fan_light

#Light State Check Based On Counter
        - conditions:
            - condition: trigger
              id: light_state_counter
          sequence:
            - service: mqtt.publish
              data:
                qos: 0
                retain: true
                topic: "home/OpenMQTTGateway/433toMQTT/Samuel_Fan/light"
                payload_template: >-
                  {% if states('counter.samuel_fan_light')|int == 1  %} on
                  {% else %} off
                  {% endif %}

#Light State Check Based On Wattage
        - conditions:
            - condition: trigger
              id: light_state_watts
          sequence:
            - service: counter.configure
              data:
                value: >
                  {% if states('binary_sensor.samuel_s_ceiling_fan_light_wattage') == 'off' and states('counter.samuel_fan_light')|int == 1  %} 0
                  {% elif states('binary_sensor.samuel_s_ceiling_fan_light_wattage') == 'on' and states('counter.samuel_fan_light')|int == 0 %} 1
                  {% endif %}
              target:
                entity_id: counter.samuel_fan_light

  mode: parallel

What is none of the two conditions are true? The value will be None, which is not an integer.

I rewrote the coded to avoid this error.

#Light State Check Based On Wattage
    - choose:
        - conditions:
            - condition: trigger
              id: light_state_watts
            - condition: state
              entity_id: binary_sensor.samuel_s_ceiling_fan_light_wattage
              state: "off"
            - condition: state
              entity_id: counter.samuel_fan_light
              state: "1"
          sequence:
            - service: counter.configure
              data:
                value: 0
              target:
                entity_id: counter.samuel_fan_light
        - conditions:
            - condition: trigger
              id: light_state_watts
            - condition: state
              entity_id: binary_sensor.samuel_s_ceiling_fan_light_wattage
              state: "on"
            - condition: state
              entity_id: counter.samuel_fan_light
              state: "0"
          sequence:
            - service: counter.configure
              data:
                value: 1
              target:
                entity_id: counter.samuel_fan_light